From listmaster at databaseadvisors.com Thu Dec 30 08:59:57 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 30 Dec 2010 09:59:57 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - UPDATE - Dec 30 @ 0955 Message-ID: Good Morning folks, I hope you didn't suffer too many withdrawals from not having your favourite lists yesterday and this morning. The Server upgrade was a challenge to say the least. A Royal PITA to say it closer to what it really was. There are still lots of things to work out, like putting the archives back online. Have no fear, your words of wisdom are being archived (for those lists that have archiving turned on), but the archives aren't available yet. The main goal was to get the lists back up and running, which it appears they are. If you encounter any abnormalities, please let me know ASAP so I can look into it. Things will slowly become normal again over the remainder of the week. Thanks for your patience. during the upgrade. -- Bryan Carbonnell - listmaster at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From shamil at smsconsulting.spb.ru Fri Dec 31 06:13:44 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 31 Dec 2010 15:13:44 +0300 Subject: [dba-VB] Ded Moroz sends you links on sample projects... :) Message-ID: <88C8330964FC47F7A753561E66B42346@nant> Hi All -- New Year Eve is approaching here, and I wanted to send you some gifts from Ded Moroz - here they are: This is a set of projects I have got developed a few days ago during 40+ hours R&D coding marathon. The task was to finish all the work in about 40 hours. So a few bugs left in there as release deadline wasn't possible to move. They (the bugs) are described in readme. But in general all the sample apps work rather well as my tests here show. I'd be interested to hear any comments - in what direction that sample should be better developed. Please write them here, or on http://northwind.codeplex.com . Please do not "judge severely" as as I noted that was very intensive R&D work with little time to think through while coding :) But feel free to comment it as you like. *Do not try* to be politcorrect. Please. I wish all of your Very Happy and Prosperous New Year! Thank you. -- Shamil P.S. Short description of published projects (the sources get downloaded 19 times already and I have got informed privately a couple of days ago just three people): NorthwindNET_4_0_Sources.zip (~24MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192044 NorthwindNET_4_0_SampleApps_Setup.zip (~5MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192043 Northwind.NET.VS2010.sln ======================== 1. Northwind.NET.EDM.FE - WinForms Front-End (just start-up class and app.config); 2. Northwind.NET.EDM.WinForms.Controls - UI UserControls; 3. Northwind.NET.EDM.Reports - MS ReportViewer 10.0 Reports; 4. Northwind.NET.BLL - Business Layer Library (ADO.NET EDM LINQ Reports' data sources); 5. Northwind.NET.Model - ADO.NET EDM; 6. Northwind.NET.Settings - application settings (wrappers); 7. Northwind.NET.Resources - application resource file; 8. Northwind.NET.Utilities - utility class library; 9. Northwind.NET.Testing.Console - some test functions - it's not true TDD - just a rough approximation; Northwind.NET.MSAccess.sln ========================== I. WinForms FE with MS Access backend Northwind.NET.FE.1.1 - Northwind.NET FE with MS Access backend Northwind.NET.Utilities - Utilities project II. ASP.NET sample application with MS Access backend E:/Projects/SMS/Northwind/Northwind.ASP.NET.MSAccess.Reporting/ - ASP.NET project III. Just a test ASP.NET app - can be removed E:\Projects\SMS\Northwind\Northwind.ASP.NET.MSAccess.Reporting.RDLC.10.0.0.0 Northwind.NET.zzz_OLD.sln ========================= 1. Northwind.NET.FE - WinForms Front-End with MS SQL backend using "plain old" ADO.NET data sets - the project we did last year's April. 2. All the other projects from as in Northwind.NET.VS2010.sln ----------- From jwcolby at colbyconsulting.com Fri Dec 31 20:56:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 31 Dec 2010 21:56:06 -0500 Subject: [dba-VB] Happy new year Message-ID: <4D1E97C6.3060000@colbyconsulting.com> To all our members around the world, may the new year be a good one. I am about to go down stairs and watch a movie with my wife, and ring in the new year with a glass of sparkling cider. If you party, do so with restraint. This is a particularly dangerous night to be out on the roads. Happy new year. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 1 00:20:26 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 09:20:26 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Message-ID: <97A3212846794197B97BAABCF7A3510D@nant> Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Dec 1 03:04:44 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 10:04:44 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView head Message-ID: Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 05:20:01 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 22:20:01 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001901cb9149$b20456a0$160d03e0$@com.au> Hi Shamil, I tried rdr.Dispose and still no luck. I don't think the datareader is the issue, it's the connection to the DB. I think the issue is not being able to set the value to nothing. Is there any way of setting the connection to nothing within a Using Statement? I appreciate your patience with me on this matter... Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 05:20:24 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 06:20:24 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001801cb910b$45a462e0$d0ed28a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> <001801cb910b$45a462e0$d0ed28a0$@com.au> Message-ID: <4CF62F78.5070000@colbyconsulting.com> Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > 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 1 05:25:15 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:25:15 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head In-Reply-To: References: Message-ID: <698BA6DF81FF4146B59F3F59A5BC1A64@nant> Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. 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: 1 ??????? 2010 ?. 12:05 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 05:49:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:49:53 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head References: Message-ID: <1EC85A575A1845A3B3D1F1352912CF74@nant> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil <<< snip >>> From Gustav at cactus.dk Wed Dec 1 06:24:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 13:24:03 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.itags.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7&hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/346e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil From actebs at actebs.com.au Wed Dec 1 07:16:38 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:16:38 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF62F78.5070000@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> Message-ID: <001a01cb9159$fc891430$f59b3c90$@com.au> Hi John, Wow! I'm just returning to application development after a 5 years absence. Destructor and Constructor classes are just a little out of my realm at the moment. I need to find a good resource that outlines classes use in VB.Net. Do you know of any? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 10:20 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 07:22:58 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:22:58 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001b01cb915a$df2502e0$9d6f08a0$@com.au> Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 07:45:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 08:45:06 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001a01cb9159$fc891430$f59b3c90$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> <001a01cb9159$fc891430$f59b3c90$@com.au> Message-ID: <4CF65162.6020403@colbyconsulting.com> Vlad, The destructor is not a class but (kind of) a method of the class. The destructor is called when the last reference to the class is set to null, just as the constructor is called in the new MyClass(). By creating a destructor, and placing an explicit call to all unmanaged object's Dispose() methods, the dispose of all such unmanaged objects gets called immediately as the last pointer is set to null. AFAICT (and I am no expert, so anyone else is free to jump in here) what really happens is that: 1) You create an instance to your class. 2) In your class you create a pointer to an unmanaged object such as a sql server connection. 3) You use your class 4) You do not explicitly call the dispose() of the connection but... 5) You set the last pointer to your class to null (or exit the block that defined your class)... Now... the instance of your class still sits in memory until the GC decides it needs the memory that your class takes up, but it may be quite some time before it does so. AFAICT when the GC actually gets around to disposing of the memory, it explicitly attempts to call Dispose() of any unmanaged object (ignoring errors if the unmanaged object does not have a dispose method) so *at that time* the unmanaged object is finally released. By your creating a destructor and explicitly calling the unmanaged object's dispose() method in the destructor, the unmanaged object is released at the instant the last pointer to the class is set to null (when the containing block is exited). Thus YOU decide the timing, rather than the GC deciding the timing. This was an issue to me because I was creating thousands of connections in a very short period of time. Because the GC decided I had lots of memory and it didn't need to take out the trash for long periods, I ran out of connections. By explicitly creating destructors in every class that created a connection, and explicitly calling the dispose() of the connection (unmanaged object) in the destructor, I explicitly released the connection at the instant that the class was destroyed rather than when the GC ran, and my problems went away. Or at least this is my understanding of the process. What I know is that my problems went away when I did this. It is a PITA to create the destructor and all the code to correctly manage it but once done you are gold (for that class). Just remember to place calls to dispose() in the destructor for all unmanaged objects. John W. Colby www.ColbyConsulting.com On 12/1/2010 8:16 AM, ACTEBS wrote: > Hi John, > > Wow! I'm just returning to application development after a 5 years absence. > Destructor and Constructor classes are just a little out of my realm at the > moment. > > I need to find a good resource that outlines classes use in VB.Net. Do you > know of any? > > Thanks > > Vlad From shamil at smsconsulting.spb.ru Wed Dec 1 08:39:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 17:39:51 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001b01cb915a$df2502e0$9d6f08a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au><97A3212846794197B97BAABCF7A3510D@nant> <001b01cb915a$df2502e0$9d6f08a0$@com.au> Message-ID: Hi Vlad -- Yes, that's OK to call .Dispose() on every iteration - you're disposing current instance. When you just create a new instance by using the same object variable previous instance isn't getting disposed: it's supposed to get disposed later by Garbage Collector (GC). I must note I have never used .Dispose() for OleDbCommand and all worked well - checked with memory profiler as I noted here about yesterday. But I didn't use OleDbCommand with parameters. In your case it could also be that you use parameters and you use OleDbDataReader instance reference to set parameter values. My (wild) guess is that VS uses some optimization while translating your code into IL, and that translation results in OleDbDataReader reference "captured" by OleDbCommand reader. Then you have many cycles of rdr.Read() and on every cycle a new instance of OleDbCommand is created, and a previous one is left hanging with OleDbDataReader instance referenced from parameters. Then GC doesn't work well/promptly somehow. If you write a function to get values from OleDbDatReader: private function getFieldValue(ByRef rdr as OleDbDataReader, ByVal fldName as string) as string return rdr(fldName).ToString() end function your issue might get solved "automagically". But that is just a guess. I'd also note that the way you set parameters doesn't look good enough from here - I mean internationalization issues, which may arise if you'll use you program with different formats of day/time. (My above function sample isn't good from internationalization point of view too). If you drop using parameterized OleDbCommand and return to plain dumb string.Format(....) to make Insert sql command text it would be easier to handle internationalization issues IMO, and also you can just create OleDbCommand once and then set its connection property before your While(rdr.read()) cycle, and set CommandText property on every iteration, and then calling .Dispose within every cycle will not be needed as you'll use the same OleDbCommand instance, and I suppose calling .Dispose for OleDbCommand after End While will not be needed at all... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 16:23 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 09:00:47 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 18:00:47 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <93125E633C84416C87A4A89117ADED7C@nant> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Wed Dec 1 16:28:18 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 23:28:18 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav From shamil at smsconsulting.spb.ru Wed Dec 1 16:58:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 01:58:21 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <00263D45306144F1AB39894F91360A4E@nant> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 04:27:10 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 11:27:10 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From shamil at smsconsulting.spb.ru Thu Dec 2 06:22:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 15:22:18 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <97D4BD40E52F4C43AC4CA44AEC90560E@nant> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 07:56:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 14:56:47 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil That sounds like a good approach. I just wondered because the option to build custom controls is promoted quite a lot. /gustav >>> shamil at smsconsulting.spb.ru 02-12-2010 13:22 >>> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From jwcolby at colbyconsulting.com Thu Dec 2 09:06:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 02 Dec 2010 10:06:57 -0500 Subject: [dba-VB] How to - Test environment Message-ID: <4CF7B611.7090706@colbyconsulting.com> I am trying to figure out how to do a test environment for C# development. I have a SQL Server with a bunch of application specific databases. We are developing a custom C# application to drive this business. My problem is that ATM I cannot run the program while my developer is working on the application because we are operating out of the same database. Due to the size of the database and my finances, cloning it on a dev environment server is not feasible. This means I need a software solution. My solution as of this morning is to add a field to the supervisor table that is either null (default) or holds a machine name string. By adding a couple of controls in the application I can fill in this field with a machine name when a "test" check box is set in the interface form and we add a record to that table. Then when anyone runs the program, the code checks for the test checkbox and only pulls records for that machine if the check box is set. This seems rather kludgy. If anyone has addressed this, please let me know how you are doing it. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:14:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:14:30 -0500 Subject: [dba-VB] Thread safe list Message-ID: <4CF8ED36.8070906@colbyconsulting.com> I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 3 07:40:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 16:40:21 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8ED36.8070906@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com> Message-ID: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Hi John -- I do use a dedicated static object instance to lock shared lists, dictionaries, ... (obviously psuedocode) Dictionary<> Dict; private static object _dictLocker = new object(); public void AddObjToList(obj) { lock(_dictLocker) { Dict.Add(); } } private GetObjFromList() { lock(_dictLocker) { Obj = Dict[0]; } Continue processing Obj here... } Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:15 To: VBA Subject: [dba-VB] Thread safe list I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 07:41:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:41:55 -0500 Subject: [dba-VB] C# and .Net 4.0 Message-ID: <4CF8F3A3.4050806@colbyconsulting.com> Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:57:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:57:06 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> References: <4CF8ED36.8070906@colbyconsulting.com> <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Message-ID: <4CF8F732.3010703@colbyconsulting.com> OK, two questions: 1) Does it have to be static? 2) My "GetObjFromList" actually uses a foreach(). It seems that is not going to work so well... Basically all of the work is done inside of that ForEach which would block the thread placing objects onto the list for long periods. Is it possible to somehow use ForEach and lock of the object being iterated or am I going to have to move to a do loop construct where I lock / grab an object / process? John W. Colby www.ColbyConsulting.com On 12/3/2010 8:40 AM, Shamil Salakhetdinov wrote: > Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places objects onto > a list for processing. > Another gets pointers to objects on the list for processing, and later > removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some sort > since a simultaneous write by one thread while reading by the other will > cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no clear > example of two different methods actually locking / unlocking the collection > object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place an > object onto the list. I have another (private) method called by the class > to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] C# and .Net 4.0 In-Reply-To: <4CF8F3A3.4050806@colbyconsulting.com> References: <4CF8F3A3.4050806@colbyconsulting.com> Message-ID: John -- As far as I see you can't create .NET Framework 4.0 projects in VS2008. :( Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:42 To: VBA Subject: [dba-VB] C# and .Net 4.0 Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8F732.3010703@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> Message-ID: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Hi John -- 1. Yes, static. Object ref isn't thread-safe AFAIU. 2. Yes, foreach isn't good. You can use int count = getCount(); // getCount should use locking for (int i=0; i Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places > objects onto a list for processing. > Another gets pointers to objects on the list for processing, and > later removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some > sort since a simultaneous write by one thread while reading by the > other will cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no > clear example of two different methods actually locking / unlocking > the collection object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place > an object onto the list. I have another (private) method called by > the class to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 13:39:03 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 14:39:03 -0500 Subject: [dba-VB] PGP Message-ID: <4CF94757.1070005@colbyconsulting.com> Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 14:15:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 15:15:43 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Message-ID: <4CF94FEF.8010902@colbyconsulting.com> I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking > for (int i=0; i { > MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, which will > be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that advanced > stuff... > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Dec 3 14:25:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 23:25:58 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF94FEF.8010902@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com><7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> <4CF94FEF.8010902@colbyconsulting.com> Message-ID: <2CAA780B74744345B7B244545399626D@nant> John -- <<< I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? >>> Yes. You can serialize/deserialize whole collections. No need to program imperatively such serialization/deserialization usually. Just Xml attributes and tiny generic serialize/deserialize methods will do all the tricks. It would be lighting fast for your collections having under hundred objects. Folks tend to use JSON for serialization/deserialization these days. But I haven't used it yet. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 23:16 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Thread safe list I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking for (int i=0; > i MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, > which will be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that > advanced stuff... > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 18:45:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 03:45:54 +0300 Subject: [dba-VB] Observations on VS2008 - not good but having simple workarounds ... Message-ID: Hi All -- Just echoing Mark Simms' thread from AccessD ("Observations on AC 2007) :) - here is one of VS2008 "glitches": http://sms-web.biz/ss/nierr.jpg I mean that cryptic and with a cut ending part error message which you can see on the above screenshot reported by VS2008 while in design mode. The only solution to this issue was to quit & start VS2008 again - and it worked fine. That happens with VS2008, it can also GPF once in a while etc. So, when you get stuck with such VS2008 issues try to "Clean All" followed by "Rebuild All" - if that would not help then just restart VS2008 - in 90% of cases that "simple trick" helps... Thank you. -- Shamil From stuart at lexacorp.com.pg Fri Dec 3 23:43:46 2010 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 04 Dec 2010 16:43:46 +1100 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CF9D512.22578.1E2F04EE@stuart.lexacorp.com.pg> http://www.gnupg.org/ The GNU Privacy Guard GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. Version 2 of GnuPG also provides support for S/MIME. GnuPG is Free Software (meaning that it respects your freedom). It can be freely used, modified and distributed under the terms of the GNU General Public License . GnuPG comes in two flavours: 1.4.11 is the well known and portable standalone version, whereas 2.0.16 is the enhanced and somewhat harder to build version. Project Gpg4win provides a Windows version of GnuPG. It is nicely integrated into an installer and features several frontends as well as (German) manuals. -- Stuart On 3 Dec 2010 at 14:39, jwcolby wrote: > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Dec 4 06:38:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 15:38:52 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: Hi John -- If the task is to just use cryptography to encrypt/decrypt data sent via Internet then you can use .NET built-in advanced cryptography classes/algorithms: http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec tionID=60 http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 5053700AM/CryptographyInDotNET.aspx http://www.codeproject.com/KB/security/dotnetcryptog.aspx Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 22:39 To: VBA Subject: [dba-VB] PGP Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 10:43:07 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 11:43:07 -0500 Subject: [dba-VB] PGP In-Reply-To: References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CFA6F9B.5000804@colbyconsulting.com> PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent via > Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > 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 shamil at smsconsulting.spb.ru Sat Dec 4 11:46:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 20:46:46 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CFA6F9B.5000804@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> <4CFA6F9B.5000804@colbyconsulting.com> Message-ID: John -- PGP uses IDEA algorithm by default they say here: http://stackoverflow.com/questions/3321174/what-algorithm-does-pgp-use-to-en crypt-the-private-key-using-the-passphrase Try to google it for C# implementation: http://www.google.ru/#hl=ru&&sa=X&ei=R336TK3pAoXsOdzE4NQK&sqi=2&ved=0CC4QBSg A&q=C%23+IDEA+algorithm+implementation&spell=1&fp=eb9a0cff6abb8ea8 If that will not work then it should not be a big issue to wrap a free command line PGP (GNU?) utility into a C# class library simple API activating such utility and collecting its results... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 4 ??????? 2010 ?. 19:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] PGP PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent > via Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1& > SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1 > 128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 16:26:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 17:26:43 -0500 Subject: [dba-VB] use a font in a class Message-ID: <4CFAC023.7010905@colbyconsulting.com> I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:52:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:52:18 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: Hi John -- What is that for: Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ? Note that you have new Font(Font, ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:55:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:55:34 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> John -- You can use: Font font = new Font(this.Font, FontStyle.Bold); Ignore my prev. posting in this thread. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 17:25:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:25:25 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <4CFACDE5.2000003@colbyconsulting.com> Yes, to set the font for a specific column. > Note that you have > new Font(Font, Yes, I know. I didn't write the code, but if I try to mod that part (for ecample lowercase the first letter) it won't compile. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:52 PM, Shamil Salakhetdinov wrote: > Hi John -- > > What is that for: > > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > > ? > > Note that you have > > new Font(Font, ... > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Dec 4 17:27:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:27:30 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> References: <4CFAC023.7010905@colbyconsulting.com> <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> Message-ID: <4CFACE62.8040608@colbyconsulting.com> Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 4 17:46:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 02:46:51 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFACE62.8040608@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: But you can pass form's Font instance to your class as a parameter, dont' you?... Or you can create a Font instance in your class, don't you? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 2:28 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff > into the list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, > bold); //status text > } > > Now I want to wrap the list and this code in a class so that I do not > have to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) > that Font reference only works in a form. > > Is there any way other than passing the font in to this method to us > the code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 19:25:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 20:25:19 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: <4CFAE9FF.4030403@colbyconsulting.com> > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, "this" is > the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:39:07 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:39:07 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAE9FF.4030403@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> Message-ID: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> John -- Did you try it like that?: //----------------------------------------- using System.Drawing; ... Font font = new Font("Arial", 3.1f); System.Console.WriteLine("{0}", font); // the above line will output: //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] //----------------------------------------- with System.Windows.Forms and System.Drawing references set? It works here in console app or class lib. I have used something like that many times... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 4:25 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, > "this" is the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 20:42:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 21:42:39 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> <71FC24F2CFA54A19AD4CCB53DA53917C@nant> Message-ID: <4CFAFC1F.70709@colbyconsulting.com> No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); > // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in a > class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >>> bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do not >>> have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:56:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:56:54 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAFC1F.70709@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com><71FC24F2CFA54A19AD4CCB53DA53917C@nant> <4CFAFC1F.70709@colbyconsulting.com> Message-ID: <66F2AA795DF244B1AC1EE7E74A3BBB0E@nant> Try it, it will make the "trick". Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 5:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, > GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in > a class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, >>> Color.White, bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do >>> not have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 23:55:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 00:55:25 -0500 Subject: [dba-VB] Blocking Message-ID: <4CFB294D.8040709@colbyconsulting.com> I have a trick new status listview and wrapper class to hold the delegates and all of the code for manipulating the status listview. It is all working fine. I added a new method of the wrapper class to call the ListView.Clear to clear out the list view. When I call that from the form's thread immediately before my process starts (the thread from the process ends up writing to that ListView through a delegate) it appears that I get a deadlock of some kind. The listview goes funny looking and the application hangs. If I comment out the call to the clear, everything works fine. I need to clear the listview before each run though so I need to make this work. I am not sure how to get the clear working. Any ideas? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Dec 5 12:43:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 13:43:06 -0500 Subject: [dba-VB] Tough to track down bug (in VS?) Message-ID: <4CFBDD3A.4050705@colbyconsulting.com> I ended up with a list view with a column named DateTime. The .Net framework has a DateTime object. As soon as I dropped a copy of this list view on a form that had the .Net DateTime object in its code, the project had build errors. VS decided that the DateTime object (DateTime.now anyone?) that was already in my code was magically a column object, which dies not have a .Now property. Lesson (which everyone already knows): Never name your objects using keywords from the language. As soon as I renamed my column to Date_Time, VS went through the code in that form and renamed the DateTime objects out in code to Date_Time as well. Once I found and fixed *those*, voila, my code compiled again. That one had me going for quite awhile. I knew it had something to do with that listview because dropping that on the form was the last thing I did before the compile error popped up, but tracking down the exact cause was tough! -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Mon Dec 6 04:20:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 11:20:03 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From shamil at smsconsulting.spb.ru Mon Dec 6 04:29:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 13:29:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Mon Dec 6 05:15:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 12:15:21 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From marklbreen at gmail.com Mon Dec 6 06:03:18 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 6 Dec 2010 12:03:18 +0000 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <58D794B0B29E4F709D49D46577A5B050@nant> Thank you, Mark. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 6 ??????? 2010 ?. 15:03 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Thank you, Gustav, -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ??????? 2010 ?. 14:15 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Silverlight 5 in 2011 Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From ha at phulse.com Mon Dec 6 07:26:47 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Mon, 6 Dec 2010 05:26:47 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:44:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:44:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Hans-Christian -- I suppose that "rumors about that Silverlight is dead are greatly exaggerated" :) I do not intend to start a "religious war" here iPhone, IPad, ... vs. Windows 7 Phone but I'd expect MS will make it this time as they did it many times before - they will get at least 50%(I'd bet) of the mobile/smart phones installed OSes market sooner or later... I can be wrong of course. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Hans-Christian Andersen Sent: 6 ??????? 2010 ?. 16:27 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > From accessd at shaw.ca Mon Dec 6 12:02:01 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 6 Dec 2010 10:02:01 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <811DDCCD3842473E8DB5C7AEF52DDB2B@creativesystemdesigns.com> Gustav: Have you heard what percentage of computers are now using or have it installed it on their computers? It seems Silverlight is competing with Flash and HTML5 and both these products which seem very well established and run on all platforms. Here is an ASP.Net programmer's 10 recommended supporting applications for development work: http://stephenwalther.com/blog/archive/2010/11/22/10-essential-tools-for-bui lding-asp-net-websites.aspx Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, December 06, 2010 2:20 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Tue Dec 7 21:18:32 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 8 Dec 2010 14:18:32 +1100 Subject: [dba-VB] Type Is Not Defined Message-ID: <000101cb9686$9805c490$c8114db0$@com.au> Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad From michael at ddisolutions.com.au Wed Dec 8 16:22:20 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 09:22:20 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 From actebs at actebs.com.au Wed Dec 8 20:56:51 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 13:56:51 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> Message-ID: <000601cb974c$bac8c6a0$305a53e0$@com.au> Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Dec 8 21:23:27 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 14:23:27 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 From actebs at actebs.com.au Wed Dec 8 21:58:25 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 14:58:25 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au><000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <000701cb9755$54841df0$fd8c59d0$@com.au> Now that's funny! Yep in Canberra and it's just stopped raining! Over 100mm overnight and everything is under water. Luckily we haven't been affected, but a lot of people around Canberra are struggling... Where are you located? Have you been affected by the rains? I've got the Crystal Report to work with some mucking around, but once I've gotten the hang of it, it seems OK. When you say huge assemblies to move around, aren't they just part of the .Net Framework or are there additional files to be included in the install package? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 2:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 8 22:05:47 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 08 Dec 2010 23:05:47 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <4D00559B.6050008@colbyconsulting.com> I love .Net. Someday I will be good enough to whip out .Net apps like I can whip out Access apps. ;) John W. Colby www.ColbyConsulting.com On 12/8/2010 10:23 PM, Michael Maddison wrote: > Lol, > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb > > > > It used to be like pulling teeth to get it to work right. Had to write > heaps of code to make them portable IIRC. > > Huge assemblies to move around and keep up to date. > > I haven't used it for years, I just use MS builtin reports now. > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > BTW you're in Canberra aren't you? > > Keeping dry? > > > > Cheers > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Thursday, 9 December 2010 1:57 PM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] Type Is Not Defined > > > > Hi Michael, > > Thanks for your reply. I got to the bottom of it eventually. I needed to > make a data table schema of what I wanted returned from the DB. After I > did > that, everything worked as expected. > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > why > wouldn't you use that as a basis for learning how to use classes? > > Thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > Maddison > Sent: Thursday, 9 December 2010 9:22 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Type Is Not Defined > > The compiler cant find 'CustomerDataSetSchema'. > > Is it in another project? Set a ref to the project. > > If you don't have the class then you need to get it and it needs to be > in the scope of the calling class, the tutorial should have it. > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > tutorial! > > > > Cheers > > > > Michael > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Wednesday, 8 December 2010 2:19 PM > To: 'dba-vb' > Subject: [dba-VB] Type Is Not Defined > > > > Hi Everyone, > > > > This is my first attempt at a class, so don't laugh. I am doing this via > a > tutorial, and keep getting: > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > I can't understand why this is throwing this error and hope someone can > shed > some light on it. The code is below: > > > > Imports System.Data > > Imports System.Data.OleDb > > > > Public Class DataSetConfiguration > > 'Private Const CONNECTION_STRING As String = > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb" > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > Private Const DATATABLE_NAME As String = "tblMainData" > > 'Bloew is for use within a website > > 'Private Const DIRECTORY_FILE_PATH As String = > "C:\WebSites\VB_Web_Data_DataSets\" > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > Get > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > Dim myOleDbConnection As OleDbConnection = New > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > Return myDataSet > > > > End Get > > End Property > > > > End Class > > > > Many Thanks > > > > Vlad > > > > > > > > > > > > _______________________________________________ > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > _______________________________________________ > 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 Thu Dec 9 03:14:09 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 09:14:09 +0000 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <4D00559B.6050008@colbyconsulting.com> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/8/2010 10:23 PM, Michael Maddison wrote: > > Lol, > > > > > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb > > > > > > > > It used to be like pulling teeth to get it to work right. Had to write > > heaps of code to make them portable IIRC. > > > > Huge assemblies to move around and keep up to date. > > > > I haven't used it for years, I just use MS builtin reports now. > > > > > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > > > > > BTW you're in Canberra aren't you? > > > > Keeping dry? > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Thursday, 9 December 2010 1:57 PM > > To: 'Discussion concerning Visual Basic and related programming issues.' > > Subject: Re: [dba-VB] Type Is Not Defined > > > > > > > > Hi Michael, > > > > Thanks for your reply. I got to the bottom of it eventually. I needed to > > make a data table schema of what I wanted returned from the DB. After I > > did > > that, everything worked as expected. > > > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > > why > > wouldn't you use that as a basis for learning how to use classes? > > > > Thanks... > > > > Vlad > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > > Maddison > > Sent: Thursday, 9 December 2010 9:22 AM > > To: Discussion concerning Visual Basic and related programming issues. > > Subject: Re: [dba-VB] Type Is Not Defined > > > > The compiler cant find 'CustomerDataSetSchema'. > > > > Is it in another project? Set a ref to the project. > > > > If you don't have the class then you need to get it and it needs to be > > in the scope of the calling class, the tutorial should have it. > > > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > > tutorial! > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Wednesday, 8 December 2010 2:19 PM > > To: 'dba-vb' > > Subject: [dba-VB] Type Is Not Defined > > > > > > > > Hi Everyone, > > > > > > > > This is my first attempt at a class, so don't laugh. I am doing this via > > a > > tutorial, and keep getting: > > > > > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > > > > > I can't understand why this is throwing this error and hope someone can > > shed > > some light on it. The code is below: > > > > > > > > Imports System.Data > > > > Imports System.Data.OleDb > > > > > > > > Public Class DataSetConfiguration > > > > 'Private Const CONNECTION_STRING As String = > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > > Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb" > > > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > > > Private Const DATATABLE_NAME As String = "tblMainData" > > > > 'Bloew is for use within a website > > > > 'Private Const DIRECTORY_FILE_PATH As String = > > "C:\WebSites\VB_Web_Data_DataSets\" > > > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > > > Get > > > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > > > Dim myOleDbConnection As OleDbConnection = New > > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > > > Return myDataSet > > > > > > > > End Get > > > > End Property > > > > > > > > End Class > > > > > > > > Many Thanks > > > > > > > > Vlad > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Thu Dec 9 04:36:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 09 Dec 2010 11:36:47 +0100 Subject: [dba-VB] Type Is Not Defined Message-ID: Hi Mark Love SQL Server? Not me. Like John I prefer to spend time with VS and .Net. /gustav >>> marklbreen at gmail.com 09-12-2010 10:14 >>> Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 9 05:17:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 06:17:48 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: <4D00BADC.4040301@colbyconsulting.com> Mark, I am a programmer at heart and .Net and C# gives me programming power like I have never had before. I love SQL Server for it's ability to give me big iron database engine capabilities, but I do not spend time in it, I just use it. I have never learned how to debug code in SQL Server the way I can in VS, so basically I write in C# and just drive SQL Server with my C# code. John W. Colby www.ColbyConsulting.com On 12/9/2010 4:14 AM, Mark Breen wrote: > Hey John, > > Just curious, would you say you love SQL Server also? > > I suppose if I love software of any kind, it has to be SQL server. > > Mark > > > > On 9 December 2010 04:05, jwcolby wrote: > >> I love .Net. Someday I will be good enough to whip out .Net apps like I >> can whip out Access apps. ;) >> >> John W. Colby >> www.ColbyConsulting.com From actebs at actebs.com.au Thu Dec 9 06:16:04 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 23:16:04 +1100 Subject: [dba-VB] VB.Net and Microsoft Report Viewer Message-ID: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad From shamil at smsconsulting.spb.ru Thu Dec 9 09:27:59 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 9 Dec 2010 18:27:59 +0300 Subject: [dba-VB] VB.Net and Microsoft Report Viewer In-Reply-To: <000801cb979a$d9b24d90$8d16e8b0$@com.au> References: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Message-ID: <33A5DC6AE6554B2EAF023160C2225706@nant> Hi Vlad -- <<< I would check out the Microsoft Report Viewer. Can anyone show me an example of how to achieve this please? >>> Welcome to http://northwind.codeplex.com/ ! <<< the issues distributing your app using the Crystal Report Viewer >>> That usually works well - you just need to install CRV runtime... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 9 ??????? 2010 ?. 15:16 To: 'dba-vb' Subject: [dba-VB] VB.Net and Microsoft Report Viewer Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:30:04 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:30:04 -0500 Subject: [dba-VB] Snippet editor Message-ID: <4D01121C.2010806@colbyconsulting.com> Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Thu Dec 9 11:33:50 2010 From: df.waters at comcast.net (Dan Waters) Date: Thu, 9 Dec 2010 11:33:50 -0600 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01121C.2010806@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> Message-ID: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> I did a search on 'visual studio snippets tutorial' and got lots of hits. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 09, 2010 11:30 AM To: VBA Subject: [dba-VB] Snippet editor Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:53:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:53:33 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> Message-ID: <4D01179D.5000003@colbyconsulting.com> As did I all about hand editing xml files. YUK! I thought perhaps someone on this list was using an actual snippet editor that integrated into SQL Server and allowed me to edit the snippet directly. John W. Colby www.ColbyConsulting.com On 12/9/2010 12:33 PM, Dan Waters wrote: > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 09, 2010 11:30 AM > To: VBA > Subject: [dba-VB] Snippet editor > > Does anyone know of one that is easy to use and integrated in VS? > From marklbreen at gmail.com Thu Dec 9 14:42:41 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 20:42:41 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01179D.5000003@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> Message-ID: Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet editor > that integrated into SQL > Server and allowed me to edit the snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > 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 9 15:42:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 00:42:39 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com> Message-ID: <19ACDAEBEACD47DB894BE71AFD067417@nant> Hi Mark -- <<< I struggle now when I am on a box that does not have it installed. >>> One of the best memory trainings is to study and to master SQL syntax hand typing from one own "memory cells", no Intellisense help of any kind provided:) I know, I know... lazy MS Access developers, spoiled by QBE (myself included) are rarely able to type lengthy SQL expressions from their own memory... :) 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: 9 ??????? 2010 ?. 23:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet > editor that integrated into SQL Server and allowed me to edit the > snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Fri Dec 10 03:25:42 2010 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 10 Dec 2010 09:25:42 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <19ACDAEBEACD47DB894BE71AFD067417@nant> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Dec 10 05:11:27 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 06:11:27 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: <4D020ADF.3080502@colbyconsulting.com> Yea, it is common. Who did you say you are? John W. Colby www.ColbyConsulting.com On 12/10/2010 4:25 AM, Mark Breen wrote: > Hi Shamil, > > Speaking of memory, > > I am 41 and I notice in the last 12 - 24 months that I no longer have the > memory I had when I was in my 20s and 30s. I am told by a few people that > it is rather common, but I still hate this lack of feeling sharp - does > anyone else recognise this. Is it common as a few friends have said? IOW > am I just getting old? > > Mark > > > > On 9 December 2010 21:42, Shamil Salakhetdinov > wrote: > >> >> Hi Mark -- >> >> <<< >> I struggle now when I am on a box that does not have it installed. >>>>> >> One of the best memory trainings is to study and to master SQL syntax hand >> typing from one own "memory cells", no Intellisense help of any kind >> provided:) >> I know, I know... lazy MS Access developers, spoiled by QBE (myself >> included) are rarely able to type lengthy SQL expressions from their own >> memory... >> >> :) >> >> 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: 9 ??????? 2010 ?. 23:43 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] Snippet editor >> >> Hello John, >> >> I use SQL Promot by redgate and find it extremely useful, so much so, I >> struggle now when I am on a box that does not have it installed. >> >> thanks >> >> Mark >> >> >> On 9 December 2010 17:53, jwcolby wrote: >> >>> As did I all about hand editing xml files. >>> >>> YUK! >>> >>> I thought perhaps someone on this list was using an actual snippet >>> editor that integrated into SQL Server and allowed me to edit the >>> snippet directly. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 12/9/2010 12:33 PM, Dan Waters wrote: >>>> I did a search on 'visual studio snippets tutorial' and got lots of >> hits. >>>> >>>> Dan >>>> >>>> -----Original Message----- >>>> From: dba-vb-bounces at databaseadvisors.com >>>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>>> Sent: Thursday, December 09, 2010 11:30 AM >>>> To: VBA >>>> Subject: [dba-VB] Snippet editor >>>> >>>> Does anyone know of one that is easy to use and integrated in VS? >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Fri Dec 10 08:43:08 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 10 Dec 2010 06:43:08 -0800 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark: This is why we have computers...fills in those little gaps. (Spoken from a man over 60.) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, December 10, 2010 1:26 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 08:56:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 09:56:15 -0500 Subject: [dba-VB] how do i get coderush back Message-ID: <4D023F8F.40804@colbyconsulting.com> I have coderush on my computer, and I see it working in the little lines that show the program structure, but I do not have the code rush menu or toolbar. Any idea how to get those back? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 10 09:06:23 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 18:06:23 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com><19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark -- <<< I am 41... am I just getting old? >>> Not old but older. When you turned your 40 you've got to the "mature people club". Welcome to the Club! :) 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: 10 ??????? 2010 ?. 12:26 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax > hand typing from one own "memory cells", no Intellisense help of any > kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their > own memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, > I struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots > > > of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 15:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:30:11 -0500 Subject: [dba-VB] Web page manipulation Message-ID: <4D029BE3.1070407@colbyconsulting.com> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Dec 10 15:33:49 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:33:49 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Yes. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Dec 10 15:44:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:44:30 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D029F3E.5080401@colbyconsulting.com> You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > From DWUTKA at Marlow.com Fri Dec 10 15:54:01 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:54:01 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029F3E.5080401@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: No. You asked if you can programmatically manipulate web pages to cause specific pages to open, etc. The answer is yes. You didn't ask how to do it! LOL I have done a few projects that do this. The 'how' is both simple, complicated, easy, and a complete PITA. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:45 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From davidmcafee at gmail.com Fri Dec 10 16:16:29 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:16:29 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: If you know the final link to the file in question you can use that. That's what I do with some of the click once stuff for prerequisites. On Fri, Dec 10, 2010 at 1:54 PM, Drew Wutka wrote: > No. You asked if you can programmatically manipulate web pages to cause > specific pages to open, etc. The answer is yes. You didn't ask how to > do it! LOL > > I have done a few projects that do this. The 'how' is both simple, > complicated, easy, and a complete PITA. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:45 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > You must be a Microsoft employee eh? ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/10/2010 4:33 PM, Drew Wutka wrote: > > Yes. > > > > Drew > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Friday, December 10, 2010 3:30 PM > > To: VBA > > Subject: [dba-VB] Web page manipulation > > > > My client has to go through a process where he clicks about 20 - 30 > > things to manage to get a file > > downloaded. It sounded totally convoluted but the question is (and I > > have asked this before without > > a usable response) can I programmatically manipulate web pages to > cause > > specific pages to open, > > click buttons, input data into controls etc. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 10 16:28:43 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 10 Dec 2010 23:28:43 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John It is. I even think I posted a code snippet in C# I ran with success when you asked for this the first time. The trick these days is to find out which Java Script functions and parameters are called for navigating the pages and submit data. I used FireFox and an HTTP add-in debugger and/or Google Chrome and its debug feature for this. Be prepared for some "fun" hours and start with testing your code towards a simple site. /gustav >>> jwcolby at colbyconsulting.com 10-12-2010 22:30 >>> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From davidmcafee at gmail.com Fri Dec 10 16:24:08 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:24:08 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: Message-ID: not to mention when they make changes to their site. On Fri, Dec 10, 2010 at 2:28 PM, Gustav Brock wrote: > > Be prepared for some "fun" hours and start with testing your code towards a > simple site. > > /gustav > > From DWUTKA at Marlow.com Fri Dec 10 16:33:05 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 16:33:05 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Now for a little more info for you. Yes, you can certainly do this. Technically, it's not much different than if someone handed you an .mde, and asked you to automate tasks in the mde (so you couldn't tweak the source code running the program itself, but you could open the mde with VBA, and use the objects within it just like you'd use the objects in your own application.) Trick #1: Just like with an .mde, you have to have a reference to the database itself, so with a browser, you need a reference to it. You can either programmatically open a browser window (so you'll both create the object, and have a reference to it), or you can ask the user which browser window they want you to use (so you can grab the browser window through code). Here's an example of how to grab an existing browser window: Function GetExistingBrowser(strKey As String) Dim SWs As New SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As InternetExplorer Dim Resp For Each IE In SWs Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + vbQuestion, "Select IE") If Resp = vbYes Then Set mdie = Nothing Set mdie = IE.Application NewSormDataEntry strKey, mdie Exit Function End If Next End Function The 'NewSormDataEntry' function is the function I am sending the mdie object too (the referenced browser window). In this function strKey is the primary key of a record that will be used in that NewSormDataEntry to submit data into a web site. Trick #2: Just like when the development world got a wedgie when Microsoft 'secured' Outlook from programs just using it to send email, web security can be a real pain in doing something like this. The security is put in place to impede (note, I didn't say prevent) a hacker from doing nasty stuff to the site. So the 'impeding' garbage designed to trip up hackers can get in the way of a legitimate developer trying to create a helpful tool. So before you COMMIT to being able to make the tool, you'll need to look at the site itself, to see what all will get in your way. Trick #3: There are two ways to 'find' the objects you will need your code to work with. The first is to just look at the HTML of the page(s) you are going to manipulate. This is where some of those 'impediments' come into play. Some sites prevent you from right clicking on a page and selecting 'View Source'. Ironically, this is just removing a 'shortcut' way to view the HTML source behind a page. It doesn't actually HIDE the source, because your browser is viewing the source, it has too, otherwise it will have nothing to display. So there are multiple ways to 'download' the HTML you can view yourself. Create your own browser, and dump the HTML to a file. You can also use API calls to just directly download the HTML, without a browser. If the page is derived from internal (on the website server) variables, you'll need to use your own browser to get there and download the source. The second way to 'find' the objects you need to deal with are with the object browser. Running your code in debug mode, you'll be able to see the browser object, and all of it's child elements. Trick #4: Events and properties. Setting the value of a textbox, or clicking a button, just requires that you know what the events and properties of those objects are. I use the MSDN that came with the developer edition of Office 2000. It's got a nice HTML guide with common HTML form elements, their properties, methods, and events. But all that information is also plastered all over the web. Trick #5: When a page loads, the browser object is there, but you may not be able to capture 'download complete' events. What I have done in these cases, where my code puts in data on a page, clicks a button to go to the next page, I put my code in a loop, that sits and waits for an object from the next page to exist. Of course, if there are applets, or flash media elements, required for interaction... can't help ya there, haven't tackled one of those. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sun Dec 12 23:32:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 00:32:34 -0500 Subject: [dba-VB] Browser based database Message-ID: <4D05AFF2.3070701@colbyconsulting.com> I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Dec 13 00:03:50 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 13 Dec 2010 17:03:50 +1100 Subject: [dba-VB] Browser based database References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <99266C61B516644D9727F983FAFAB465046771@remote.ddisolutions.com.au> John, I was the same way. Still very much finding my way in ASP.net. But the basics are pretty straightforward. An ASP.net application is basically, Normal .net code, c# or vb.net whatever. Normal HTML Javascript (optional)(inserted by VS) Create a new asp.net project. Add a webform, select code in separate file. Change to split view Add a SQLDataSource control to the designer part of the form, hook it up to a small table. Add a DataGrid control to the designer part of the form, set the datasource. Run the project. See http://www.asp.net/get-started to get started. I've only done web forms and Ajax so far. Cheers Michael M From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 13 December 2010 4:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com ________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3311 - Release Date: 12/12/10 From ebarro at roadrunner.com Mon Dec 13 00:45:47 2010 From: ebarro at roadrunner.com (Eric Barro) Date: Sun, 12 Dec 2010 22:45:47 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D05AFF2.3070701@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <013d01cb9a91$604a5250$20def6f0$@com> John, ASP.NET uses either C# or VB.NET as the underlying development language. Of course there are other technologies involved such as Javascript, HMTL, CSS etc. There's no way to convert a WinForm application to a web app with one click of a button. You'd have to recreate your WinForm in ASP.NET using the built-in .NET equivalent controls. The good thing is that they are one and the same type of control on the web app (ie TextBox in WinForms is still TextBox on a web app). If you programmed your business logic in separate classes and you refrained from directly referencing controls in the methods then you should be fine and you should be able to use most of your code in a web app. The main things you will need to deal with in a web app such as ASP.NET are the following: 1. Session variables - this is one of the ways you can pass data back and forth from one page to the next since web apps are stateless apps and there is no "automatic way" of "remembering" data from one page to the next. 2. Postback events - when a user clicks a button on a WinForm all you need to do is trap for the click event. On a web app you need to be aware of when postbacks (basically trips to the server) occur so that you can properly trap events or intercept them. 3. Server side versus client side events - this is probably the hardest concept to grasp for most beginning web app developers. 4. Client side scripting - When it's done and said, all ASP.NET does really is render the page in HTML and handle the events using Javascript. You will need to get your feet wet learning Javascript as well. Fortunately, the syntax is based on C but variables and objects are not strongly-typed. --Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, December 12, 2010 9:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Mon Dec 13 03:45:37 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:45:37 +0000 Subject: [dba-VB] Browser based database In-Reply-To: <013d01cb9a91$604a5250$20def6f0$@com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: Hello John, There are lots of things to consider when you out an app online, security being just one. But there are really many other things also, most of which I do not know. However, I am currently happily developing web apps myself, and I spent minutes and hours on my coding. I am using DotNetNuke as my framework and it works a treat. I keep it simple and try not to get too fancy. There is loads of help available from the groups and forums. It is not too wild to suggest that in the future 50% or more of our customers will want web based front ends, so I urge you to study DNN - a few days of reading the forums and the turorials on module development will have you coding apps in no time. Do not be put off by the initial barrier to entry, once you get the hang of it, and one you keep it simple, you can code in the same ol' c# style , but your GUI will be a DNN website. Oh, and it if fun also. Mark On 13 December 2010 06:45, Eric Barro wrote: > John, > > ASP.NET uses either C# or VB.NET as the underlying development language. > Of > course there are other technologies involved such as Javascript, HMTL, CSS > etc. > > There's no way to convert a WinForm application to a web app with one click > of a button. You'd have to recreate your WinForm in ASP.NET using the > built-in .NET equivalent controls. The good thing is that they are one and > the same type of control on the web app (ie TextBox in WinForms is still > TextBox on a web app). > > If you programmed your business logic in separate classes and you refrained > from directly referencing controls in the methods then you should be fine > and you should be able to use most of your code in a web app. > > The main things you will need to deal with in a web app such as ASP.NETare > the following: > > 1. Session variables - this is one of the ways you can pass data back and > forth from one page to the next since web apps are stateless apps and there > is no "automatic way" of "remembering" data from one page to the next. > 2. Postback events - when a user clicks a button on a WinForm all you need > to do is trap for the click event. On a web app you need to be aware of > when > postbacks (basically trips to the server) occur so that you can properly > trap events or intercept them. > 3. Server side versus client side events - this is probably the hardest > concept to grasp for most beginning web app developers. > 4. Client side scripting - When it's done and said, all ASP.NET does > really > is render the page in HTML and handle the events using Javascript. You will > need to get your feet wet learning Javascript as well. Fortunately, the > syntax is based on C but variables and objects are not strongly-typed. > > --Eric > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Sunday, December 12, 2010 9:33 PM > To: VBA > Subject: [dba-VB] Browser based database > > I need to do two different browser based databases (I think). I know > nothing about this. Both > clients need to enter data and have multiple users hitting the database > from > home and office computers. > > Where do I start? I am getting pretty good with C# / SQL Server but those > are computer based > "applications". If I could do an internet download installation, I could > probably (maybe) go there. > Except what about admin rights etc. > > Is asp.net viable? Is it close to C#? If I keep the data entry screens > simple can I do it in C# > and then just "press a button" to turn it into ASP.net? Please don't make > rude noises here. > > ;) > > I just know nothing about internet facing application programming and I > feel > really inadequate on > this stuff. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 Mon Dec 13 03:48:10 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:48:10 +0000 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Hello John Another choice is to use Sillennium It is built for this task and will allow you to easily change your library of routines when your website changes. Mark On 10 December 2010 22:33, Drew Wutka wrote: > Now for a little more info for you. Yes, you can certainly do this. > Technically, it's not much different than if someone handed you an .mde, > and asked you to automate tasks in the mde (so you couldn't tweak the > source code running the program itself, but you could open the mde with > VBA, and use the objects within it just like you'd use the objects in > your own application.) > > Trick #1: Just like with an .mde, you have to have a reference to the > database itself, so with a browser, you need a reference to it. You can > either programmatically open a browser window (so you'll both create the > object, and have a reference to it), or you can ask the user which > browser window they want you to use (so you can grab the browser window > through code). > > Here's an example of how to grab an existing browser window: > > Function GetExistingBrowser(strKey As String) > Dim SWs As New SHDocVw.ShellWindows > Dim IE As SHDocVw.InternetExplorer > Dim mdie As InternetExplorer > Dim Resp > For Each IE In SWs > Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & > IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + > vbQuestion, "Select IE") > If Resp = vbYes Then > Set mdie = Nothing > Set mdie = IE.Application > NewSormDataEntry strKey, mdie > Exit Function > End If > Next > End Function > > The 'NewSormDataEntry' function is the function I am sending the mdie > object too (the referenced browser window). In this function strKey is > the primary key of a record that will be used in that NewSormDataEntry > to submit data into a web site. > > Trick #2: Just like when the development world got a wedgie when > Microsoft 'secured' Outlook from programs just using it to send email, > web security can be a real pain in doing something like this. The > security is put in place to impede (note, I didn't say prevent) a hacker > from doing nasty stuff to the site. So the 'impeding' garbage designed > to trip up hackers can get in the way of a legitimate developer trying > to create a helpful tool. So before you COMMIT to being able to make > the tool, you'll need to look at the site itself, to see what all will > get in your way. > > Trick #3: There are two ways to 'find' the objects you will need your > code to work with. The first is to just look at the HTML of the page(s) > you are going to manipulate. This is where some of those 'impediments' > come into play. Some sites prevent you from right clicking on a page > and selecting 'View Source'. Ironically, this is just removing a > 'shortcut' way to view the HTML source behind a page. It doesn't > actually HIDE the source, because your browser is viewing the source, it > has too, otherwise it will have nothing to display. So there are > multiple ways to 'download' the HTML you can view yourself. Create your > own browser, and dump the HTML to a file. You can also use API calls to > just directly download the HTML, without a browser. If the page is > derived from internal (on the website server) variables, you'll need to > use your own browser to get there and download the source. The second > way to 'find' the objects you need to deal with are with the object > browser. Running your code in debug mode, you'll be able to see the > browser object, and all of it's child elements. > > Trick #4: Events and properties. Setting the value of a textbox, or > clicking a button, just requires that you know what the events and > properties of those objects are. I use the MSDN that came with the > developer edition of Office 2000. It's got a nice HTML guide with > common HTML form elements, their properties, methods, and events. But > all that information is also plastered all over the web. > > Trick #5: When a page loads, the browser object is there, but you may > not be able to capture 'download complete' events. What I have done in > these cases, where my code puts in data on a page, clicks a button to go > to the next page, I put my code in a loop, that sits and waits for an > object from the next page to exist. > > Of course, if there are applets, or flash media elements, required for > interaction... can't help ya there, haven't tackled one of those. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > > -- > 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 > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:11:31 -0500 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: <4D0637A3.8020609@colbyconsulting.com> Thanks everyone who has responded. Both of these are cases where the company is "virtual" and all the stakeholders are scattered around. The database has to be accessed over the internet, and from who knows where. I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but then you run into installation issues etc. With "clickonce" deployment even that might be possible. I think if I could do a real app distributed with ClickOnce I would go that route. It just puts off learning all of the web / html / java stuff. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:45 AM, Mark Breen wrote: > Hello John, > > There are lots of things to consider when you out an app online, security > being just one. But there are really many other things also, most of which > I do not know. > > However, I am currently happily developing web apps myself, and I spent > minutes and hours on my coding. > > I am using DotNetNuke as my framework and it works a treat. I keep it > simple and try not to get too fancy. There is loads of help available from > the groups and forums. > > It is not too wild to suggest that in the future 50% or more of our > customers will want web based front ends, so I urge you to study DNN - a few > days of reading the forums and the turorials on module development will have > you coding apps in no time. > > Do not be put off by the initial barrier to entry, once you get the hang of > it, and one you keep it simple, you can code in the same ol' c# style , but > your GUI will be a DNN website. > > Oh, and it if fun also. > > Mark > > > On 13 December 2010 06:45, Eric Barro wrote: > >> John, >> >> ASP.NET uses either C# or VB.NET as the underlying development language. >> Of >> course there are other technologies involved such as Javascript, HMTL, CSS >> etc. >> >> There's no way to convert a WinForm application to a web app with one click >> of a button. You'd have to recreate your WinForm in ASP.NET using the >> built-in .NET equivalent controls. The good thing is that they are one and >> the same type of control on the web app (ie TextBox in WinForms is still >> TextBox on a web app). >> >> If you programmed your business logic in separate classes and you refrained >> from directly referencing controls in the methods then you should be fine >> and you should be able to use most of your code in a web app. >> >> The main things you will need to deal with in a web app such as ASP.NETare >> the following: >> >> 1. Session variables - this is one of the ways you can pass data back and >> forth from one page to the next since web apps are stateless apps and there >> is no "automatic way" of "remembering" data from one page to the next. >> 2. Postback events - when a user clicks a button on a WinForm all you need >> to do is trap for the click event. On a web app you need to be aware of >> when >> postbacks (basically trips to the server) occur so that you can properly >> trap events or intercept them. >> 3. Server side versus client side events - this is probably the hardest >> concept to grasp for most beginning web app developers. >> 4. Client side scripting - When it's done and said, all ASP.NET does >> really >> is render the page in HTML and handle the events using Javascript. You will >> need to get your feet wet learning Javascript as well. Fortunately, the >> syntax is based on C but variables and objects are not strongly-typed. >> >> --Eric >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Sunday, December 12, 2010 9:33 PM >> To: VBA >> Subject: [dba-VB] Browser based database >> >> I need to do two different browser based databases (I think). I know >> nothing about this. Both >> clients need to enter data and have multiple users hitting the database >> from >> home and office computers. >> >> Where do I start? I am getting pretty good with C# / SQL Server but those >> are computer based >> "applications". If I could do an internet download installation, I could >> probably (maybe) go there. >> Except what about admin rights etc. >> >> Is asp.net viable? Is it close to C#? If I keep the data entry screens >> simple can I do it in C# >> and then just "press a button" to turn it into ASP.net? Please don't make >> rude noises here. >> >> ;) >> >> I just know nothing about internet facing application programming and I >> feel >> really inadequate on >> this stuff. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:33:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:33:44 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D063CD8.4020303@colbyconsulting.com> The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your library > of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an .mde, >> and asked you to automate tasks in the mde (so you couldn't tweak the >> source code running the program itself, but you could open the mde with >> VBA, and use the objects within it just like you'd use the objects in >> your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to the >> database itself, so with a browser, you need a reference to it. You can >> either programmatically open a browser window (so you'll both create the >> object, and have a reference to it), or you can ask the user which >> browser window they want you to use (so you can grab the browser window >> through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) >> Dim SWs As New SHDocVw.ShellWindows >> Dim IE As SHDocVw.InternetExplorer >> Dim mdie As InternetExplorer >> Dim Resp >> For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey is >> the primary key of a record that will be used in that NewSormDataEntry >> to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send email, >> web security can be a real pain in doing something like this. The >> security is put in place to impede (note, I didn't say prevent) a hacker >> from doing nasty stuff to the site. So the 'impeding' garbage designed >> to trip up hackers can get in the way of a legitimate developer trying >> to create a helpful tool. So before you COMMIT to being able to make >> the tool, you'll need to look at the site itself, to see what all will >> get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need your >> code to work with. The first is to just look at the HTML of the page(s) >> you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, it >> has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create your >> own browser, and dump the HTML to a file. You can also use API calls to >> just directly download the HTML, without a browser. If the page is >> derived from internal (on the website server) variables, you'll need to >> use your own browser to get there and download the source. The second >> way to 'find' the objects you need to deal with are with the object >> browser. Running your code in debug mode, you'll be able to see the >> browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. But >> all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you may >> not be able to capture 'download complete' events. What I have done in >> these cases, where my code puts in data on a page, clicks a button to go >> to the next page, I put my code in a loop, that sits and waits for an >> object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required for >> interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file >> downloaded. It sounded totally convoluted but the question is (and I >> have asked this before without >> a usable response) can I programmatically manipulate web pages to cause >> specific pages to open, >> click buttons, input data into controls etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for the >> person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI >> Business >> Sensitive material. If you are not the intended recipient, please contact >> the sender >> immediately and destroy the material in its entirety, whether electronic or >> hard copy. >> You are notified that any review, retransmission, copying, disclosure, >> dissemination, >> or other use of, or taking of any action in reliance upon this information >> by persons >> or entities other than the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From davidmcafee at gmail.com Mon Dec 13 10:09:41 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 08:09:41 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D0637A3.8020609@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: U use a click once app for our nationwide sales force. Very easy to implement and using webservice calls, seems like a local app. I'll post some samples when I get into the office Sent from my Droid phone. On Dec 13, 2010 7:12 AM, "jwcolby" wrote: > > Thanks everyone who has responded. > > Both of these are cases where the company is "virtual" and all the stakeholders are scattered > around. The database has to be accessed over the internet, and from who knows where. > > I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but > then you run into installation issues etc. With "clickonce" deployment even that might be possible. > I think if I could do a real app distributed with ClickOnce I would go that route. It just puts > off learning all of the web / html / java stuff. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:45 AM, Mark Breen wrote: > > Hello John, > > > > There are lots of things to consider when you out an app online, security > > being just one. But there are really many other things also, most of which > > I do not know. > > > > However, I am currently happily developing web apps myself, and I spent > > minutes and hours on my coding. > > > > I am using DotNetNuke as my framework and it works a treat. I keep it > > simple and try not to get too fancy. There is loads of help available from > > the groups and forums. > > > > It is not too wild to suggest that in the future 50% or more of our > > customers will want web based front ends, so I urge you to study DNN - a few > > days of reading the forums and the turorials on module development will have > > you coding apps in no time. > > > > Do not be put off by the initial barrier to entry, once you get the hang of > > it, and one you keep it simple, you can code in the same ol' c# style , but > > your GUI will be a DNN website. > > > > Oh, and it if fun also. > > > > Mark > > > > > > On 13 December 2010 06:45, Eric Barro wrote: > > > >> John, > >> > >> ASP.NET uses either C# or VB.NET as the underlying development language. > >> Of > >> course there are other technologies involved such as Javascript, HMTL, CSS > >> etc. > >> > >> There's no way to convert a WinForm application to a web app with one click > >> of a button. You'd have to recreate your WinForm in ASP.NET using the > >> built-in .NET equivalent controls. The good thing is that they are one and > >> the same type of control on the web app (ie TextBox in WinForms is still > >> TextBox on a web app). > >> > >> If you programmed your business logic in separate classes and you refrained > >> from directly referencing controls in the methods then you should be fine > >> and you should be able to use most of your code in a web app. > >> > >> The main things you will need to deal with in a web app such as ASP.NETare > >> the following: > >> > >> 1. Session variables - this is one of the ways you can pass data back and > >> forth from one page to the next since web apps are stateless apps and there > >> is no "automatic way" of "remembering" data from one page to the next. > >> 2. Postback events - when a user clicks a button on a WinForm all you need > >> to do is trap for the click event. On a web app you need to be aware of > >> when > >> postbacks (basically trips to the server) occur so that you can properly > >> trap events or intercept them. > >> 3. Server side versus client side events - this is probably the hardest > >> concept to grasp for most beginning web app developers. > >> 4. Client side scripting - When it's done and said, all ASP.NET does > >> really > >> is render the page in HTML and handle the events using Javascript. You will > >> need to get your feet wet learning Javascript as well. Fortunately, the > >> syntax is based on C but variables and objects are not strongly-typed. > >> > >> --Eric > >> > >> -----Original Message----- > >> From: dba-vb-bounces at databaseadvisors.com > >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > >> Sent: Sunday, December 12, 2010 9:33 PM > >> To: VBA > >> Subject: [dba-VB] Browser based database > >> > >> I need to do two different browser based databases (I think). I know > >> nothing about this. Both > >> clients need to enter data and have multiple users hitting the database > >> from > >> home and office computers. > >> > >> Where do I start? I am getting pretty good with C# / SQL Server but those > >> are computer based > >> "applications". If I could do an internet download installation, I could > >> probably (maybe) go there. > >> Except what about admin rights etc. > >> > >> Is asp.net viable? Is it close to C#? If I keep the data entry screens > >> simple can I do it in C# > >> and then just "press a button" to turn it into ASP.net? Please don't make > >> rude noises here. > >> > >> ;) > >> > >> I just know nothing about internet facing application programming and I > >> feel > >> really inadequate on > >> this stuff. > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Dec 13 10:35:04 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 13 Dec 2010 08:35:04 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D063CD8.4020303@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> Message-ID: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 13, 2010 7:34 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your > library of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an >> .mde, and asked you to automate tasks in the mde (so you couldn't >> tweak the source code running the program itself, but you could open >> the mde with VBA, and use the objects within it just like you'd use >> the objects in your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to >> the database itself, so with a browser, you need a reference to it. >> You can either programmatically open a browser window (so you'll both >> create the object, and have a reference to it), or you can ask the >> user which browser window they want you to use (so you can grab the >> browser window through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) Dim SWs As New >> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >> InternetExplorer Dim Resp For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey >> is the primary key of a record that will be used in that >> NewSormDataEntry to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send >> email, web security can be a real pain in doing something like this. >> The security is put in place to impede (note, I didn't say prevent) a >> hacker from doing nasty stuff to the site. So the 'impeding' garbage >> designed to trip up hackers can get in the way of a legitimate >> developer trying to create a helpful tool. So before you COMMIT to >> being able to make the tool, you'll need to look at the site itself, >> to see what all will get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need >> your code to work with. The first is to just look at the HTML of the >> page(s) you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, >> it has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create >> your own browser, and dump the HTML to a file. You can also use API >> calls to just directly download the HTML, without a browser. If the >> page is derived from internal (on the website server) variables, >> you'll need to use your own browser to get there and download the >> source. The second way to 'find' the objects you need to deal with >> are with the object browser. Running your code in debug mode, you'll >> be able to see the browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. >> But all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you >> may not be able to capture 'download complete' events. What I have >> done in these cases, where my code puts in data on a page, clicks a >> button to go to the next page, I put my code in a loop, that sits and >> waits for an object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required >> for interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file downloaded. It sounded totally >> convoluted but the question is (and I have asked this before without >> a usable response) can I programmatically manipulate web pages to >> cause specific pages to open, click buttons, input data into controls >> etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and >> destroy the material in its entirety, whether electronic or hard >> copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than >> the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 13 10:57:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 11:57:48 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> Message-ID: <4D06508C.6030004@colbyconsulting.com> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:48 AM, Mark Breen wrote: >> Hello John >> >> Another choice is to use Sillennium >> >> It is built for this task and will allow you to easily change your >> library of routines when your website changes. >> >> Mark >> >> >> >> >> On 10 December 2010 22:33, Drew Wutka wrote: >> >>> Now for a little more info for you. Yes, you can certainly do this. >>> Technically, it's not much different than if someone handed you an >>> .mde, and asked you to automate tasks in the mde (so you couldn't >>> tweak the source code running the program itself, but you could open >>> the mde with VBA, and use the objects within it just like you'd use >>> the objects in your own application.) >>> >>> Trick #1: Just like with an .mde, you have to have a reference to >>> the database itself, so with a browser, you need a reference to it. >>> You can either programmatically open a browser window (so you'll both >>> create the object, and have a reference to it), or you can ask the >>> user which browser window they want you to use (so you can grab the >>> browser window through code). >>> >>> Here's an example of how to grab an existing browser window: >>> >>> Function GetExistingBrowser(strKey As String) Dim SWs As New >>> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >>> InternetExplorer Dim Resp For Each IE In SWs >>> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >>> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >>> vbQuestion, "Select IE") >>> If Resp = vbYes Then >>> Set mdie = Nothing >>> Set mdie = IE.Application >>> NewSormDataEntry strKey, mdie >>> Exit Function >>> End If >>> Next >>> End Function >>> >>> The 'NewSormDataEntry' function is the function I am sending the mdie >>> object too (the referenced browser window). In this function strKey >>> is the primary key of a record that will be used in that >>> NewSormDataEntry to submit data into a web site. >>> >>> Trick #2: Just like when the development world got a wedgie when >>> Microsoft 'secured' Outlook from programs just using it to send >>> email, web security can be a real pain in doing something like this. >>> The security is put in place to impede (note, I didn't say prevent) a >>> hacker from doing nasty stuff to the site. So the 'impeding' garbage >>> designed to trip up hackers can get in the way of a legitimate >>> developer trying to create a helpful tool. So before you COMMIT to >>> being able to make the tool, you'll need to look at the site itself, >>> to see what all will get in your way. >>> >>> Trick #3: There are two ways to 'find' the objects you will need >>> your code to work with. The first is to just look at the HTML of the >>> page(s) you are going to manipulate. This is where some of those > 'impediments' >>> come into play. Some sites prevent you from right clicking on a page >>> and selecting 'View Source'. Ironically, this is just removing a >>> 'shortcut' way to view the HTML source behind a page. It doesn't >>> actually HIDE the source, because your browser is viewing the source, >>> it has too, otherwise it will have nothing to display. So there are >>> multiple ways to 'download' the HTML you can view yourself. Create >>> your own browser, and dump the HTML to a file. You can also use API >>> calls to just directly download the HTML, without a browser. If the >>> page is derived from internal (on the website server) variables, >>> you'll need to use your own browser to get there and download the >>> source. The second way to 'find' the objects you need to deal with >>> are with the object browser. Running your code in debug mode, you'll >>> be able to see the browser object, and all of it's child elements. >>> >>> Trick #4: Events and properties. Setting the value of a textbox, or >>> clicking a button, just requires that you know what the events and >>> properties of those objects are. I use the MSDN that came with the >>> developer edition of Office 2000. It's got a nice HTML guide with >>> common HTML form elements, their properties, methods, and events. >>> But all that information is also plastered all over the web. >>> >>> Trick #5: When a page loads, the browser object is there, but you >>> may not be able to capture 'download complete' events. What I have >>> done in these cases, where my code puts in data on a page, clicks a >>> button to go to the next page, I put my code in a loop, that sits and >>> waits for an object from the next page to exist. >>> >>> Of course, if there are applets, or flash media elements, required >>> for interaction... can't help ya there, haven't tackled one of those. >>> >>> Drew >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Friday, December 10, 2010 3:30 PM >>> To: VBA >>> Subject: [dba-VB] Web page manipulation >>> >>> My client has to go through a process where he clicks about 20 - 30 >>> things to manage to get a file downloaded. It sounded totally >>> convoluted but the question is (and I have asked this before without >>> a usable response) can I programmatically manipulate web pages to >>> cause specific pages to open, click buttons, input data into controls >>> etc. >>> >>> -- >>> 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 >>> >>> The information contained in this transmission is intended only for >>> the person or entity to which it is addressed and may contain II-VI >>> Proprietary and/or II-VI Business Sensitive material. If you are not >>> the intended recipient, please contact the sender immediately and >>> destroy the material in its entirety, whether electronic or hard >>> copy. >>> You are notified that any review, retransmission, copying, >>> disclosure, dissemination, or other use of, or taking of any action >>> in reliance upon this information by persons or entities other than >>> the intended recipient is prohibited. >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Dec 13 11:24:37 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 13 Dec 2010 18:24:37 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John How about LightSwitch: http://www.microsoft.com/visualstudio/en-us/lightswitch It is still in beta, I know, but given the modest requirements of these two apps ... /gustav >>> jwcolby at colbyconsulting.com 13-12-2010 17:57 >>> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com From davidmcafee at gmail.com Mon Dec 13 18:50:49 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 16:50:49 -0800 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: This time without the RTF Damn, keyboard. That was supposed to say "I use a click once app for our sales force" Here's a sub that calls a webservice and populates a table for a SSCE database: (but you could do what ever you want with your returned dataset) private void retrieveData(int intMode) { // This process will call a webservice passing a parameter which in turn executes a SQL stored procedure, returning a dataset try { // call webservice and populate dataset localhost.Service1 MyObj = new localhost.Service1(); DataSet ds; ds = MyObj.RetrieveSQLdata(intMode); // At this point, the dataset has already been filled by the web service SqlServerCe.SqlCeConnection CEconn; SqlServerCe.SqlCeCommand CEcmd; CEconn = new SqlServerCe.SqlCeConnection(("Data Source =" + (PathPC + FileName))); CEconn.Open(); CEcmd = new SqlServerCe.SqlCeCommand(); CEcmd.Connection = CEconn; // Delete the exisiting data from the iPAQ tables before populating it string TableName = ""; switch (intMode) { case 1: TableName = "PListHdr"; break; case 12: TableName = "PListItems"; break; } CEcmd.CommandText = ("DELETE " + TableName); CEcmd.ExecuteNonQuery(); this.lblStatus.Text = ("Retrieving " + (TableName + " data from SQL")); System.Windows.Forms.Application.DoEvents(); DataRow row; string mystr = ""; int RowCount = 0; foreach (row in ds.Tables[0].Rows) { mystr = ""; if ((intMode == 1)) { mystr = (mystr + "INSERT INTO PListHdr (PListID, PListDesc) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["PListDesc"].ToString + "\')"))); } else if ((intMode == 12)) { mystr = (mystr + "INSERT INTO PListItems (PListID, ItemNo, Price) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["ItemNo"].ToString + "\', "))); mystr = (mystr + (row["Price"].ToString + ")")); } CEcmd.CommandText = mystr; CEcmd.ExecuteNonQuery(); } this.lblStatus.Text = (TableName + " data retrieved from SQL"); System.Windows.Forms.Application.DoEvents(); CEcmd.Dispose(); CEconn.Close(); CEconn.Dispose(); } catch (Exception ex) { throw new Exception("updateCustMast() Failed"); } } This is how the sub is called from within my local/users' app: public void UpdatePListHdr() { if ((DoesTableExist("PListHdr") == true)) { if (this.chkRunInDebugMode.Checked) { MessageBox.Show("UpdatePListHdr()"); } this.lblStatus.Text = "Retrieving PListHdr data"; System.Windows.Forms.Application.DoEvents(); this.retrieveData(1); } } This is the web service call (you can replace the string mystr=(); line with your favorite dynamic SQL : [WebMethod()] public DataSet RetrieveSQLdata(int intMode) { SqlConnection conn; SqlDataAdapter da; DataSet ds; string mystr = ("EXEC stpRetrieveData \'" + (LoginUser + ("\', " + intMode))); conn = new SqlConnection(strConn); da = new SqlDataAdapter(mystr, conn); da.SelectCommand.Parameters.AddWithValue("@Mode", intMode); ds = new DataSet(); da.Fill(ds); return ds; conn.Close(); } so you can see, it is pretty simple if you are already making similar calls in C# From jwcolby at colbyconsulting.com Wed Dec 15 07:33:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 15 Dec 2010 08:33:48 -0500 Subject: [dba-VB] SSDS Message-ID: <4D08C3BC.7020900@colbyconsulting.com> I am trying to learn how to host data on my own servers, or on a web site that I contract for, and use a service to get that data. I thought that SSDS was the technology that allowed me to do that, but when I start viewing Microsoft's clinics, specifically clinic 6341, I am told I need to "register for, set up a user name" etc... IOW "We have a server in the cloud and sell you"... That is decidedly NOT what I want to do, simply because I have no budget for the "we sell you" part of that contract. Do we know whether SSDS allows me to host my own data and write services to access my own data hosted wherever I want to host that data? If so, where do I go to learn how to do this. I viewed a blog last night. specifically http://channel9.msdn.com/blogs/pdc2008/tl07 which was pretty cool. I have to say I am skeptical that it would work for high volume data transfers simply because of the overhead for each actual piece of data. However for working with databases in the traditional "fill in the tables and generate reports" it looks like a killer way to do business over the internet. I now have three different places (clients) where this would appear to solve my problems with remote users. Is anyone using this stuff to build applications that run on a client but add / edit / browse / report to a database "out there somewhere"? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 16 10:26:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 11:26:19 -0500 Subject: [dba-VB] Wrapper classes Message-ID: <4D0A3DAB.2030103@colbyconsulting.com> Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu Dec 16 12:28:09 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Dec 2010 21:28:09 +0300 Subject: [dba-VB] Wrapper classes In-Reply-To: <4D0A3DAB.2030103@colbyconsulting.com> References: <4D0A3DAB.2030103@colbyconsulting.com> Message-ID: <3976E26898A345C0AD1865DEB2146C8D@nant> Hi John -- You'd better keep your code within User Custom Control in a (User Custom Controls) class library. User Custom Controls can be nested or inherited - such a nesting/inheritance rarely gets deeper than three levels. And even more strong assertion is true - it never gets deeper than three levels in the projects of my customers, with one-two levels being the most common application cases. And in the case of two levels the upper level User Custom Control (dropped on WinForms) is usually used just as a container (nest) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 16 ??????? 2010 ?. 19:26 To: VBA Subject: [dba-VB] Wrapper classes Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 16 15:47:41 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 16:47:41 -0500 Subject: [dba-VB] WCF Message-ID: <4D0A88FD.3080409@colbyconsulting.com> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Dec 17 05:43:46 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 12:43:46 +0100 Subject: [dba-VB] WCF Message-ID: Hi John Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. Microsoft has some intro stuff as well: http://msdn.microsoft.com/en-us/library/gg132851.aspx I haven't worked with WCF for any practical project but would love to follow the thread. /gustav >>> jwcolby at colbyconsulting.com 16-12-2010 22:47 >>> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 08:20:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:20:17 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0B71A1.5040703@colbyconsulting.com> Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the internet using a client .Net > application. I have three different projects for three different clients all of which really need > to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) > chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has > done this and wants to start a discussion thread. > From jwcolby at colbyconsulting.com Fri Dec 17 08:25:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:25:52 -0500 Subject: [dba-VB] Why use a contract? Message-ID: <4D0B72F0.6010902@colbyconsulting.com> The WCF book I am reading discusses building interfaces / contracts. He uses the term interchangeably. Basically you set up a file that has just the variables and method signatures, and name it. Then you build an actual implementation class that implements the contract. I am the kind of person that likes to know the "why". I don't mind doing something but I find it useful to know the reasons for what I do. So what does the interface / contract do for us in the development process. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 09:13:53 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 10:13:53 -0500 Subject: [dba-VB] DAAB Message-ID: <4D0B7E31.1020902@colbyconsulting.com> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Dec 17 09:39:10 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 17 Dec 2010 10:39:10 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0B71A1.5040703@colbyconsulting.com> References: <4D0B71A1.5040703@colbyconsulting.com> Message-ID: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 17, 2010 9:20 AM To: Discussion concerning Visual Basic and related programming issues.; Access Developers discussion and problem solving Subject: Re: [dba-VB] WCF Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the > internet using a client .Net application. I have three different > projects for three different clients all of which really need to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many > acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd > see if anyone on the list has done this and wants to start a discussion thread. > _______________________________________________ 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 17 10:07:23 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 17:07:23 +0100 Subject: [dba-VB] DAAB Message-ID: Hi John It looks like that link is superseded by the Enterprise Library of which the newest version is found here: http://msdn.microsoft.com/en-us/library/ff632023.aspx I haven't used it. /gustav >>> jwcolby at colbyconsulting.com 17-12-2010 16:13 >>> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 10:23:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 11:23:17 -0500 Subject: [dba-VB] WCF In-Reply-To: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> References: <4D0B71A1.5040703@colbyconsulting.com> <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Message-ID: <4D0B8E75.5060201@colbyconsulting.com> Michael, Glad to have you. I am using VS 2008 Standard edition. I will probably go with SQL Server Express in order to allow each client to use their own database hosted wherever they need. My intention is to develop a client application in C#, and a service application in C#. The service application will talk to a database layer and through to SQL Server or MySQL. I will use WCF and services to talk from the client through the internet to the service application. I am so new to this that I am just talking generalities here. From what I am reading, this is the big picture of how it is done. The first chapter of John Sharp's book dives right in and I will be diving right in following along exactly, using his tools / database etc. Once I am able to do so I will bring up a parallel track of the volunteer database. I want to go with the C# client because I just don't like browser based applications. I don't like using them when I am forced to out on the internet, they just always feel clumsy. At this time my clients all use Windows, are all at least at Windows XP, and so can easily host a windows based application. IOW I do not need to run my client app on Linux or other non windows OS so why do browser based apps. I use VisualSVN / Tortoise for source control internal to my business. IIRC Gustav, Shamil and Mark Breen used this same combination for Source control but had the repository on the web. If you remember those guys did a rewrite of Microsoft's Tradewind Access demo database into C#. Back then I was not up to speed in C#. While I hesitate to say I am up to speed now, I am at least minimally functional in C# now, though this WCF thing is going to be a stretch. I will ask them if that repository is still up and whether we can use it. Source control is critical for a community project in order to be able to share the source code and not step on toes. This volunteer database is a real application and a real (non-paying) client (Prison Ministries) and I am using this as a learning tool to get to this paradigm, to be comfortable with this for future development of distributed applications. I may very well start to design even my internal app to use the services paradigm, if for no other reason that to get good at it and stay there. Anyway, that is what I am up to. I have committed to delivering an Access database to Prison Ministries by the first of the year. I am so fast in Access that doing so (for something this small) is doable, however I cannot see how to publish that application over the web in a manner that will stay useful and current and easy to maintain for the future. Not to mention my faith in the future of Access is not very high right now. Ergo C# / WCF services / SQL Server / MySQL. That would seem to be the future. John W. Colby www.ColbyConsulting.com On 12/17/2010 10:39 AM, Michael Mattys wrote: > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called > HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 10:22:32 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 11:22:32 -0500 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: <4D0CDFC8.1010001@colbyconsulting.com> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:16:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:16:09 -0500 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: <4D0CFA69.1050706@colbyconsulting.com> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 12:24:04 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 19:24:04 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Could this be your case: http://forums.asp.net/t/1290251.aspx /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 17:22 >>> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:24:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:24:15 -0500 Subject: [dba-VB] objectbuilder.dll is missing In-Reply-To: References: Message-ID: <4D0CFC4F.8070903@colbyconsulting.com> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? > From jwcolby at colbyconsulting.com Sat Dec 18 13:31:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 14:31:39 -0500 Subject: [dba-VB] And the beat goes on... Message-ID: <4D0D0C1B.8030907@colbyconsulting.com> http://thessdreview.com/latest-buzz/sandforce-firmware-update-confirmed-great-news-for-new-ssd-buyers/ -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 14:16:32 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:16:32 +0100 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: Hi John Not me. Never had the need for such "factories". It looks like very clever stuff. Thanks for the link - I'll certainly study it. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:16 >>> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx From gustav at cactus.dk Sat Dec 18 14:17:48 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:17:48 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Oh, but I haven't installed this myself, so I'm out of ideas. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:24 >>> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? From listmaster at databaseadvisors.com Sun Dec 19 13:08:22 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sun, 19 Dec 2010 14:08:22 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - Dec 2010 Message-ID: Good day everyone. I hope your Christmas preparations are going well. During the last few months the mail server has been having some problems. So over the Christmas holiday the mail server that all your favourite lists run on will be undergoing a complete upgrade right from the OS to the mail server to the mailing list software. This will mean that there will be some outages of the lists. This outage will most likely happen on Wednesday Dec 29, 2010 starting around 8am ET (1pm GMT). I will send out a notice approx. 30 minutes prior to the server going down. As well, once everything is back up and running, I will send out another notice. If you have any concerns, please let me know. I can be reached at listmaster at databaseadvisors.com or carbonnb at gmail.com. Thanks, Your humble list master Bryan -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From Gustav at cactus.dk Mon Dec 20 06:28:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 20 Dec 2010 13:28:21 +0100 Subject: [dba-VB] WCF Message-ID: Hi all The link for the book: http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 17-12-2010 16:39 >>> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com From jwcolby at colbyconsulting.com Mon Dec 20 06:57:16 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 07:57:16 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0F52AC.3050008@colbyconsulting.com> Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-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 20 12:11:50 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 13:11:50 -0500 Subject: [dba-VB] Multiple instances of SQl Server express Message-ID: <4D0F9C66.6000300@colbyconsulting.com> I have a client using Access BEs which I would like to move to SQL Server Express. The biggest issue in my mind is near term expansion. One reason we need to move is simply that we have already split the BEs a couple of times to keep the size reasonable. We have a BE at 850 MB, 750MB and 500 MB. These are just too big for Access IMHO. OTOH merging them all back into a single SQL Server express BE would result in a pretty large database (by Express standards), although it appears that they did increase the SSE 2008 limitation to 10 gigs. Is anyone using SS Express to try to run a small business - under 50 employees, ~25 users in the db most of the day? Any insights, gotchas, words of wisdom? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 09:07:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 10:07:17 -0500 Subject: [dba-VB] CAL aware software Message-ID: <4D10C2A5.8060007@colbyconsulting.com> I am trying to understand the CAL requirements of Microsoft's Windows 2008 Server and SQL Server 2008. The way I understand it, you buy CALs for each simultaneous connection. Server software gets rather expensive once you buy the software itself and then 30 or more CALs for the OS as well as for SQL Server. Do any of you spend time worrying about how to minimize the effect of the database on CAL utilization? For example do linked tables count differently than ado disconnected recordsets? Linked tables are connected from the time the person opens access to the time they close it as opposed to disconnected recordsets where a connection is made just long enough to get the data. Would the user be legally "connected" even though the application used disconnected recordsets? Any thoughts on how all this applies to CAL requirements. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 15:52:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 16:52:48 -0500 Subject: [dba-VB] Microsoft: Bringing Supercomputing To The Masses - Network Computing Message-ID: <4D1121B0.3020101@colbyconsulting.com> Need to model an atomic bomb? -- John W. Colby www.ColbyConsulting.com http://www.networkcomputing.com/cloud-computing/microsoft-bringing-supercomputing-to-the-masses.php From michael at mattysconsulting.com Tue Dec 21 22:27:19 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 21 Dec 2010 23:27:19 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0F52AC.3050008@colbyconsulting.com> References: <4D0F52AC.3050008@colbyconsulting.com> Message-ID: <923DD10436104846AC478F9A26AF2CC7@Gateway> I found that book needed correction and the following worked for me: My Service.svc contains: <%@ ServiceHost Language="C#" Debug="true" Service=" Products.ProductsServiceImpl" CodeBehind="~/App_Code/ProductsService.cs" %> My Web.config contains: Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 20, 2010 7:57 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] WCF Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:07:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:07:08 -0500 Subject: [dba-VB] wcf reading Message-ID: <4D12060C.3010905@colbyconsulting.com> ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Wed Dec 22 08:35:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 22 Dec 2010 09:35:51 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <4D12060C.3010905@colbyconsulting.com> References: <4D12060C.3010905@colbyconsulting.com> Message-ID: <7450A227F8B74909A4C32DE228083400@Gateway> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:38:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:38:20 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D120D5C.1090409@colbyconsulting.com> Ahhh... time to order up I guess. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:13:40 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:13:40 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi Michael So this link is for an outdated version: Windows Communication Foundation Step By Step by John Sharp 2007 http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 22-12-2010 15:35 >>> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. From jwcolby at colbyconsulting.com Wed Dec 22 09:26:12 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:26:12 -0500 Subject: [dba-VB] wcf reading In-Reply-To: References: Message-ID: <4D121894.2040209@colbyconsulting.com> That is for the book that I am reading. I bought it used awhile back, and it definitely is outdated - assuming that you have moved on from VS 2005 - which I have. AFAICT the underlying discussions still work, but the VS user interface has changed and very likely there are enhancements to WCF in .Net 4. I have been needing a reason to move up to VS 2010. I guess this is it. ;) John W. Colby www.ColbyConsulting.com On 12/22/2010 10:13 AM, Gustav Brock wrote: > Hi Michael > > So this link is for an outdated version: > > Windows Communication Foundation Step By Step > by John Sharp 2007 > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 22-12-2010 15:35>>> > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 From jwcolby at colbyconsulting.com Wed Dec 22 09:36:56 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:36:56 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D121B18.80604@colbyconsulting.com> I just ordered the latest from Amazon and it will be here in time for some light Christmas reading. ;) Now to install VS 2010. I actually need to learn this stuff. Up to this point all of my clients were location centric and everything happened over an internal network which lessened the need to go here. But services over the internet is the future. The nice thing about WCF is that you can do WWW and TCP endpoints in the same class which makes it possible to use the same system (and possible even application) for internal or external client applications. It is fascinating stuff and may allow me to get around needing to have share rights and the likes for everything. I do a lot of stuff like "save a CSV file to a shared directory", then have a program import the stuff into SQL server etc. As I create servers and stuff, setting up rights to shares is a pita. A service could get around all of that. Maybe. It's a brave new world. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:53:26 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:53:26 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi all This seems right! A 700+ pages monster book. Should keep you busy for the Christmas holiday. /gustav >>> "Michael Mattys" 22-12-2010 15:57 >>> Try here: http://www.free-ebooks-download.org/free-ebook/dotnet/Framework/windows-communication-foundation-4-step-by-step.php From jwcolby at colbyconsulting.com Thu Dec 23 10:22:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 23 Dec 2010 11:22:25 -0500 Subject: [dba-VB] OCZ's RevoDrive Preview: An Affordable PCIe SSD - AnandTech :: Your Source for Hardware Analysis and News Message-ID: <4D137741.1020907@colbyconsulting.com> http://www.anandtech.com/show/3788/oczs-revodrive-pcie-ssd-preview-an-affordable-pcie-ssd/8 http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&N=100008120%2050001550%20600038468&IsNodeId=1&name=PCI-E -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 24 11:11:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 24 Dec 2010 12:11:09 -0500 Subject: [dba-VB] VS 2010 user interface Message-ID: <4D14D42D.9000501@colbyconsulting.com> Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Fri Dec 24 11:21:21 2010 From: dbdoug at gmail.com (Doug Steele) Date: Fri, 24 Dec 2010 09:21:21 -0800 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: Well, John, once you've worked with Microsoft products for a couple of years, you'll get used to the idea that the interfaces change constantly. Always for the better, of course. They do test this stuff on thousands of users before releasing it. I think. Or not. Doug On Fri, Dec 24, 2010 at 9:11 AM, jwcolby wrote: > Note to self, never make abrupt and radical changes to the user experience. > > What a jarring experience opening VS 2010. Very likely the menus are > identical but the look and > feel of the opening screen is completely different. > > Why? > > Did the old start page not work? Is the new one miles ahead of / better > than the old? > > Or did we just need to be able to say we made it better? > > I don't know the answer but I know it is jarring. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Dec 24 16:11:00 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 25 Dec 2010 01:11:00 +0300 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: <8FF9D8E62966431780E6EF07937BD2E4@nant> Hi John -- >>> I don't know the answer but I know it is jarring. <<< Yes, the same feeling here. And it was easy to switch VS2003->VS2005->VS2008... Although I'd note they (MS) have completely reworked VS2010 IDE - it's written using Windows Presentation Foundation AFAIHH with many new IDE features therefore the current trouble to adapt to the new IDE isn't worth to worry about :) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 ??????? 2010 ?. 20:11 To: VBA Subject: [dba-VB] VS 2010 user interface Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 25 22:40:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 25 Dec 2010 23:40:17 -0500 Subject: [dba-VB] SQL Server Express version Message-ID: <4D16C731.4080203@colbyconsulting.com> I have SQL Server Express 10 on my laptop (dev machine). That appears to be 2005. I actually have the service there (not running) but I cannot seem to find it in the "programs and features". So how do I uninstall it in order to install the 2008 version? Or if I just do an install will it overwrite the old one? I suspect not. I just installed VS 2010 yesterday and kind of expected that it would install the latest express as part of its install but it does not seem to have done so. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Mon Dec 27 03:40:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 12:40:39 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: <5ADDFD61397040118F381468EF41A779@nant> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From gustav at cactus.dk Mon Dec 27 07:04:00 2010 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 27 Dec 2010 14:04:00 +0100 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From shamil at smsconsulting.spb.ru Mon Dec 27 07:53:36 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 16:53:36 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? In-Reply-To: References: Message-ID: <20053C1394F2453397A1D32185E51EF1@nant> Hi Gustav -- Sorry, that wasn't copy and paste part of code - original code compiled well. Anyway, I decided to not make it using dynamic approach because this approach creates additional layer of indirection/dynamics, which I should better avoid - it's not worth to introduce that indirection/complexity. 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: 27 ??????? 2010 ?. 16:04 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 27 21:13:40 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:13:40 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? Message-ID: <4D1955E4.5070504@colbyconsulting.com> I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 27 21:25:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:25:36 -0500 Subject: [dba-VB] You're gonna love this one Message-ID: <4D1958B0.2080602@colbyconsulting.com> http://www.johndcook.com/blog/2010/04/22/visual-studio-2010-is-a-pig/ 1.5 MILLION files? Hmm.... -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Mon Dec 27 21:40:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Mon, 27 Dec 2010 22:40:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <4D1955E4.5070504@colbyconsulting.com> References: <4D1955E4.5070504@colbyconsulting.com> Message-ID: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 27 22:12:51 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 23:12:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <4D1963C3.2@colbyconsulting.com> I will play with it more but VS 2008 worked fine for me, in fact I pretty much love it. I really only installed 2010 to do the WCF4 stuff. If I can run WCF 3.5 (or whatever) then I can afford to wait for MS to sort out the issues with VS 2010. I do real work with VS2008, and it works really well for what I am doing. My only complaints are that sometimes debug step is really slow. Sometimes not. Really strange. My Windows 2008 8 core machine is lightning fast for VS 2008 though, even debug stepping. Of course because it is X64 there is no edit and continue. Sigh. John W. Colby www.ColbyConsulting.com On 12/27/2010 10:40 PM, Michael Mattys wrote: > I have to agree with some of the comments there ... > the one that really puts a lump in my throat is "it will take decades to get > back to a 'Rapid Quality Application Development'" > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 27, 2010 10:14 PM > To: VBA > Subject: [dba-VB] Is VS 2010 extremely slow? > > I installed 2010 and it seems to be a dog! > > Anyone else with a similar experience? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 27 23:16:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 28 Dec 2010 00:16:08 -0500 Subject: [dba-VB] Adding an entity model Message-ID: <4D197298.9070806@colbyconsulting.com> The entity modeler does not like nullable FKs. IOW a location might / might not have an organization etc. Generates copious errors! Once I decided to go in and fix that, I had to delete the model and recreate in order to repair the "errors". Just telling it to go fetch the latest from the database did not fix the "errors". OTOH, deleting the entire model and rebuilding it did in fact get rid of all the errors. What a PITA. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Dec 28 07:44:13 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 16:44:13 +0300 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <3A19A89FC90248139C333B686AC14B69@nant> Hi All -- Yes, VS2010 looks slower than VS2008, and VS2010 is a "memory-hog" for sure but that's all I have found so far. Well, one other thing I have got VS2010 GPF-in while in design/IDE mode with "Out Of Memory" error message after about a day of working with it with about 10 projects in a solution. And I have had here on the same simple 2 core 2GB Win2003 PC three or four instances of VS2008 with many projects in every solution used without problems for days... Anyway I do suppose/hope MS should solve most of the issues in VS2010 because the issues AFAIU are mostly caused by the fact that MS developers have rewritten all/most of IDE using managed code (WPF), and solving memory leakage issues of managed code is a tough task but doable (memory leakage in managed code are mainly related to all kinds of "hooks"/delegates/event listeners and that ones can be "unhooked" after accurate code review - MS developers, I guess, simply didn't have enough time for that work because of VS2010 release schedule forced by MS marketing "army"...)... BTW, in that current context of VS2010 being "memory-hog" and slower than VS2008 it's a good time to start using Test Driven Development if you haven't yet started to use it.. Would be also great if MS will release VS2008 SP2 supporting C#4.0 and .NET Framework 4.0... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: 28 ??????? 2010 ?. 6:41 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Is VS 2010 extremely slow? I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- 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 shamil at smsconsulting.spb.ru Tue Dec 28 09:44:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 18:44:10 +0300 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From Gustav at cactus.dk Tue Dec 28 10:02:17 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 28 Dec 2010 17:02:17 +0100 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Tue Dec 28 13:03:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 22:03:25 +0300 Subject: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... In-Reply-To: References: Message-ID: <272AD233109B49728A5A39D959CAF68E@nant> Hi Gustav -- Yes, and with ASP.NET it even (a bit more) nasty: just changing reference to the newer version of Report Viewer Control 10.0 doesn't help. Some manual work is needed. A bit cryptic. And it starts working finally. Hint make new ASP.NET 4.0 Web Reporting project then compare web.config and .aspx files - and make manual editing... I will try to write more on that issue in coming days in I will have time... 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: 28 ??????? 2010 ?. 19:02 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) <<< snip >>> From listmaster at databaseadvisors.com Wed Dec 29 07:19:58 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Wed, 29 Dec 2010 08:19:58 -0500 Subject: [dba-VB] Administrivia - Server Upgrade Message-ID: Good morning folks, The server will be going down in half an hour, at approx 845 ET It will be down for approx 4-6 hours for a complete upgrade. I will send out another email, once we are all back up and running again. If you have any questions while the server is done, please get in touch with me at carbonnb at gmail.com -- Bryan Carbonnell - list master at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From listmaster at databaseadvisors.com Thu Dec 30 08:59:57 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 30 Dec 2010 09:59:57 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - UPDATE - Dec 30 @ 0955 Message-ID: Good Morning folks, I hope you didn't suffer too many withdrawals from not having your favourite lists yesterday and this morning. The Server upgrade was a challenge to say the least. A Royal PITA to say it closer to what it really was. There are still lots of things to work out, like putting the archives back online. Have no fear, your words of wisdom are being archived (for those lists that have archiving turned on), but the archives aren't available yet. The main goal was to get the lists back up and running, which it appears they are. If you encounter any abnormalities, please let me know ASAP so I can look into it. Things will slowly become normal again over the remainder of the week. Thanks for your patience. during the upgrade. -- Bryan Carbonnell - listmaster at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From shamil at smsconsulting.spb.ru Fri Dec 31 06:13:44 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 31 Dec 2010 15:13:44 +0300 Subject: [dba-VB] Ded Moroz sends you links on sample projects... :) Message-ID: <88C8330964FC47F7A753561E66B42346@nant> Hi All -- New Year Eve is approaching here, and I wanted to send you some gifts from Ded Moroz - here they are: This is a set of projects I have got developed a few days ago during 40+ hours R&D coding marathon. The task was to finish all the work in about 40 hours. So a few bugs left in there as release deadline wasn't possible to move. They (the bugs) are described in readme. But in general all the sample apps work rather well as my tests here show. I'd be interested to hear any comments - in what direction that sample should be better developed. Please write them here, or on http://northwind.codeplex.com . Please do not "judge severely" as as I noted that was very intensive R&D work with little time to think through while coding :) But feel free to comment it as you like. *Do not try* to be politcorrect. Please. I wish all of your Very Happy and Prosperous New Year! Thank you. -- Shamil P.S. Short description of published projects (the sources get downloaded 19 times already and I have got informed privately a couple of days ago just three people): NorthwindNET_4_0_Sources.zip (~24MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192044 NorthwindNET_4_0_SampleApps_Setup.zip (~5MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192043 Northwind.NET.VS2010.sln ======================== 1. Northwind.NET.EDM.FE - WinForms Front-End (just start-up class and app.config); 2. Northwind.NET.EDM.WinForms.Controls - UI UserControls; 3. Northwind.NET.EDM.Reports - MS ReportViewer 10.0 Reports; 4. Northwind.NET.BLL - Business Layer Library (ADO.NET EDM LINQ Reports' data sources); 5. Northwind.NET.Model - ADO.NET EDM; 6. Northwind.NET.Settings - application settings (wrappers); 7. Northwind.NET.Resources - application resource file; 8. Northwind.NET.Utilities - utility class library; 9. Northwind.NET.Testing.Console - some test functions - it's not true TDD - just a rough approximation; Northwind.NET.MSAccess.sln ========================== I. WinForms FE with MS Access backend Northwind.NET.FE.1.1 - Northwind.NET FE with MS Access backend Northwind.NET.Utilities - Utilities project II. ASP.NET sample application with MS Access backend E:/Projects/SMS/Northwind/Northwind.ASP.NET.MSAccess.Reporting/ - ASP.NET project III. Just a test ASP.NET app - can be removed E:\Projects\SMS\Northwind\Northwind.ASP.NET.MSAccess.Reporting.RDLC.10.0.0.0 Northwind.NET.zzz_OLD.sln ========================= 1. Northwind.NET.FE - WinForms Front-End with MS SQL backend using "plain old" ADO.NET data sets - the project we did last year's April. 2. All the other projects from as in Northwind.NET.VS2010.sln ----------- From jwcolby at colbyconsulting.com Fri Dec 31 20:56:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 31 Dec 2010 21:56:06 -0500 Subject: [dba-VB] Happy new year Message-ID: <4D1E97C6.3060000@colbyconsulting.com> To all our members around the world, may the new year be a good one. I am about to go down stairs and watch a movie with my wife, and ring in the new year with a glass of sparkling cider. If you party, do so with restraint. This is a particularly dangerous night to be out on the roads. Happy new year. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 1 00:20:26 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 09:20:26 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Message-ID: <97A3212846794197B97BAABCF7A3510D@nant> Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Dec 1 03:04:44 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 10:04:44 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView head Message-ID: Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 05:20:01 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 22:20:01 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001901cb9149$b20456a0$160d03e0$@com.au> Hi Shamil, I tried rdr.Dispose and still no luck. I don't think the datareader is the issue, it's the connection to the DB. I think the issue is not being able to set the value to nothing. Is there any way of setting the connection to nothing within a Using Statement? I appreciate your patience with me on this matter... Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 05:20:24 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 06:20:24 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001801cb910b$45a462e0$d0ed28a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> <001801cb910b$45a462e0$d0ed28a0$@com.au> Message-ID: <4CF62F78.5070000@colbyconsulting.com> Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > 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 1 05:25:15 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:25:15 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head In-Reply-To: References: Message-ID: <698BA6DF81FF4146B59F3F59A5BC1A64@nant> Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. 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: 1 ??????? 2010 ?. 12:05 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 05:49:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:49:53 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head References: Message-ID: <1EC85A575A1845A3B3D1F1352912CF74@nant> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil <<< snip >>> From Gustav at cactus.dk Wed Dec 1 06:24:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 13:24:03 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.itags.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7&hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/346e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil From actebs at actebs.com.au Wed Dec 1 07:16:38 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:16:38 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF62F78.5070000@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> Message-ID: <001a01cb9159$fc891430$f59b3c90$@com.au> Hi John, Wow! I'm just returning to application development after a 5 years absence. Destructor and Constructor classes are just a little out of my realm at the moment. I need to find a good resource that outlines classes use in VB.Net. Do you know of any? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 10:20 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 07:22:58 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:22:58 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001b01cb915a$df2502e0$9d6f08a0$@com.au> Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 07:45:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 08:45:06 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001a01cb9159$fc891430$f59b3c90$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> <001a01cb9159$fc891430$f59b3c90$@com.au> Message-ID: <4CF65162.6020403@colbyconsulting.com> Vlad, The destructor is not a class but (kind of) a method of the class. The destructor is called when the last reference to the class is set to null, just as the constructor is called in the new MyClass(). By creating a destructor, and placing an explicit call to all unmanaged object's Dispose() methods, the dispose of all such unmanaged objects gets called immediately as the last pointer is set to null. AFAICT (and I am no expert, so anyone else is free to jump in here) what really happens is that: 1) You create an instance to your class. 2) In your class you create a pointer to an unmanaged object such as a sql server connection. 3) You use your class 4) You do not explicitly call the dispose() of the connection but... 5) You set the last pointer to your class to null (or exit the block that defined your class)... Now... the instance of your class still sits in memory until the GC decides it needs the memory that your class takes up, but it may be quite some time before it does so. AFAICT when the GC actually gets around to disposing of the memory, it explicitly attempts to call Dispose() of any unmanaged object (ignoring errors if the unmanaged object does not have a dispose method) so *at that time* the unmanaged object is finally released. By your creating a destructor and explicitly calling the unmanaged object's dispose() method in the destructor, the unmanaged object is released at the instant the last pointer to the class is set to null (when the containing block is exited). Thus YOU decide the timing, rather than the GC deciding the timing. This was an issue to me because I was creating thousands of connections in a very short period of time. Because the GC decided I had lots of memory and it didn't need to take out the trash for long periods, I ran out of connections. By explicitly creating destructors in every class that created a connection, and explicitly calling the dispose() of the connection (unmanaged object) in the destructor, I explicitly released the connection at the instant that the class was destroyed rather than when the GC ran, and my problems went away. Or at least this is my understanding of the process. What I know is that my problems went away when I did this. It is a PITA to create the destructor and all the code to correctly manage it but once done you are gold (for that class). Just remember to place calls to dispose() in the destructor for all unmanaged objects. John W. Colby www.ColbyConsulting.com On 12/1/2010 8:16 AM, ACTEBS wrote: > Hi John, > > Wow! I'm just returning to application development after a 5 years absence. > Destructor and Constructor classes are just a little out of my realm at the > moment. > > I need to find a good resource that outlines classes use in VB.Net. Do you > know of any? > > Thanks > > Vlad From shamil at smsconsulting.spb.ru Wed Dec 1 08:39:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 17:39:51 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001b01cb915a$df2502e0$9d6f08a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au><97A3212846794197B97BAABCF7A3510D@nant> <001b01cb915a$df2502e0$9d6f08a0$@com.au> Message-ID: Hi Vlad -- Yes, that's OK to call .Dispose() on every iteration - you're disposing current instance. When you just create a new instance by using the same object variable previous instance isn't getting disposed: it's supposed to get disposed later by Garbage Collector (GC). I must note I have never used .Dispose() for OleDbCommand and all worked well - checked with memory profiler as I noted here about yesterday. But I didn't use OleDbCommand with parameters. In your case it could also be that you use parameters and you use OleDbDataReader instance reference to set parameter values. My (wild) guess is that VS uses some optimization while translating your code into IL, and that translation results in OleDbDataReader reference "captured" by OleDbCommand reader. Then you have many cycles of rdr.Read() and on every cycle a new instance of OleDbCommand is created, and a previous one is left hanging with OleDbDataReader instance referenced from parameters. Then GC doesn't work well/promptly somehow. If you write a function to get values from OleDbDatReader: private function getFieldValue(ByRef rdr as OleDbDataReader, ByVal fldName as string) as string return rdr(fldName).ToString() end function your issue might get solved "automagically". But that is just a guess. I'd also note that the way you set parameters doesn't look good enough from here - I mean internationalization issues, which may arise if you'll use you program with different formats of day/time. (My above function sample isn't good from internationalization point of view too). If you drop using parameterized OleDbCommand and return to plain dumb string.Format(....) to make Insert sql command text it would be easier to handle internationalization issues IMO, and also you can just create OleDbCommand once and then set its connection property before your While(rdr.read()) cycle, and set CommandText property on every iteration, and then calling .Dispose within every cycle will not be needed as you'll use the same OleDbCommand instance, and I suppose calling .Dispose for OleDbCommand after End While will not be needed at all... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 16:23 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 09:00:47 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 18:00:47 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <93125E633C84416C87A4A89117ADED7C@nant> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Wed Dec 1 16:28:18 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 23:28:18 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav From shamil at smsconsulting.spb.ru Wed Dec 1 16:58:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 01:58:21 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <00263D45306144F1AB39894F91360A4E@nant> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 04:27:10 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 11:27:10 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From shamil at smsconsulting.spb.ru Thu Dec 2 06:22:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 15:22:18 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <97D4BD40E52F4C43AC4CA44AEC90560E@nant> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 07:56:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 14:56:47 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil That sounds like a good approach. I just wondered because the option to build custom controls is promoted quite a lot. /gustav >>> shamil at smsconsulting.spb.ru 02-12-2010 13:22 >>> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From jwcolby at colbyconsulting.com Thu Dec 2 09:06:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 02 Dec 2010 10:06:57 -0500 Subject: [dba-VB] How to - Test environment Message-ID: <4CF7B611.7090706@colbyconsulting.com> I am trying to figure out how to do a test environment for C# development. I have a SQL Server with a bunch of application specific databases. We are developing a custom C# application to drive this business. My problem is that ATM I cannot run the program while my developer is working on the application because we are operating out of the same database. Due to the size of the database and my finances, cloning it on a dev environment server is not feasible. This means I need a software solution. My solution as of this morning is to add a field to the supervisor table that is either null (default) or holds a machine name string. By adding a couple of controls in the application I can fill in this field with a machine name when a "test" check box is set in the interface form and we add a record to that table. Then when anyone runs the program, the code checks for the test checkbox and only pulls records for that machine if the check box is set. This seems rather kludgy. If anyone has addressed this, please let me know how you are doing it. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:14:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:14:30 -0500 Subject: [dba-VB] Thread safe list Message-ID: <4CF8ED36.8070906@colbyconsulting.com> I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 3 07:40:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 16:40:21 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8ED36.8070906@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com> Message-ID: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Hi John -- I do use a dedicated static object instance to lock shared lists, dictionaries, ... (obviously psuedocode) Dictionary<> Dict; private static object _dictLocker = new object(); public void AddObjToList(obj) { lock(_dictLocker) { Dict.Add(); } } private GetObjFromList() { lock(_dictLocker) { Obj = Dict[0]; } Continue processing Obj here... } Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:15 To: VBA Subject: [dba-VB] Thread safe list I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 07:41:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:41:55 -0500 Subject: [dba-VB] C# and .Net 4.0 Message-ID: <4CF8F3A3.4050806@colbyconsulting.com> Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:57:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:57:06 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> References: <4CF8ED36.8070906@colbyconsulting.com> <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Message-ID: <4CF8F732.3010703@colbyconsulting.com> OK, two questions: 1) Does it have to be static? 2) My "GetObjFromList" actually uses a foreach(). It seems that is not going to work so well... Basically all of the work is done inside of that ForEach which would block the thread placing objects onto the list for long periods. Is it possible to somehow use ForEach and lock of the object being iterated or am I going to have to move to a do loop construct where I lock / grab an object / process? John W. Colby www.ColbyConsulting.com On 12/3/2010 8:40 AM, Shamil Salakhetdinov wrote: > Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places objects onto > a list for processing. > Another gets pointers to objects on the list for processing, and later > removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some sort > since a simultaneous write by one thread while reading by the other will > cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no clear > example of two different methods actually locking / unlocking the collection > object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place an > object onto the list. I have another (private) method called by the class > to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] C# and .Net 4.0 In-Reply-To: <4CF8F3A3.4050806@colbyconsulting.com> References: <4CF8F3A3.4050806@colbyconsulting.com> Message-ID: John -- As far as I see you can't create .NET Framework 4.0 projects in VS2008. :( Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:42 To: VBA Subject: [dba-VB] C# and .Net 4.0 Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8F732.3010703@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> Message-ID: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Hi John -- 1. Yes, static. Object ref isn't thread-safe AFAIU. 2. Yes, foreach isn't good. You can use int count = getCount(); // getCount should use locking for (int i=0; i Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places > objects onto a list for processing. > Another gets pointers to objects on the list for processing, and > later removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some > sort since a simultaneous write by one thread while reading by the > other will cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no > clear example of two different methods actually locking / unlocking > the collection object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place > an object onto the list. I have another (private) method called by > the class to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 13:39:03 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 14:39:03 -0500 Subject: [dba-VB] PGP Message-ID: <4CF94757.1070005@colbyconsulting.com> Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 14:15:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 15:15:43 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Message-ID: <4CF94FEF.8010902@colbyconsulting.com> I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking > for (int i=0; i { > MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, which will > be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that advanced > stuff... > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Dec 3 14:25:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 23:25:58 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF94FEF.8010902@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com><7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> <4CF94FEF.8010902@colbyconsulting.com> Message-ID: <2CAA780B74744345B7B244545399626D@nant> John -- <<< I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? >>> Yes. You can serialize/deserialize whole collections. No need to program imperatively such serialization/deserialization usually. Just Xml attributes and tiny generic serialize/deserialize methods will do all the tricks. It would be lighting fast for your collections having under hundred objects. Folks tend to use JSON for serialization/deserialization these days. But I haven't used it yet. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 23:16 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Thread safe list I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking for (int i=0; > i MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, > which will be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that > advanced stuff... > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 18:45:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 03:45:54 +0300 Subject: [dba-VB] Observations on VS2008 - not good but having simple workarounds ... Message-ID: Hi All -- Just echoing Mark Simms' thread from AccessD ("Observations on AC 2007) :) - here is one of VS2008 "glitches": http://sms-web.biz/ss/nierr.jpg I mean that cryptic and with a cut ending part error message which you can see on the above screenshot reported by VS2008 while in design mode. The only solution to this issue was to quit & start VS2008 again - and it worked fine. That happens with VS2008, it can also GPF once in a while etc. So, when you get stuck with such VS2008 issues try to "Clean All" followed by "Rebuild All" - if that would not help then just restart VS2008 - in 90% of cases that "simple trick" helps... Thank you. -- Shamil From stuart at lexacorp.com.pg Fri Dec 3 23:43:46 2010 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 04 Dec 2010 16:43:46 +1100 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CF9D512.22578.1E2F04EE@stuart.lexacorp.com.pg> http://www.gnupg.org/ The GNU Privacy Guard GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. Version 2 of GnuPG also provides support for S/MIME. GnuPG is Free Software (meaning that it respects your freedom). It can be freely used, modified and distributed under the terms of the GNU General Public License . GnuPG comes in two flavours: 1.4.11 is the well known and portable standalone version, whereas 2.0.16 is the enhanced and somewhat harder to build version. Project Gpg4win provides a Windows version of GnuPG. It is nicely integrated into an installer and features several frontends as well as (German) manuals. -- Stuart On 3 Dec 2010 at 14:39, jwcolby wrote: > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Dec 4 06:38:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 15:38:52 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: Hi John -- If the task is to just use cryptography to encrypt/decrypt data sent via Internet then you can use .NET built-in advanced cryptography classes/algorithms: http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec tionID=60 http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 5053700AM/CryptographyInDotNET.aspx http://www.codeproject.com/KB/security/dotnetcryptog.aspx Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 22:39 To: VBA Subject: [dba-VB] PGP Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 10:43:07 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 11:43:07 -0500 Subject: [dba-VB] PGP In-Reply-To: References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CFA6F9B.5000804@colbyconsulting.com> PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent via > Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > 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 shamil at smsconsulting.spb.ru Sat Dec 4 11:46:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 20:46:46 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CFA6F9B.5000804@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> <4CFA6F9B.5000804@colbyconsulting.com> Message-ID: John -- PGP uses IDEA algorithm by default they say here: http://stackoverflow.com/questions/3321174/what-algorithm-does-pgp-use-to-en crypt-the-private-key-using-the-passphrase Try to google it for C# implementation: http://www.google.ru/#hl=ru&&sa=X&ei=R336TK3pAoXsOdzE4NQK&sqi=2&ved=0CC4QBSg A&q=C%23+IDEA+algorithm+implementation&spell=1&fp=eb9a0cff6abb8ea8 If that will not work then it should not be a big issue to wrap a free command line PGP (GNU?) utility into a C# class library simple API activating such utility and collecting its results... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 4 ??????? 2010 ?. 19:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] PGP PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent > via Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1& > SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1 > 128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 16:26:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 17:26:43 -0500 Subject: [dba-VB] use a font in a class Message-ID: <4CFAC023.7010905@colbyconsulting.com> I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:52:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:52:18 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: Hi John -- What is that for: Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ? Note that you have new Font(Font, ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:55:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:55:34 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> John -- You can use: Font font = new Font(this.Font, FontStyle.Bold); Ignore my prev. posting in this thread. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 17:25:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:25:25 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <4CFACDE5.2000003@colbyconsulting.com> Yes, to set the font for a specific column. > Note that you have > new Font(Font, Yes, I know. I didn't write the code, but if I try to mod that part (for ecample lowercase the first letter) it won't compile. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:52 PM, Shamil Salakhetdinov wrote: > Hi John -- > > What is that for: > > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > > ? > > Note that you have > > new Font(Font, ... > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Dec 4 17:27:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:27:30 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> References: <4CFAC023.7010905@colbyconsulting.com> <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> Message-ID: <4CFACE62.8040608@colbyconsulting.com> Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 4 17:46:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 02:46:51 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFACE62.8040608@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: But you can pass form's Font instance to your class as a parameter, dont' you?... Or you can create a Font instance in your class, don't you? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 2:28 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff > into the list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, > bold); //status text > } > > Now I want to wrap the list and this code in a class so that I do not > have to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) > that Font reference only works in a form. > > Is there any way other than passing the font in to this method to us > the code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 19:25:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 20:25:19 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: <4CFAE9FF.4030403@colbyconsulting.com> > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, "this" is > the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:39:07 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:39:07 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAE9FF.4030403@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> Message-ID: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> John -- Did you try it like that?: //----------------------------------------- using System.Drawing; ... Font font = new Font("Arial", 3.1f); System.Console.WriteLine("{0}", font); // the above line will output: //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] //----------------------------------------- with System.Windows.Forms and System.Drawing references set? It works here in console app or class lib. I have used something like that many times... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 4:25 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, > "this" is the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 20:42:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 21:42:39 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> <71FC24F2CFA54A19AD4CCB53DA53917C@nant> Message-ID: <4CFAFC1F.70709@colbyconsulting.com> No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); > // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in a > class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >>> bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do not >>> have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:56:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:56:54 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAFC1F.70709@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com><71FC24F2CFA54A19AD4CCB53DA53917C@nant> <4CFAFC1F.70709@colbyconsulting.com> Message-ID: <66F2AA795DF244B1AC1EE7E74A3BBB0E@nant> Try it, it will make the "trick". Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 5:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, > GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in > a class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, >>> Color.White, bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do >>> not have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 23:55:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 00:55:25 -0500 Subject: [dba-VB] Blocking Message-ID: <4CFB294D.8040709@colbyconsulting.com> I have a trick new status listview and wrapper class to hold the delegates and all of the code for manipulating the status listview. It is all working fine. I added a new method of the wrapper class to call the ListView.Clear to clear out the list view. When I call that from the form's thread immediately before my process starts (the thread from the process ends up writing to that ListView through a delegate) it appears that I get a deadlock of some kind. The listview goes funny looking and the application hangs. If I comment out the call to the clear, everything works fine. I need to clear the listview before each run though so I need to make this work. I am not sure how to get the clear working. Any ideas? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Dec 5 12:43:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 13:43:06 -0500 Subject: [dba-VB] Tough to track down bug (in VS?) Message-ID: <4CFBDD3A.4050705@colbyconsulting.com> I ended up with a list view with a column named DateTime. The .Net framework has a DateTime object. As soon as I dropped a copy of this list view on a form that had the .Net DateTime object in its code, the project had build errors. VS decided that the DateTime object (DateTime.now anyone?) that was already in my code was magically a column object, which dies not have a .Now property. Lesson (which everyone already knows): Never name your objects using keywords from the language. As soon as I renamed my column to Date_Time, VS went through the code in that form and renamed the DateTime objects out in code to Date_Time as well. Once I found and fixed *those*, voila, my code compiled again. That one had me going for quite awhile. I knew it had something to do with that listview because dropping that on the form was the last thing I did before the compile error popped up, but tracking down the exact cause was tough! -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Mon Dec 6 04:20:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 11:20:03 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From shamil at smsconsulting.spb.ru Mon Dec 6 04:29:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 13:29:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Mon Dec 6 05:15:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 12:15:21 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From marklbreen at gmail.com Mon Dec 6 06:03:18 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 6 Dec 2010 12:03:18 +0000 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <58D794B0B29E4F709D49D46577A5B050@nant> Thank you, Mark. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 6 ??????? 2010 ?. 15:03 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Thank you, Gustav, -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ??????? 2010 ?. 14:15 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Silverlight 5 in 2011 Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From ha at phulse.com Mon Dec 6 07:26:47 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Mon, 6 Dec 2010 05:26:47 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:44:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:44:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Hans-Christian -- I suppose that "rumors about that Silverlight is dead are greatly exaggerated" :) I do not intend to start a "religious war" here iPhone, IPad, ... vs. Windows 7 Phone but I'd expect MS will make it this time as they did it many times before - they will get at least 50%(I'd bet) of the mobile/smart phones installed OSes market sooner or later... I can be wrong of course. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Hans-Christian Andersen Sent: 6 ??????? 2010 ?. 16:27 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > From accessd at shaw.ca Mon Dec 6 12:02:01 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 6 Dec 2010 10:02:01 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <811DDCCD3842473E8DB5C7AEF52DDB2B@creativesystemdesigns.com> Gustav: Have you heard what percentage of computers are now using or have it installed it on their computers? It seems Silverlight is competing with Flash and HTML5 and both these products which seem very well established and run on all platforms. Here is an ASP.Net programmer's 10 recommended supporting applications for development work: http://stephenwalther.com/blog/archive/2010/11/22/10-essential-tools-for-bui lding-asp-net-websites.aspx Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, December 06, 2010 2:20 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Tue Dec 7 21:18:32 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 8 Dec 2010 14:18:32 +1100 Subject: [dba-VB] Type Is Not Defined Message-ID: <000101cb9686$9805c490$c8114db0$@com.au> Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad From michael at ddisolutions.com.au Wed Dec 8 16:22:20 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 09:22:20 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 From actebs at actebs.com.au Wed Dec 8 20:56:51 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 13:56:51 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> Message-ID: <000601cb974c$bac8c6a0$305a53e0$@com.au> Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Dec 8 21:23:27 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 14:23:27 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 From actebs at actebs.com.au Wed Dec 8 21:58:25 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 14:58:25 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au><000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <000701cb9755$54841df0$fd8c59d0$@com.au> Now that's funny! Yep in Canberra and it's just stopped raining! Over 100mm overnight and everything is under water. Luckily we haven't been affected, but a lot of people around Canberra are struggling... Where are you located? Have you been affected by the rains? I've got the Crystal Report to work with some mucking around, but once I've gotten the hang of it, it seems OK. When you say huge assemblies to move around, aren't they just part of the .Net Framework or are there additional files to be included in the install package? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 2:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 8 22:05:47 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 08 Dec 2010 23:05:47 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <4D00559B.6050008@colbyconsulting.com> I love .Net. Someday I will be good enough to whip out .Net apps like I can whip out Access apps. ;) John W. Colby www.ColbyConsulting.com On 12/8/2010 10:23 PM, Michael Maddison wrote: > Lol, > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb > > > > It used to be like pulling teeth to get it to work right. Had to write > heaps of code to make them portable IIRC. > > Huge assemblies to move around and keep up to date. > > I haven't used it for years, I just use MS builtin reports now. > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > BTW you're in Canberra aren't you? > > Keeping dry? > > > > Cheers > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Thursday, 9 December 2010 1:57 PM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] Type Is Not Defined > > > > Hi Michael, > > Thanks for your reply. I got to the bottom of it eventually. I needed to > make a data table schema of what I wanted returned from the DB. After I > did > that, everything worked as expected. > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > why > wouldn't you use that as a basis for learning how to use classes? > > Thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > Maddison > Sent: Thursday, 9 December 2010 9:22 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Type Is Not Defined > > The compiler cant find 'CustomerDataSetSchema'. > > Is it in another project? Set a ref to the project. > > If you don't have the class then you need to get it and it needs to be > in the scope of the calling class, the tutorial should have it. > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > tutorial! > > > > Cheers > > > > Michael > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Wednesday, 8 December 2010 2:19 PM > To: 'dba-vb' > Subject: [dba-VB] Type Is Not Defined > > > > Hi Everyone, > > > > This is my first attempt at a class, so don't laugh. I am doing this via > a > tutorial, and keep getting: > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > I can't understand why this is throwing this error and hope someone can > shed > some light on it. The code is below: > > > > Imports System.Data > > Imports System.Data.OleDb > > > > Public Class DataSetConfiguration > > 'Private Const CONNECTION_STRING As String = > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb" > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > Private Const DATATABLE_NAME As String = "tblMainData" > > 'Bloew is for use within a website > > 'Private Const DIRECTORY_FILE_PATH As String = > "C:\WebSites\VB_Web_Data_DataSets\" > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > Get > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > Dim myOleDbConnection As OleDbConnection = New > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > Return myDataSet > > > > End Get > > End Property > > > > End Class > > > > Many Thanks > > > > Vlad > > > > > > > > > > > > _______________________________________________ > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > _______________________________________________ > 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 Thu Dec 9 03:14:09 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 09:14:09 +0000 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <4D00559B.6050008@colbyconsulting.com> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/8/2010 10:23 PM, Michael Maddison wrote: > > Lol, > > > > > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb > > > > > > > > It used to be like pulling teeth to get it to work right. Had to write > > heaps of code to make them portable IIRC. > > > > Huge assemblies to move around and keep up to date. > > > > I haven't used it for years, I just use MS builtin reports now. > > > > > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > > > > > BTW you're in Canberra aren't you? > > > > Keeping dry? > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Thursday, 9 December 2010 1:57 PM > > To: 'Discussion concerning Visual Basic and related programming issues.' > > Subject: Re: [dba-VB] Type Is Not Defined > > > > > > > > Hi Michael, > > > > Thanks for your reply. I got to the bottom of it eventually. I needed to > > make a data table schema of what I wanted returned from the DB. After I > > did > > that, everything worked as expected. > > > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > > why > > wouldn't you use that as a basis for learning how to use classes? > > > > Thanks... > > > > Vlad > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > > Maddison > > Sent: Thursday, 9 December 2010 9:22 AM > > To: Discussion concerning Visual Basic and related programming issues. > > Subject: Re: [dba-VB] Type Is Not Defined > > > > The compiler cant find 'CustomerDataSetSchema'. > > > > Is it in another project? Set a ref to the project. > > > > If you don't have the class then you need to get it and it needs to be > > in the scope of the calling class, the tutorial should have it. > > > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > > tutorial! > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Wednesday, 8 December 2010 2:19 PM > > To: 'dba-vb' > > Subject: [dba-VB] Type Is Not Defined > > > > > > > > Hi Everyone, > > > > > > > > This is my first attempt at a class, so don't laugh. I am doing this via > > a > > tutorial, and keep getting: > > > > > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > > > > > I can't understand why this is throwing this error and hope someone can > > shed > > some light on it. The code is below: > > > > > > > > Imports System.Data > > > > Imports System.Data.OleDb > > > > > > > > Public Class DataSetConfiguration > > > > 'Private Const CONNECTION_STRING As String = > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > > Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb" > > > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > > > Private Const DATATABLE_NAME As String = "tblMainData" > > > > 'Bloew is for use within a website > > > > 'Private Const DIRECTORY_FILE_PATH As String = > > "C:\WebSites\VB_Web_Data_DataSets\" > > > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > > > Get > > > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > > > Dim myOleDbConnection As OleDbConnection = New > > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > > > Return myDataSet > > > > > > > > End Get > > > > End Property > > > > > > > > End Class > > > > > > > > Many Thanks > > > > > > > > Vlad > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Thu Dec 9 04:36:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 09 Dec 2010 11:36:47 +0100 Subject: [dba-VB] Type Is Not Defined Message-ID: Hi Mark Love SQL Server? Not me. Like John I prefer to spend time with VS and .Net. /gustav >>> marklbreen at gmail.com 09-12-2010 10:14 >>> Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 9 05:17:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 06:17:48 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: <4D00BADC.4040301@colbyconsulting.com> Mark, I am a programmer at heart and .Net and C# gives me programming power like I have never had before. I love SQL Server for it's ability to give me big iron database engine capabilities, but I do not spend time in it, I just use it. I have never learned how to debug code in SQL Server the way I can in VS, so basically I write in C# and just drive SQL Server with my C# code. John W. Colby www.ColbyConsulting.com On 12/9/2010 4:14 AM, Mark Breen wrote: > Hey John, > > Just curious, would you say you love SQL Server also? > > I suppose if I love software of any kind, it has to be SQL server. > > Mark > > > > On 9 December 2010 04:05, jwcolby wrote: > >> I love .Net. Someday I will be good enough to whip out .Net apps like I >> can whip out Access apps. ;) >> >> John W. Colby >> www.ColbyConsulting.com From actebs at actebs.com.au Thu Dec 9 06:16:04 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 23:16:04 +1100 Subject: [dba-VB] VB.Net and Microsoft Report Viewer Message-ID: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad From shamil at smsconsulting.spb.ru Thu Dec 9 09:27:59 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 9 Dec 2010 18:27:59 +0300 Subject: [dba-VB] VB.Net and Microsoft Report Viewer In-Reply-To: <000801cb979a$d9b24d90$8d16e8b0$@com.au> References: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Message-ID: <33A5DC6AE6554B2EAF023160C2225706@nant> Hi Vlad -- <<< I would check out the Microsoft Report Viewer. Can anyone show me an example of how to achieve this please? >>> Welcome to http://northwind.codeplex.com/ ! <<< the issues distributing your app using the Crystal Report Viewer >>> That usually works well - you just need to install CRV runtime... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 9 ??????? 2010 ?. 15:16 To: 'dba-vb' Subject: [dba-VB] VB.Net and Microsoft Report Viewer Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:30:04 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:30:04 -0500 Subject: [dba-VB] Snippet editor Message-ID: <4D01121C.2010806@colbyconsulting.com> Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Thu Dec 9 11:33:50 2010 From: df.waters at comcast.net (Dan Waters) Date: Thu, 9 Dec 2010 11:33:50 -0600 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01121C.2010806@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> Message-ID: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> I did a search on 'visual studio snippets tutorial' and got lots of hits. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 09, 2010 11:30 AM To: VBA Subject: [dba-VB] Snippet editor Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:53:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:53:33 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> Message-ID: <4D01179D.5000003@colbyconsulting.com> As did I all about hand editing xml files. YUK! I thought perhaps someone on this list was using an actual snippet editor that integrated into SQL Server and allowed me to edit the snippet directly. John W. Colby www.ColbyConsulting.com On 12/9/2010 12:33 PM, Dan Waters wrote: > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 09, 2010 11:30 AM > To: VBA > Subject: [dba-VB] Snippet editor > > Does anyone know of one that is easy to use and integrated in VS? > From marklbreen at gmail.com Thu Dec 9 14:42:41 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 20:42:41 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01179D.5000003@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> Message-ID: Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet editor > that integrated into SQL > Server and allowed me to edit the snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > 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 9 15:42:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 00:42:39 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com> Message-ID: <19ACDAEBEACD47DB894BE71AFD067417@nant> Hi Mark -- <<< I struggle now when I am on a box that does not have it installed. >>> One of the best memory trainings is to study and to master SQL syntax hand typing from one own "memory cells", no Intellisense help of any kind provided:) I know, I know... lazy MS Access developers, spoiled by QBE (myself included) are rarely able to type lengthy SQL expressions from their own memory... :) 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: 9 ??????? 2010 ?. 23:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet > editor that integrated into SQL Server and allowed me to edit the > snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Fri Dec 10 03:25:42 2010 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 10 Dec 2010 09:25:42 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <19ACDAEBEACD47DB894BE71AFD067417@nant> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Dec 10 05:11:27 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 06:11:27 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: <4D020ADF.3080502@colbyconsulting.com> Yea, it is common. Who did you say you are? John W. Colby www.ColbyConsulting.com On 12/10/2010 4:25 AM, Mark Breen wrote: > Hi Shamil, > > Speaking of memory, > > I am 41 and I notice in the last 12 - 24 months that I no longer have the > memory I had when I was in my 20s and 30s. I am told by a few people that > it is rather common, but I still hate this lack of feeling sharp - does > anyone else recognise this. Is it common as a few friends have said? IOW > am I just getting old? > > Mark > > > > On 9 December 2010 21:42, Shamil Salakhetdinov > wrote: > >> >> Hi Mark -- >> >> <<< >> I struggle now when I am on a box that does not have it installed. >>>>> >> One of the best memory trainings is to study and to master SQL syntax hand >> typing from one own "memory cells", no Intellisense help of any kind >> provided:) >> I know, I know... lazy MS Access developers, spoiled by QBE (myself >> included) are rarely able to type lengthy SQL expressions from their own >> memory... >> >> :) >> >> 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: 9 ??????? 2010 ?. 23:43 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] Snippet editor >> >> Hello John, >> >> I use SQL Promot by redgate and find it extremely useful, so much so, I >> struggle now when I am on a box that does not have it installed. >> >> thanks >> >> Mark >> >> >> On 9 December 2010 17:53, jwcolby wrote: >> >>> As did I all about hand editing xml files. >>> >>> YUK! >>> >>> I thought perhaps someone on this list was using an actual snippet >>> editor that integrated into SQL Server and allowed me to edit the >>> snippet directly. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 12/9/2010 12:33 PM, Dan Waters wrote: >>>> I did a search on 'visual studio snippets tutorial' and got lots of >> hits. >>>> >>>> Dan >>>> >>>> -----Original Message----- >>>> From: dba-vb-bounces at databaseadvisors.com >>>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>>> Sent: Thursday, December 09, 2010 11:30 AM >>>> To: VBA >>>> Subject: [dba-VB] Snippet editor >>>> >>>> Does anyone know of one that is easy to use and integrated in VS? >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Fri Dec 10 08:43:08 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 10 Dec 2010 06:43:08 -0800 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark: This is why we have computers...fills in those little gaps. (Spoken from a man over 60.) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, December 10, 2010 1:26 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 08:56:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 09:56:15 -0500 Subject: [dba-VB] how do i get coderush back Message-ID: <4D023F8F.40804@colbyconsulting.com> I have coderush on my computer, and I see it working in the little lines that show the program structure, but I do not have the code rush menu or toolbar. Any idea how to get those back? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 10 09:06:23 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 18:06:23 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com><19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark -- <<< I am 41... am I just getting old? >>> Not old but older. When you turned your 40 you've got to the "mature people club". Welcome to the Club! :) 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: 10 ??????? 2010 ?. 12:26 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax > hand typing from one own "memory cells", no Intellisense help of any > kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their > own memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, > I struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots > > > of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 15:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:30:11 -0500 Subject: [dba-VB] Web page manipulation Message-ID: <4D029BE3.1070407@colbyconsulting.com> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Dec 10 15:33:49 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:33:49 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Yes. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Dec 10 15:44:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:44:30 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D029F3E.5080401@colbyconsulting.com> You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > From DWUTKA at Marlow.com Fri Dec 10 15:54:01 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:54:01 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029F3E.5080401@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: No. You asked if you can programmatically manipulate web pages to cause specific pages to open, etc. The answer is yes. You didn't ask how to do it! LOL I have done a few projects that do this. The 'how' is both simple, complicated, easy, and a complete PITA. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:45 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From davidmcafee at gmail.com Fri Dec 10 16:16:29 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:16:29 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: If you know the final link to the file in question you can use that. That's what I do with some of the click once stuff for prerequisites. On Fri, Dec 10, 2010 at 1:54 PM, Drew Wutka wrote: > No. You asked if you can programmatically manipulate web pages to cause > specific pages to open, etc. The answer is yes. You didn't ask how to > do it! LOL > > I have done a few projects that do this. The 'how' is both simple, > complicated, easy, and a complete PITA. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:45 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > You must be a Microsoft employee eh? ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/10/2010 4:33 PM, Drew Wutka wrote: > > Yes. > > > > Drew > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Friday, December 10, 2010 3:30 PM > > To: VBA > > Subject: [dba-VB] Web page manipulation > > > > My client has to go through a process where he clicks about 20 - 30 > > things to manage to get a file > > downloaded. It sounded totally convoluted but the question is (and I > > have asked this before without > > a usable response) can I programmatically manipulate web pages to > cause > > specific pages to open, > > click buttons, input data into controls etc. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 10 16:28:43 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 10 Dec 2010 23:28:43 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John It is. I even think I posted a code snippet in C# I ran with success when you asked for this the first time. The trick these days is to find out which Java Script functions and parameters are called for navigating the pages and submit data. I used FireFox and an HTTP add-in debugger and/or Google Chrome and its debug feature for this. Be prepared for some "fun" hours and start with testing your code towards a simple site. /gustav >>> jwcolby at colbyconsulting.com 10-12-2010 22:30 >>> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From davidmcafee at gmail.com Fri Dec 10 16:24:08 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:24:08 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: Message-ID: not to mention when they make changes to their site. On Fri, Dec 10, 2010 at 2:28 PM, Gustav Brock wrote: > > Be prepared for some "fun" hours and start with testing your code towards a > simple site. > > /gustav > > From DWUTKA at Marlow.com Fri Dec 10 16:33:05 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 16:33:05 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Now for a little more info for you. Yes, you can certainly do this. Technically, it's not much different than if someone handed you an .mde, and asked you to automate tasks in the mde (so you couldn't tweak the source code running the program itself, but you could open the mde with VBA, and use the objects within it just like you'd use the objects in your own application.) Trick #1: Just like with an .mde, you have to have a reference to the database itself, so with a browser, you need a reference to it. You can either programmatically open a browser window (so you'll both create the object, and have a reference to it), or you can ask the user which browser window they want you to use (so you can grab the browser window through code). Here's an example of how to grab an existing browser window: Function GetExistingBrowser(strKey As String) Dim SWs As New SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As InternetExplorer Dim Resp For Each IE In SWs Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + vbQuestion, "Select IE") If Resp = vbYes Then Set mdie = Nothing Set mdie = IE.Application NewSormDataEntry strKey, mdie Exit Function End If Next End Function The 'NewSormDataEntry' function is the function I am sending the mdie object too (the referenced browser window). In this function strKey is the primary key of a record that will be used in that NewSormDataEntry to submit data into a web site. Trick #2: Just like when the development world got a wedgie when Microsoft 'secured' Outlook from programs just using it to send email, web security can be a real pain in doing something like this. The security is put in place to impede (note, I didn't say prevent) a hacker from doing nasty stuff to the site. So the 'impeding' garbage designed to trip up hackers can get in the way of a legitimate developer trying to create a helpful tool. So before you COMMIT to being able to make the tool, you'll need to look at the site itself, to see what all will get in your way. Trick #3: There are two ways to 'find' the objects you will need your code to work with. The first is to just look at the HTML of the page(s) you are going to manipulate. This is where some of those 'impediments' come into play. Some sites prevent you from right clicking on a page and selecting 'View Source'. Ironically, this is just removing a 'shortcut' way to view the HTML source behind a page. It doesn't actually HIDE the source, because your browser is viewing the source, it has too, otherwise it will have nothing to display. So there are multiple ways to 'download' the HTML you can view yourself. Create your own browser, and dump the HTML to a file. You can also use API calls to just directly download the HTML, without a browser. If the page is derived from internal (on the website server) variables, you'll need to use your own browser to get there and download the source. The second way to 'find' the objects you need to deal with are with the object browser. Running your code in debug mode, you'll be able to see the browser object, and all of it's child elements. Trick #4: Events and properties. Setting the value of a textbox, or clicking a button, just requires that you know what the events and properties of those objects are. I use the MSDN that came with the developer edition of Office 2000. It's got a nice HTML guide with common HTML form elements, their properties, methods, and events. But all that information is also plastered all over the web. Trick #5: When a page loads, the browser object is there, but you may not be able to capture 'download complete' events. What I have done in these cases, where my code puts in data on a page, clicks a button to go to the next page, I put my code in a loop, that sits and waits for an object from the next page to exist. Of course, if there are applets, or flash media elements, required for interaction... can't help ya there, haven't tackled one of those. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sun Dec 12 23:32:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 00:32:34 -0500 Subject: [dba-VB] Browser based database Message-ID: <4D05AFF2.3070701@colbyconsulting.com> I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Dec 13 00:03:50 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 13 Dec 2010 17:03:50 +1100 Subject: [dba-VB] Browser based database References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <99266C61B516644D9727F983FAFAB465046771@remote.ddisolutions.com.au> John, I was the same way. Still very much finding my way in ASP.net. But the basics are pretty straightforward. An ASP.net application is basically, Normal .net code, c# or vb.net whatever. Normal HTML Javascript (optional)(inserted by VS) Create a new asp.net project. Add a webform, select code in separate file. Change to split view Add a SQLDataSource control to the designer part of the form, hook it up to a small table. Add a DataGrid control to the designer part of the form, set the datasource. Run the project. See http://www.asp.net/get-started to get started. I've only done web forms and Ajax so far. Cheers Michael M From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 13 December 2010 4:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com ________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3311 - Release Date: 12/12/10 From ebarro at roadrunner.com Mon Dec 13 00:45:47 2010 From: ebarro at roadrunner.com (Eric Barro) Date: Sun, 12 Dec 2010 22:45:47 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D05AFF2.3070701@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <013d01cb9a91$604a5250$20def6f0$@com> John, ASP.NET uses either C# or VB.NET as the underlying development language. Of course there are other technologies involved such as Javascript, HMTL, CSS etc. There's no way to convert a WinForm application to a web app with one click of a button. You'd have to recreate your WinForm in ASP.NET using the built-in .NET equivalent controls. The good thing is that they are one and the same type of control on the web app (ie TextBox in WinForms is still TextBox on a web app). If you programmed your business logic in separate classes and you refrained from directly referencing controls in the methods then you should be fine and you should be able to use most of your code in a web app. The main things you will need to deal with in a web app such as ASP.NET are the following: 1. Session variables - this is one of the ways you can pass data back and forth from one page to the next since web apps are stateless apps and there is no "automatic way" of "remembering" data from one page to the next. 2. Postback events - when a user clicks a button on a WinForm all you need to do is trap for the click event. On a web app you need to be aware of when postbacks (basically trips to the server) occur so that you can properly trap events or intercept them. 3. Server side versus client side events - this is probably the hardest concept to grasp for most beginning web app developers. 4. Client side scripting - When it's done and said, all ASP.NET does really is render the page in HTML and handle the events using Javascript. You will need to get your feet wet learning Javascript as well. Fortunately, the syntax is based on C but variables and objects are not strongly-typed. --Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, December 12, 2010 9:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Mon Dec 13 03:45:37 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:45:37 +0000 Subject: [dba-VB] Browser based database In-Reply-To: <013d01cb9a91$604a5250$20def6f0$@com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: Hello John, There are lots of things to consider when you out an app online, security being just one. But there are really many other things also, most of which I do not know. However, I am currently happily developing web apps myself, and I spent minutes and hours on my coding. I am using DotNetNuke as my framework and it works a treat. I keep it simple and try not to get too fancy. There is loads of help available from the groups and forums. It is not too wild to suggest that in the future 50% or more of our customers will want web based front ends, so I urge you to study DNN - a few days of reading the forums and the turorials on module development will have you coding apps in no time. Do not be put off by the initial barrier to entry, once you get the hang of it, and one you keep it simple, you can code in the same ol' c# style , but your GUI will be a DNN website. Oh, and it if fun also. Mark On 13 December 2010 06:45, Eric Barro wrote: > John, > > ASP.NET uses either C# or VB.NET as the underlying development language. > Of > course there are other technologies involved such as Javascript, HMTL, CSS > etc. > > There's no way to convert a WinForm application to a web app with one click > of a button. You'd have to recreate your WinForm in ASP.NET using the > built-in .NET equivalent controls. The good thing is that they are one and > the same type of control on the web app (ie TextBox in WinForms is still > TextBox on a web app). > > If you programmed your business logic in separate classes and you refrained > from directly referencing controls in the methods then you should be fine > and you should be able to use most of your code in a web app. > > The main things you will need to deal with in a web app such as ASP.NETare > the following: > > 1. Session variables - this is one of the ways you can pass data back and > forth from one page to the next since web apps are stateless apps and there > is no "automatic way" of "remembering" data from one page to the next. > 2. Postback events - when a user clicks a button on a WinForm all you need > to do is trap for the click event. On a web app you need to be aware of > when > postbacks (basically trips to the server) occur so that you can properly > trap events or intercept them. > 3. Server side versus client side events - this is probably the hardest > concept to grasp for most beginning web app developers. > 4. Client side scripting - When it's done and said, all ASP.NET does > really > is render the page in HTML and handle the events using Javascript. You will > need to get your feet wet learning Javascript as well. Fortunately, the > syntax is based on C but variables and objects are not strongly-typed. > > --Eric > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Sunday, December 12, 2010 9:33 PM > To: VBA > Subject: [dba-VB] Browser based database > > I need to do two different browser based databases (I think). I know > nothing about this. Both > clients need to enter data and have multiple users hitting the database > from > home and office computers. > > Where do I start? I am getting pretty good with C# / SQL Server but those > are computer based > "applications". If I could do an internet download installation, I could > probably (maybe) go there. > Except what about admin rights etc. > > Is asp.net viable? Is it close to C#? If I keep the data entry screens > simple can I do it in C# > and then just "press a button" to turn it into ASP.net? Please don't make > rude noises here. > > ;) > > I just know nothing about internet facing application programming and I > feel > really inadequate on > this stuff. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 Mon Dec 13 03:48:10 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:48:10 +0000 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Hello John Another choice is to use Sillennium It is built for this task and will allow you to easily change your library of routines when your website changes. Mark On 10 December 2010 22:33, Drew Wutka wrote: > Now for a little more info for you. Yes, you can certainly do this. > Technically, it's not much different than if someone handed you an .mde, > and asked you to automate tasks in the mde (so you couldn't tweak the > source code running the program itself, but you could open the mde with > VBA, and use the objects within it just like you'd use the objects in > your own application.) > > Trick #1: Just like with an .mde, you have to have a reference to the > database itself, so with a browser, you need a reference to it. You can > either programmatically open a browser window (so you'll both create the > object, and have a reference to it), or you can ask the user which > browser window they want you to use (so you can grab the browser window > through code). > > Here's an example of how to grab an existing browser window: > > Function GetExistingBrowser(strKey As String) > Dim SWs As New SHDocVw.ShellWindows > Dim IE As SHDocVw.InternetExplorer > Dim mdie As InternetExplorer > Dim Resp > For Each IE In SWs > Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & > IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + > vbQuestion, "Select IE") > If Resp = vbYes Then > Set mdie = Nothing > Set mdie = IE.Application > NewSormDataEntry strKey, mdie > Exit Function > End If > Next > End Function > > The 'NewSormDataEntry' function is the function I am sending the mdie > object too (the referenced browser window). In this function strKey is > the primary key of a record that will be used in that NewSormDataEntry > to submit data into a web site. > > Trick #2: Just like when the development world got a wedgie when > Microsoft 'secured' Outlook from programs just using it to send email, > web security can be a real pain in doing something like this. The > security is put in place to impede (note, I didn't say prevent) a hacker > from doing nasty stuff to the site. So the 'impeding' garbage designed > to trip up hackers can get in the way of a legitimate developer trying > to create a helpful tool. So before you COMMIT to being able to make > the tool, you'll need to look at the site itself, to see what all will > get in your way. > > Trick #3: There are two ways to 'find' the objects you will need your > code to work with. The first is to just look at the HTML of the page(s) > you are going to manipulate. This is where some of those 'impediments' > come into play. Some sites prevent you from right clicking on a page > and selecting 'View Source'. Ironically, this is just removing a > 'shortcut' way to view the HTML source behind a page. It doesn't > actually HIDE the source, because your browser is viewing the source, it > has too, otherwise it will have nothing to display. So there are > multiple ways to 'download' the HTML you can view yourself. Create your > own browser, and dump the HTML to a file. You can also use API calls to > just directly download the HTML, without a browser. If the page is > derived from internal (on the website server) variables, you'll need to > use your own browser to get there and download the source. The second > way to 'find' the objects you need to deal with are with the object > browser. Running your code in debug mode, you'll be able to see the > browser object, and all of it's child elements. > > Trick #4: Events and properties. Setting the value of a textbox, or > clicking a button, just requires that you know what the events and > properties of those objects are. I use the MSDN that came with the > developer edition of Office 2000. It's got a nice HTML guide with > common HTML form elements, their properties, methods, and events. But > all that information is also plastered all over the web. > > Trick #5: When a page loads, the browser object is there, but you may > not be able to capture 'download complete' events. What I have done in > these cases, where my code puts in data on a page, clicks a button to go > to the next page, I put my code in a loop, that sits and waits for an > object from the next page to exist. > > Of course, if there are applets, or flash media elements, required for > interaction... can't help ya there, haven't tackled one of those. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > > -- > 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 > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:11:31 -0500 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: <4D0637A3.8020609@colbyconsulting.com> Thanks everyone who has responded. Both of these are cases where the company is "virtual" and all the stakeholders are scattered around. The database has to be accessed over the internet, and from who knows where. I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but then you run into installation issues etc. With "clickonce" deployment even that might be possible. I think if I could do a real app distributed with ClickOnce I would go that route. It just puts off learning all of the web / html / java stuff. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:45 AM, Mark Breen wrote: > Hello John, > > There are lots of things to consider when you out an app online, security > being just one. But there are really many other things also, most of which > I do not know. > > However, I am currently happily developing web apps myself, and I spent > minutes and hours on my coding. > > I am using DotNetNuke as my framework and it works a treat. I keep it > simple and try not to get too fancy. There is loads of help available from > the groups and forums. > > It is not too wild to suggest that in the future 50% or more of our > customers will want web based front ends, so I urge you to study DNN - a few > days of reading the forums and the turorials on module development will have > you coding apps in no time. > > Do not be put off by the initial barrier to entry, once you get the hang of > it, and one you keep it simple, you can code in the same ol' c# style , but > your GUI will be a DNN website. > > Oh, and it if fun also. > > Mark > > > On 13 December 2010 06:45, Eric Barro wrote: > >> John, >> >> ASP.NET uses either C# or VB.NET as the underlying development language. >> Of >> course there are other technologies involved such as Javascript, HMTL, CSS >> etc. >> >> There's no way to convert a WinForm application to a web app with one click >> of a button. You'd have to recreate your WinForm in ASP.NET using the >> built-in .NET equivalent controls. The good thing is that they are one and >> the same type of control on the web app (ie TextBox in WinForms is still >> TextBox on a web app). >> >> If you programmed your business logic in separate classes and you refrained >> from directly referencing controls in the methods then you should be fine >> and you should be able to use most of your code in a web app. >> >> The main things you will need to deal with in a web app such as ASP.NETare >> the following: >> >> 1. Session variables - this is one of the ways you can pass data back and >> forth from one page to the next since web apps are stateless apps and there >> is no "automatic way" of "remembering" data from one page to the next. >> 2. Postback events - when a user clicks a button on a WinForm all you need >> to do is trap for the click event. On a web app you need to be aware of >> when >> postbacks (basically trips to the server) occur so that you can properly >> trap events or intercept them. >> 3. Server side versus client side events - this is probably the hardest >> concept to grasp for most beginning web app developers. >> 4. Client side scripting - When it's done and said, all ASP.NET does >> really >> is render the page in HTML and handle the events using Javascript. You will >> need to get your feet wet learning Javascript as well. Fortunately, the >> syntax is based on C but variables and objects are not strongly-typed. >> >> --Eric >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Sunday, December 12, 2010 9:33 PM >> To: VBA >> Subject: [dba-VB] Browser based database >> >> I need to do two different browser based databases (I think). I know >> nothing about this. Both >> clients need to enter data and have multiple users hitting the database >> from >> home and office computers. >> >> Where do I start? I am getting pretty good with C# / SQL Server but those >> are computer based >> "applications". If I could do an internet download installation, I could >> probably (maybe) go there. >> Except what about admin rights etc. >> >> Is asp.net viable? Is it close to C#? If I keep the data entry screens >> simple can I do it in C# >> and then just "press a button" to turn it into ASP.net? Please don't make >> rude noises here. >> >> ;) >> >> I just know nothing about internet facing application programming and I >> feel >> really inadequate on >> this stuff. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:33:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:33:44 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D063CD8.4020303@colbyconsulting.com> The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your library > of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an .mde, >> and asked you to automate tasks in the mde (so you couldn't tweak the >> source code running the program itself, but you could open the mde with >> VBA, and use the objects within it just like you'd use the objects in >> your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to the >> database itself, so with a browser, you need a reference to it. You can >> either programmatically open a browser window (so you'll both create the >> object, and have a reference to it), or you can ask the user which >> browser window they want you to use (so you can grab the browser window >> through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) >> Dim SWs As New SHDocVw.ShellWindows >> Dim IE As SHDocVw.InternetExplorer >> Dim mdie As InternetExplorer >> Dim Resp >> For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey is >> the primary key of a record that will be used in that NewSormDataEntry >> to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send email, >> web security can be a real pain in doing something like this. The >> security is put in place to impede (note, I didn't say prevent) a hacker >> from doing nasty stuff to the site. So the 'impeding' garbage designed >> to trip up hackers can get in the way of a legitimate developer trying >> to create a helpful tool. So before you COMMIT to being able to make >> the tool, you'll need to look at the site itself, to see what all will >> get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need your >> code to work with. The first is to just look at the HTML of the page(s) >> you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, it >> has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create your >> own browser, and dump the HTML to a file. You can also use API calls to >> just directly download the HTML, without a browser. If the page is >> derived from internal (on the website server) variables, you'll need to >> use your own browser to get there and download the source. The second >> way to 'find' the objects you need to deal with are with the object >> browser. Running your code in debug mode, you'll be able to see the >> browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. But >> all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you may >> not be able to capture 'download complete' events. What I have done in >> these cases, where my code puts in data on a page, clicks a button to go >> to the next page, I put my code in a loop, that sits and waits for an >> object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required for >> interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file >> downloaded. It sounded totally convoluted but the question is (and I >> have asked this before without >> a usable response) can I programmatically manipulate web pages to cause >> specific pages to open, >> click buttons, input data into controls etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for the >> person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI >> Business >> Sensitive material. If you are not the intended recipient, please contact >> the sender >> immediately and destroy the material in its entirety, whether electronic or >> hard copy. >> You are notified that any review, retransmission, copying, disclosure, >> dissemination, >> or other use of, or taking of any action in reliance upon this information >> by persons >> or entities other than the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From davidmcafee at gmail.com Mon Dec 13 10:09:41 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 08:09:41 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D0637A3.8020609@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: U use a click once app for our nationwide sales force. Very easy to implement and using webservice calls, seems like a local app. I'll post some samples when I get into the office Sent from my Droid phone. On Dec 13, 2010 7:12 AM, "jwcolby" wrote: > > Thanks everyone who has responded. > > Both of these are cases where the company is "virtual" and all the stakeholders are scattered > around. The database has to be accessed over the internet, and from who knows where. > > I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but > then you run into installation issues etc. With "clickonce" deployment even that might be possible. > I think if I could do a real app distributed with ClickOnce I would go that route. It just puts > off learning all of the web / html / java stuff. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:45 AM, Mark Breen wrote: > > Hello John, > > > > There are lots of things to consider when you out an app online, security > > being just one. But there are really many other things also, most of which > > I do not know. > > > > However, I am currently happily developing web apps myself, and I spent > > minutes and hours on my coding. > > > > I am using DotNetNuke as my framework and it works a treat. I keep it > > simple and try not to get too fancy. There is loads of help available from > > the groups and forums. > > > > It is not too wild to suggest that in the future 50% or more of our > > customers will want web based front ends, so I urge you to study DNN - a few > > days of reading the forums and the turorials on module development will have > > you coding apps in no time. > > > > Do not be put off by the initial barrier to entry, once you get the hang of > > it, and one you keep it simple, you can code in the same ol' c# style , but > > your GUI will be a DNN website. > > > > Oh, and it if fun also. > > > > Mark > > > > > > On 13 December 2010 06:45, Eric Barro wrote: > > > >> John, > >> > >> ASP.NET uses either C# or VB.NET as the underlying development language. > >> Of > >> course there are other technologies involved such as Javascript, HMTL, CSS > >> etc. > >> > >> There's no way to convert a WinForm application to a web app with one click > >> of a button. You'd have to recreate your WinForm in ASP.NET using the > >> built-in .NET equivalent controls. The good thing is that they are one and > >> the same type of control on the web app (ie TextBox in WinForms is still > >> TextBox on a web app). > >> > >> If you programmed your business logic in separate classes and you refrained > >> from directly referencing controls in the methods then you should be fine > >> and you should be able to use most of your code in a web app. > >> > >> The main things you will need to deal with in a web app such as ASP.NETare > >> the following: > >> > >> 1. Session variables - this is one of the ways you can pass data back and > >> forth from one page to the next since web apps are stateless apps and there > >> is no "automatic way" of "remembering" data from one page to the next. > >> 2. Postback events - when a user clicks a button on a WinForm all you need > >> to do is trap for the click event. On a web app you need to be aware of > >> when > >> postbacks (basically trips to the server) occur so that you can properly > >> trap events or intercept them. > >> 3. Server side versus client side events - this is probably the hardest > >> concept to grasp for most beginning web app developers. > >> 4. Client side scripting - When it's done and said, all ASP.NET does > >> really > >> is render the page in HTML and handle the events using Javascript. You will > >> need to get your feet wet learning Javascript as well. Fortunately, the > >> syntax is based on C but variables and objects are not strongly-typed. > >> > >> --Eric > >> > >> -----Original Message----- > >> From: dba-vb-bounces at databaseadvisors.com > >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > >> Sent: Sunday, December 12, 2010 9:33 PM > >> To: VBA > >> Subject: [dba-VB] Browser based database > >> > >> I need to do two different browser based databases (I think). I know > >> nothing about this. Both > >> clients need to enter data and have multiple users hitting the database > >> from > >> home and office computers. > >> > >> Where do I start? I am getting pretty good with C# / SQL Server but those > >> are computer based > >> "applications". If I could do an internet download installation, I could > >> probably (maybe) go there. > >> Except what about admin rights etc. > >> > >> Is asp.net viable? Is it close to C#? If I keep the data entry screens > >> simple can I do it in C# > >> and then just "press a button" to turn it into ASP.net? Please don't make > >> rude noises here. > >> > >> ;) > >> > >> I just know nothing about internet facing application programming and I > >> feel > >> really inadequate on > >> this stuff. > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Dec 13 10:35:04 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 13 Dec 2010 08:35:04 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D063CD8.4020303@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> Message-ID: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 13, 2010 7:34 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your > library of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an >> .mde, and asked you to automate tasks in the mde (so you couldn't >> tweak the source code running the program itself, but you could open >> the mde with VBA, and use the objects within it just like you'd use >> the objects in your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to >> the database itself, so with a browser, you need a reference to it. >> You can either programmatically open a browser window (so you'll both >> create the object, and have a reference to it), or you can ask the >> user which browser window they want you to use (so you can grab the >> browser window through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) Dim SWs As New >> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >> InternetExplorer Dim Resp For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey >> is the primary key of a record that will be used in that >> NewSormDataEntry to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send >> email, web security can be a real pain in doing something like this. >> The security is put in place to impede (note, I didn't say prevent) a >> hacker from doing nasty stuff to the site. So the 'impeding' garbage >> designed to trip up hackers can get in the way of a legitimate >> developer trying to create a helpful tool. So before you COMMIT to >> being able to make the tool, you'll need to look at the site itself, >> to see what all will get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need >> your code to work with. The first is to just look at the HTML of the >> page(s) you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, >> it has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create >> your own browser, and dump the HTML to a file. You can also use API >> calls to just directly download the HTML, without a browser. If the >> page is derived from internal (on the website server) variables, >> you'll need to use your own browser to get there and download the >> source. The second way to 'find' the objects you need to deal with >> are with the object browser. Running your code in debug mode, you'll >> be able to see the browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. >> But all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you >> may not be able to capture 'download complete' events. What I have >> done in these cases, where my code puts in data on a page, clicks a >> button to go to the next page, I put my code in a loop, that sits and >> waits for an object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required >> for interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file downloaded. It sounded totally >> convoluted but the question is (and I have asked this before without >> a usable response) can I programmatically manipulate web pages to >> cause specific pages to open, click buttons, input data into controls >> etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and >> destroy the material in its entirety, whether electronic or hard >> copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than >> the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 13 10:57:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 11:57:48 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> Message-ID: <4D06508C.6030004@colbyconsulting.com> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:48 AM, Mark Breen wrote: >> Hello John >> >> Another choice is to use Sillennium >> >> It is built for this task and will allow you to easily change your >> library of routines when your website changes. >> >> Mark >> >> >> >> >> On 10 December 2010 22:33, Drew Wutka wrote: >> >>> Now for a little more info for you. Yes, you can certainly do this. >>> Technically, it's not much different than if someone handed you an >>> .mde, and asked you to automate tasks in the mde (so you couldn't >>> tweak the source code running the program itself, but you could open >>> the mde with VBA, and use the objects within it just like you'd use >>> the objects in your own application.) >>> >>> Trick #1: Just like with an .mde, you have to have a reference to >>> the database itself, so with a browser, you need a reference to it. >>> You can either programmatically open a browser window (so you'll both >>> create the object, and have a reference to it), or you can ask the >>> user which browser window they want you to use (so you can grab the >>> browser window through code). >>> >>> Here's an example of how to grab an existing browser window: >>> >>> Function GetExistingBrowser(strKey As String) Dim SWs As New >>> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >>> InternetExplorer Dim Resp For Each IE In SWs >>> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >>> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >>> vbQuestion, "Select IE") >>> If Resp = vbYes Then >>> Set mdie = Nothing >>> Set mdie = IE.Application >>> NewSormDataEntry strKey, mdie >>> Exit Function >>> End If >>> Next >>> End Function >>> >>> The 'NewSormDataEntry' function is the function I am sending the mdie >>> object too (the referenced browser window). In this function strKey >>> is the primary key of a record that will be used in that >>> NewSormDataEntry to submit data into a web site. >>> >>> Trick #2: Just like when the development world got a wedgie when >>> Microsoft 'secured' Outlook from programs just using it to send >>> email, web security can be a real pain in doing something like this. >>> The security is put in place to impede (note, I didn't say prevent) a >>> hacker from doing nasty stuff to the site. So the 'impeding' garbage >>> designed to trip up hackers can get in the way of a legitimate >>> developer trying to create a helpful tool. So before you COMMIT to >>> being able to make the tool, you'll need to look at the site itself, >>> to see what all will get in your way. >>> >>> Trick #3: There are two ways to 'find' the objects you will need >>> your code to work with. The first is to just look at the HTML of the >>> page(s) you are going to manipulate. This is where some of those > 'impediments' >>> come into play. Some sites prevent you from right clicking on a page >>> and selecting 'View Source'. Ironically, this is just removing a >>> 'shortcut' way to view the HTML source behind a page. It doesn't >>> actually HIDE the source, because your browser is viewing the source, >>> it has too, otherwise it will have nothing to display. So there are >>> multiple ways to 'download' the HTML you can view yourself. Create >>> your own browser, and dump the HTML to a file. You can also use API >>> calls to just directly download the HTML, without a browser. If the >>> page is derived from internal (on the website server) variables, >>> you'll need to use your own browser to get there and download the >>> source. The second way to 'find' the objects you need to deal with >>> are with the object browser. Running your code in debug mode, you'll >>> be able to see the browser object, and all of it's child elements. >>> >>> Trick #4: Events and properties. Setting the value of a textbox, or >>> clicking a button, just requires that you know what the events and >>> properties of those objects are. I use the MSDN that came with the >>> developer edition of Office 2000. It's got a nice HTML guide with >>> common HTML form elements, their properties, methods, and events. >>> But all that information is also plastered all over the web. >>> >>> Trick #5: When a page loads, the browser object is there, but you >>> may not be able to capture 'download complete' events. What I have >>> done in these cases, where my code puts in data on a page, clicks a >>> button to go to the next page, I put my code in a loop, that sits and >>> waits for an object from the next page to exist. >>> >>> Of course, if there are applets, or flash media elements, required >>> for interaction... can't help ya there, haven't tackled one of those. >>> >>> Drew >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Friday, December 10, 2010 3:30 PM >>> To: VBA >>> Subject: [dba-VB] Web page manipulation >>> >>> My client has to go through a process where he clicks about 20 - 30 >>> things to manage to get a file downloaded. It sounded totally >>> convoluted but the question is (and I have asked this before without >>> a usable response) can I programmatically manipulate web pages to >>> cause specific pages to open, click buttons, input data into controls >>> etc. >>> >>> -- >>> 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 >>> >>> The information contained in this transmission is intended only for >>> the person or entity to which it is addressed and may contain II-VI >>> Proprietary and/or II-VI Business Sensitive material. If you are not >>> the intended recipient, please contact the sender immediately and >>> destroy the material in its entirety, whether electronic or hard >>> copy. >>> You are notified that any review, retransmission, copying, >>> disclosure, dissemination, or other use of, or taking of any action >>> in reliance upon this information by persons or entities other than >>> the intended recipient is prohibited. >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Dec 13 11:24:37 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 13 Dec 2010 18:24:37 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John How about LightSwitch: http://www.microsoft.com/visualstudio/en-us/lightswitch It is still in beta, I know, but given the modest requirements of these two apps ... /gustav >>> jwcolby at colbyconsulting.com 13-12-2010 17:57 >>> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com From davidmcafee at gmail.com Mon Dec 13 18:50:49 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 16:50:49 -0800 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: This time without the RTF Damn, keyboard. That was supposed to say "I use a click once app for our sales force" Here's a sub that calls a webservice and populates a table for a SSCE database: (but you could do what ever you want with your returned dataset) private void retrieveData(int intMode) { // This process will call a webservice passing a parameter which in turn executes a SQL stored procedure, returning a dataset try { // call webservice and populate dataset localhost.Service1 MyObj = new localhost.Service1(); DataSet ds; ds = MyObj.RetrieveSQLdata(intMode); // At this point, the dataset has already been filled by the web service SqlServerCe.SqlCeConnection CEconn; SqlServerCe.SqlCeCommand CEcmd; CEconn = new SqlServerCe.SqlCeConnection(("Data Source =" + (PathPC + FileName))); CEconn.Open(); CEcmd = new SqlServerCe.SqlCeCommand(); CEcmd.Connection = CEconn; // Delete the exisiting data from the iPAQ tables before populating it string TableName = ""; switch (intMode) { case 1: TableName = "PListHdr"; break; case 12: TableName = "PListItems"; break; } CEcmd.CommandText = ("DELETE " + TableName); CEcmd.ExecuteNonQuery(); this.lblStatus.Text = ("Retrieving " + (TableName + " data from SQL")); System.Windows.Forms.Application.DoEvents(); DataRow row; string mystr = ""; int RowCount = 0; foreach (row in ds.Tables[0].Rows) { mystr = ""; if ((intMode == 1)) { mystr = (mystr + "INSERT INTO PListHdr (PListID, PListDesc) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["PListDesc"].ToString + "\')"))); } else if ((intMode == 12)) { mystr = (mystr + "INSERT INTO PListItems (PListID, ItemNo, Price) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["ItemNo"].ToString + "\', "))); mystr = (mystr + (row["Price"].ToString + ")")); } CEcmd.CommandText = mystr; CEcmd.ExecuteNonQuery(); } this.lblStatus.Text = (TableName + " data retrieved from SQL"); System.Windows.Forms.Application.DoEvents(); CEcmd.Dispose(); CEconn.Close(); CEconn.Dispose(); } catch (Exception ex) { throw new Exception("updateCustMast() Failed"); } } This is how the sub is called from within my local/users' app: public void UpdatePListHdr() { if ((DoesTableExist("PListHdr") == true)) { if (this.chkRunInDebugMode.Checked) { MessageBox.Show("UpdatePListHdr()"); } this.lblStatus.Text = "Retrieving PListHdr data"; System.Windows.Forms.Application.DoEvents(); this.retrieveData(1); } } This is the web service call (you can replace the string mystr=(); line with your favorite dynamic SQL : [WebMethod()] public DataSet RetrieveSQLdata(int intMode) { SqlConnection conn; SqlDataAdapter da; DataSet ds; string mystr = ("EXEC stpRetrieveData \'" + (LoginUser + ("\', " + intMode))); conn = new SqlConnection(strConn); da = new SqlDataAdapter(mystr, conn); da.SelectCommand.Parameters.AddWithValue("@Mode", intMode); ds = new DataSet(); da.Fill(ds); return ds; conn.Close(); } so you can see, it is pretty simple if you are already making similar calls in C# From jwcolby at colbyconsulting.com Wed Dec 15 07:33:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 15 Dec 2010 08:33:48 -0500 Subject: [dba-VB] SSDS Message-ID: <4D08C3BC.7020900@colbyconsulting.com> I am trying to learn how to host data on my own servers, or on a web site that I contract for, and use a service to get that data. I thought that SSDS was the technology that allowed me to do that, but when I start viewing Microsoft's clinics, specifically clinic 6341, I am told I need to "register for, set up a user name" etc... IOW "We have a server in the cloud and sell you"... That is decidedly NOT what I want to do, simply because I have no budget for the "we sell you" part of that contract. Do we know whether SSDS allows me to host my own data and write services to access my own data hosted wherever I want to host that data? If so, where do I go to learn how to do this. I viewed a blog last night. specifically http://channel9.msdn.com/blogs/pdc2008/tl07 which was pretty cool. I have to say I am skeptical that it would work for high volume data transfers simply because of the overhead for each actual piece of data. However for working with databases in the traditional "fill in the tables and generate reports" it looks like a killer way to do business over the internet. I now have three different places (clients) where this would appear to solve my problems with remote users. Is anyone using this stuff to build applications that run on a client but add / edit / browse / report to a database "out there somewhere"? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 16 10:26:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 11:26:19 -0500 Subject: [dba-VB] Wrapper classes Message-ID: <4D0A3DAB.2030103@colbyconsulting.com> Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu Dec 16 12:28:09 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Dec 2010 21:28:09 +0300 Subject: [dba-VB] Wrapper classes In-Reply-To: <4D0A3DAB.2030103@colbyconsulting.com> References: <4D0A3DAB.2030103@colbyconsulting.com> Message-ID: <3976E26898A345C0AD1865DEB2146C8D@nant> Hi John -- You'd better keep your code within User Custom Control in a (User Custom Controls) class library. User Custom Controls can be nested or inherited - such a nesting/inheritance rarely gets deeper than three levels. And even more strong assertion is true - it never gets deeper than three levels in the projects of my customers, with one-two levels being the most common application cases. And in the case of two levels the upper level User Custom Control (dropped on WinForms) is usually used just as a container (nest) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 16 ??????? 2010 ?. 19:26 To: VBA Subject: [dba-VB] Wrapper classes Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 16 15:47:41 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 16:47:41 -0500 Subject: [dba-VB] WCF Message-ID: <4D0A88FD.3080409@colbyconsulting.com> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Dec 17 05:43:46 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 12:43:46 +0100 Subject: [dba-VB] WCF Message-ID: Hi John Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. Microsoft has some intro stuff as well: http://msdn.microsoft.com/en-us/library/gg132851.aspx I haven't worked with WCF for any practical project but would love to follow the thread. /gustav >>> jwcolby at colbyconsulting.com 16-12-2010 22:47 >>> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 08:20:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:20:17 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0B71A1.5040703@colbyconsulting.com> Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the internet using a client .Net > application. I have three different projects for three different clients all of which really need > to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) > chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has > done this and wants to start a discussion thread. > From jwcolby at colbyconsulting.com Fri Dec 17 08:25:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:25:52 -0500 Subject: [dba-VB] Why use a contract? Message-ID: <4D0B72F0.6010902@colbyconsulting.com> The WCF book I am reading discusses building interfaces / contracts. He uses the term interchangeably. Basically you set up a file that has just the variables and method signatures, and name it. Then you build an actual implementation class that implements the contract. I am the kind of person that likes to know the "why". I don't mind doing something but I find it useful to know the reasons for what I do. So what does the interface / contract do for us in the development process. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 09:13:53 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 10:13:53 -0500 Subject: [dba-VB] DAAB Message-ID: <4D0B7E31.1020902@colbyconsulting.com> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Dec 17 09:39:10 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 17 Dec 2010 10:39:10 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0B71A1.5040703@colbyconsulting.com> References: <4D0B71A1.5040703@colbyconsulting.com> Message-ID: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 17, 2010 9:20 AM To: Discussion concerning Visual Basic and related programming issues.; Access Developers discussion and problem solving Subject: Re: [dba-VB] WCF Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the > internet using a client .Net application. I have three different > projects for three different clients all of which really need to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many > acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd > see if anyone on the list has done this and wants to start a discussion thread. > _______________________________________________ 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 17 10:07:23 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 17:07:23 +0100 Subject: [dba-VB] DAAB Message-ID: Hi John It looks like that link is superseded by the Enterprise Library of which the newest version is found here: http://msdn.microsoft.com/en-us/library/ff632023.aspx I haven't used it. /gustav >>> jwcolby at colbyconsulting.com 17-12-2010 16:13 >>> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 10:23:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 11:23:17 -0500 Subject: [dba-VB] WCF In-Reply-To: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> References: <4D0B71A1.5040703@colbyconsulting.com> <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Message-ID: <4D0B8E75.5060201@colbyconsulting.com> Michael, Glad to have you. I am using VS 2008 Standard edition. I will probably go with SQL Server Express in order to allow each client to use their own database hosted wherever they need. My intention is to develop a client application in C#, and a service application in C#. The service application will talk to a database layer and through to SQL Server or MySQL. I will use WCF and services to talk from the client through the internet to the service application. I am so new to this that I am just talking generalities here. From what I am reading, this is the big picture of how it is done. The first chapter of John Sharp's book dives right in and I will be diving right in following along exactly, using his tools / database etc. Once I am able to do so I will bring up a parallel track of the volunteer database. I want to go with the C# client because I just don't like browser based applications. I don't like using them when I am forced to out on the internet, they just always feel clumsy. At this time my clients all use Windows, are all at least at Windows XP, and so can easily host a windows based application. IOW I do not need to run my client app on Linux or other non windows OS so why do browser based apps. I use VisualSVN / Tortoise for source control internal to my business. IIRC Gustav, Shamil and Mark Breen used this same combination for Source control but had the repository on the web. If you remember those guys did a rewrite of Microsoft's Tradewind Access demo database into C#. Back then I was not up to speed in C#. While I hesitate to say I am up to speed now, I am at least minimally functional in C# now, though this WCF thing is going to be a stretch. I will ask them if that repository is still up and whether we can use it. Source control is critical for a community project in order to be able to share the source code and not step on toes. This volunteer database is a real application and a real (non-paying) client (Prison Ministries) and I am using this as a learning tool to get to this paradigm, to be comfortable with this for future development of distributed applications. I may very well start to design even my internal app to use the services paradigm, if for no other reason that to get good at it and stay there. Anyway, that is what I am up to. I have committed to delivering an Access database to Prison Ministries by the first of the year. I am so fast in Access that doing so (for something this small) is doable, however I cannot see how to publish that application over the web in a manner that will stay useful and current and easy to maintain for the future. Not to mention my faith in the future of Access is not very high right now. Ergo C# / WCF services / SQL Server / MySQL. That would seem to be the future. John W. Colby www.ColbyConsulting.com On 12/17/2010 10:39 AM, Michael Mattys wrote: > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called > HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 10:22:32 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 11:22:32 -0500 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: <4D0CDFC8.1010001@colbyconsulting.com> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:16:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:16:09 -0500 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: <4D0CFA69.1050706@colbyconsulting.com> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 12:24:04 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 19:24:04 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Could this be your case: http://forums.asp.net/t/1290251.aspx /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 17:22 >>> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:24:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:24:15 -0500 Subject: [dba-VB] objectbuilder.dll is missing In-Reply-To: References: Message-ID: <4D0CFC4F.8070903@colbyconsulting.com> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? > From jwcolby at colbyconsulting.com Sat Dec 18 13:31:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 14:31:39 -0500 Subject: [dba-VB] And the beat goes on... Message-ID: <4D0D0C1B.8030907@colbyconsulting.com> http://thessdreview.com/latest-buzz/sandforce-firmware-update-confirmed-great-news-for-new-ssd-buyers/ -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 14:16:32 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:16:32 +0100 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: Hi John Not me. Never had the need for such "factories". It looks like very clever stuff. Thanks for the link - I'll certainly study it. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:16 >>> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx From gustav at cactus.dk Sat Dec 18 14:17:48 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:17:48 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Oh, but I haven't installed this myself, so I'm out of ideas. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:24 >>> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? From listmaster at databaseadvisors.com Sun Dec 19 13:08:22 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sun, 19 Dec 2010 14:08:22 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - Dec 2010 Message-ID: Good day everyone. I hope your Christmas preparations are going well. During the last few months the mail server has been having some problems. So over the Christmas holiday the mail server that all your favourite lists run on will be undergoing a complete upgrade right from the OS to the mail server to the mailing list software. This will mean that there will be some outages of the lists. This outage will most likely happen on Wednesday Dec 29, 2010 starting around 8am ET (1pm GMT). I will send out a notice approx. 30 minutes prior to the server going down. As well, once everything is back up and running, I will send out another notice. If you have any concerns, please let me know. I can be reached at listmaster at databaseadvisors.com or carbonnb at gmail.com. Thanks, Your humble list master Bryan -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From Gustav at cactus.dk Mon Dec 20 06:28:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 20 Dec 2010 13:28:21 +0100 Subject: [dba-VB] WCF Message-ID: Hi all The link for the book: http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 17-12-2010 16:39 >>> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com From jwcolby at colbyconsulting.com Mon Dec 20 06:57:16 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 07:57:16 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0F52AC.3050008@colbyconsulting.com> Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-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 20 12:11:50 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 13:11:50 -0500 Subject: [dba-VB] Multiple instances of SQl Server express Message-ID: <4D0F9C66.6000300@colbyconsulting.com> I have a client using Access BEs which I would like to move to SQL Server Express. The biggest issue in my mind is near term expansion. One reason we need to move is simply that we have already split the BEs a couple of times to keep the size reasonable. We have a BE at 850 MB, 750MB and 500 MB. These are just too big for Access IMHO. OTOH merging them all back into a single SQL Server express BE would result in a pretty large database (by Express standards), although it appears that they did increase the SSE 2008 limitation to 10 gigs. Is anyone using SS Express to try to run a small business - under 50 employees, ~25 users in the db most of the day? Any insights, gotchas, words of wisdom? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 09:07:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 10:07:17 -0500 Subject: [dba-VB] CAL aware software Message-ID: <4D10C2A5.8060007@colbyconsulting.com> I am trying to understand the CAL requirements of Microsoft's Windows 2008 Server and SQL Server 2008. The way I understand it, you buy CALs for each simultaneous connection. Server software gets rather expensive once you buy the software itself and then 30 or more CALs for the OS as well as for SQL Server. Do any of you spend time worrying about how to minimize the effect of the database on CAL utilization? For example do linked tables count differently than ado disconnected recordsets? Linked tables are connected from the time the person opens access to the time they close it as opposed to disconnected recordsets where a connection is made just long enough to get the data. Would the user be legally "connected" even though the application used disconnected recordsets? Any thoughts on how all this applies to CAL requirements. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 15:52:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 16:52:48 -0500 Subject: [dba-VB] Microsoft: Bringing Supercomputing To The Masses - Network Computing Message-ID: <4D1121B0.3020101@colbyconsulting.com> Need to model an atomic bomb? -- John W. Colby www.ColbyConsulting.com http://www.networkcomputing.com/cloud-computing/microsoft-bringing-supercomputing-to-the-masses.php From michael at mattysconsulting.com Tue Dec 21 22:27:19 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 21 Dec 2010 23:27:19 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0F52AC.3050008@colbyconsulting.com> References: <4D0F52AC.3050008@colbyconsulting.com> Message-ID: <923DD10436104846AC478F9A26AF2CC7@Gateway> I found that book needed correction and the following worked for me: My Service.svc contains: <%@ ServiceHost Language="C#" Debug="true" Service=" Products.ProductsServiceImpl" CodeBehind="~/App_Code/ProductsService.cs" %> My Web.config contains: Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 20, 2010 7:57 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] WCF Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:07:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:07:08 -0500 Subject: [dba-VB] wcf reading Message-ID: <4D12060C.3010905@colbyconsulting.com> ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Wed Dec 22 08:35:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 22 Dec 2010 09:35:51 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <4D12060C.3010905@colbyconsulting.com> References: <4D12060C.3010905@colbyconsulting.com> Message-ID: <7450A227F8B74909A4C32DE228083400@Gateway> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:38:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:38:20 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D120D5C.1090409@colbyconsulting.com> Ahhh... time to order up I guess. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:13:40 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:13:40 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi Michael So this link is for an outdated version: Windows Communication Foundation Step By Step by John Sharp 2007 http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 22-12-2010 15:35 >>> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. From jwcolby at colbyconsulting.com Wed Dec 22 09:26:12 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:26:12 -0500 Subject: [dba-VB] wcf reading In-Reply-To: References: Message-ID: <4D121894.2040209@colbyconsulting.com> That is for the book that I am reading. I bought it used awhile back, and it definitely is outdated - assuming that you have moved on from VS 2005 - which I have. AFAICT the underlying discussions still work, but the VS user interface has changed and very likely there are enhancements to WCF in .Net 4. I have been needing a reason to move up to VS 2010. I guess this is it. ;) John W. Colby www.ColbyConsulting.com On 12/22/2010 10:13 AM, Gustav Brock wrote: > Hi Michael > > So this link is for an outdated version: > > Windows Communication Foundation Step By Step > by John Sharp 2007 > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 22-12-2010 15:35>>> > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 From jwcolby at colbyconsulting.com Wed Dec 22 09:36:56 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:36:56 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D121B18.80604@colbyconsulting.com> I just ordered the latest from Amazon and it will be here in time for some light Christmas reading. ;) Now to install VS 2010. I actually need to learn this stuff. Up to this point all of my clients were location centric and everything happened over an internal network which lessened the need to go here. But services over the internet is the future. The nice thing about WCF is that you can do WWW and TCP endpoints in the same class which makes it possible to use the same system (and possible even application) for internal or external client applications. It is fascinating stuff and may allow me to get around needing to have share rights and the likes for everything. I do a lot of stuff like "save a CSV file to a shared directory", then have a program import the stuff into SQL server etc. As I create servers and stuff, setting up rights to shares is a pita. A service could get around all of that. Maybe. It's a brave new world. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:53:26 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:53:26 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi all This seems right! A 700+ pages monster book. Should keep you busy for the Christmas holiday. /gustav >>> "Michael Mattys" 22-12-2010 15:57 >>> Try here: http://www.free-ebooks-download.org/free-ebook/dotnet/Framework/windows-communication-foundation-4-step-by-step.php From jwcolby at colbyconsulting.com Thu Dec 23 10:22:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 23 Dec 2010 11:22:25 -0500 Subject: [dba-VB] OCZ's RevoDrive Preview: An Affordable PCIe SSD - AnandTech :: Your Source for Hardware Analysis and News Message-ID: <4D137741.1020907@colbyconsulting.com> http://www.anandtech.com/show/3788/oczs-revodrive-pcie-ssd-preview-an-affordable-pcie-ssd/8 http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&N=100008120%2050001550%20600038468&IsNodeId=1&name=PCI-E -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 24 11:11:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 24 Dec 2010 12:11:09 -0500 Subject: [dba-VB] VS 2010 user interface Message-ID: <4D14D42D.9000501@colbyconsulting.com> Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Fri Dec 24 11:21:21 2010 From: dbdoug at gmail.com (Doug Steele) Date: Fri, 24 Dec 2010 09:21:21 -0800 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: Well, John, once you've worked with Microsoft products for a couple of years, you'll get used to the idea that the interfaces change constantly. Always for the better, of course. They do test this stuff on thousands of users before releasing it. I think. Or not. Doug On Fri, Dec 24, 2010 at 9:11 AM, jwcolby wrote: > Note to self, never make abrupt and radical changes to the user experience. > > What a jarring experience opening VS 2010. Very likely the menus are > identical but the look and > feel of the opening screen is completely different. > > Why? > > Did the old start page not work? Is the new one miles ahead of / better > than the old? > > Or did we just need to be able to say we made it better? > > I don't know the answer but I know it is jarring. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Dec 24 16:11:00 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 25 Dec 2010 01:11:00 +0300 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: <8FF9D8E62966431780E6EF07937BD2E4@nant> Hi John -- >>> I don't know the answer but I know it is jarring. <<< Yes, the same feeling here. And it was easy to switch VS2003->VS2005->VS2008... Although I'd note they (MS) have completely reworked VS2010 IDE - it's written using Windows Presentation Foundation AFAIHH with many new IDE features therefore the current trouble to adapt to the new IDE isn't worth to worry about :) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 ??????? 2010 ?. 20:11 To: VBA Subject: [dba-VB] VS 2010 user interface Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 25 22:40:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 25 Dec 2010 23:40:17 -0500 Subject: [dba-VB] SQL Server Express version Message-ID: <4D16C731.4080203@colbyconsulting.com> I have SQL Server Express 10 on my laptop (dev machine). That appears to be 2005. I actually have the service there (not running) but I cannot seem to find it in the "programs and features". So how do I uninstall it in order to install the 2008 version? Or if I just do an install will it overwrite the old one? I suspect not. I just installed VS 2010 yesterday and kind of expected that it would install the latest express as part of its install but it does not seem to have done so. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Mon Dec 27 03:40:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 12:40:39 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: <5ADDFD61397040118F381468EF41A779@nant> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From gustav at cactus.dk Mon Dec 27 07:04:00 2010 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 27 Dec 2010 14:04:00 +0100 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From shamil at smsconsulting.spb.ru Mon Dec 27 07:53:36 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 16:53:36 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? In-Reply-To: References: Message-ID: <20053C1394F2453397A1D32185E51EF1@nant> Hi Gustav -- Sorry, that wasn't copy and paste part of code - original code compiled well. Anyway, I decided to not make it using dynamic approach because this approach creates additional layer of indirection/dynamics, which I should better avoid - it's not worth to introduce that indirection/complexity. 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: 27 ??????? 2010 ?. 16:04 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 27 21:13:40 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:13:40 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? Message-ID: <4D1955E4.5070504@colbyconsulting.com> I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 27 21:25:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:25:36 -0500 Subject: [dba-VB] You're gonna love this one Message-ID: <4D1958B0.2080602@colbyconsulting.com> http://www.johndcook.com/blog/2010/04/22/visual-studio-2010-is-a-pig/ 1.5 MILLION files? Hmm.... -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Mon Dec 27 21:40:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Mon, 27 Dec 2010 22:40:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <4D1955E4.5070504@colbyconsulting.com> References: <4D1955E4.5070504@colbyconsulting.com> Message-ID: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 27 22:12:51 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 23:12:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <4D1963C3.2@colbyconsulting.com> I will play with it more but VS 2008 worked fine for me, in fact I pretty much love it. I really only installed 2010 to do the WCF4 stuff. If I can run WCF 3.5 (or whatever) then I can afford to wait for MS to sort out the issues with VS 2010. I do real work with VS2008, and it works really well for what I am doing. My only complaints are that sometimes debug step is really slow. Sometimes not. Really strange. My Windows 2008 8 core machine is lightning fast for VS 2008 though, even debug stepping. Of course because it is X64 there is no edit and continue. Sigh. John W. Colby www.ColbyConsulting.com On 12/27/2010 10:40 PM, Michael Mattys wrote: > I have to agree with some of the comments there ... > the one that really puts a lump in my throat is "it will take decades to get > back to a 'Rapid Quality Application Development'" > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 27, 2010 10:14 PM > To: VBA > Subject: [dba-VB] Is VS 2010 extremely slow? > > I installed 2010 and it seems to be a dog! > > Anyone else with a similar experience? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 27 23:16:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 28 Dec 2010 00:16:08 -0500 Subject: [dba-VB] Adding an entity model Message-ID: <4D197298.9070806@colbyconsulting.com> The entity modeler does not like nullable FKs. IOW a location might / might not have an organization etc. Generates copious errors! Once I decided to go in and fix that, I had to delete the model and recreate in order to repair the "errors". Just telling it to go fetch the latest from the database did not fix the "errors". OTOH, deleting the entire model and rebuilding it did in fact get rid of all the errors. What a PITA. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Dec 28 07:44:13 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 16:44:13 +0300 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <3A19A89FC90248139C333B686AC14B69@nant> Hi All -- Yes, VS2010 looks slower than VS2008, and VS2010 is a "memory-hog" for sure but that's all I have found so far. Well, one other thing I have got VS2010 GPF-in while in design/IDE mode with "Out Of Memory" error message after about a day of working with it with about 10 projects in a solution. And I have had here on the same simple 2 core 2GB Win2003 PC three or four instances of VS2008 with many projects in every solution used without problems for days... Anyway I do suppose/hope MS should solve most of the issues in VS2010 because the issues AFAIU are mostly caused by the fact that MS developers have rewritten all/most of IDE using managed code (WPF), and solving memory leakage issues of managed code is a tough task but doable (memory leakage in managed code are mainly related to all kinds of "hooks"/delegates/event listeners and that ones can be "unhooked" after accurate code review - MS developers, I guess, simply didn't have enough time for that work because of VS2010 release schedule forced by MS marketing "army"...)... BTW, in that current context of VS2010 being "memory-hog" and slower than VS2008 it's a good time to start using Test Driven Development if you haven't yet started to use it.. Would be also great if MS will release VS2008 SP2 supporting C#4.0 and .NET Framework 4.0... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: 28 ??????? 2010 ?. 6:41 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Is VS 2010 extremely slow? I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- 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 shamil at smsconsulting.spb.ru Tue Dec 28 09:44:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 18:44:10 +0300 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From Gustav at cactus.dk Tue Dec 28 10:02:17 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 28 Dec 2010 17:02:17 +0100 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Tue Dec 28 13:03:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 22:03:25 +0300 Subject: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... In-Reply-To: References: Message-ID: <272AD233109B49728A5A39D959CAF68E@nant> Hi Gustav -- Yes, and with ASP.NET it even (a bit more) nasty: just changing reference to the newer version of Report Viewer Control 10.0 doesn't help. Some manual work is needed. A bit cryptic. And it starts working finally. Hint make new ASP.NET 4.0 Web Reporting project then compare web.config and .aspx files - and make manual editing... I will try to write more on that issue in coming days in I will have time... 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: 28 ??????? 2010 ?. 19:02 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) <<< snip >>> From listmaster at databaseadvisors.com Wed Dec 29 07:19:58 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Wed, 29 Dec 2010 08:19:58 -0500 Subject: [dba-VB] Administrivia - Server Upgrade Message-ID: Good morning folks, The server will be going down in half an hour, at approx 845 ET It will be down for approx 4-6 hours for a complete upgrade. I will send out another email, once we are all back up and running again. If you have any questions while the server is done, please get in touch with me at carbonnb at gmail.com -- Bryan Carbonnell - list master at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From listmaster at databaseadvisors.com Thu Dec 30 08:59:57 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 30 Dec 2010 09:59:57 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - UPDATE - Dec 30 @ 0955 Message-ID: Good Morning folks, I hope you didn't suffer too many withdrawals from not having your favourite lists yesterday and this morning. The Server upgrade was a challenge to say the least. A Royal PITA to say it closer to what it really was. There are still lots of things to work out, like putting the archives back online. Have no fear, your words of wisdom are being archived (for those lists that have archiving turned on), but the archives aren't available yet. The main goal was to get the lists back up and running, which it appears they are. If you encounter any abnormalities, please let me know ASAP so I can look into it. Things will slowly become normal again over the remainder of the week. Thanks for your patience. during the upgrade. -- Bryan Carbonnell - listmaster at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From shamil at smsconsulting.spb.ru Fri Dec 31 06:13:44 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 31 Dec 2010 15:13:44 +0300 Subject: [dba-VB] Ded Moroz sends you links on sample projects... :) Message-ID: <88C8330964FC47F7A753561E66B42346@nant> Hi All -- New Year Eve is approaching here, and I wanted to send you some gifts from Ded Moroz - here they are: This is a set of projects I have got developed a few days ago during 40+ hours R&D coding marathon. The task was to finish all the work in about 40 hours. So a few bugs left in there as release deadline wasn't possible to move. They (the bugs) are described in readme. But in general all the sample apps work rather well as my tests here show. I'd be interested to hear any comments - in what direction that sample should be better developed. Please write them here, or on http://northwind.codeplex.com . Please do not "judge severely" as as I noted that was very intensive R&D work with little time to think through while coding :) But feel free to comment it as you like. *Do not try* to be politcorrect. Please. I wish all of your Very Happy and Prosperous New Year! Thank you. -- Shamil P.S. Short description of published projects (the sources get downloaded 19 times already and I have got informed privately a couple of days ago just three people): NorthwindNET_4_0_Sources.zip (~24MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192044 NorthwindNET_4_0_SampleApps_Setup.zip (~5MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192043 Northwind.NET.VS2010.sln ======================== 1. Northwind.NET.EDM.FE - WinForms Front-End (just start-up class and app.config); 2. Northwind.NET.EDM.WinForms.Controls - UI UserControls; 3. Northwind.NET.EDM.Reports - MS ReportViewer 10.0 Reports; 4. Northwind.NET.BLL - Business Layer Library (ADO.NET EDM LINQ Reports' data sources); 5. Northwind.NET.Model - ADO.NET EDM; 6. Northwind.NET.Settings - application settings (wrappers); 7. Northwind.NET.Resources - application resource file; 8. Northwind.NET.Utilities - utility class library; 9. Northwind.NET.Testing.Console - some test functions - it's not true TDD - just a rough approximation; Northwind.NET.MSAccess.sln ========================== I. WinForms FE with MS Access backend Northwind.NET.FE.1.1 - Northwind.NET FE with MS Access backend Northwind.NET.Utilities - Utilities project II. ASP.NET sample application with MS Access backend E:/Projects/SMS/Northwind/Northwind.ASP.NET.MSAccess.Reporting/ - ASP.NET project III. Just a test ASP.NET app - can be removed E:\Projects\SMS\Northwind\Northwind.ASP.NET.MSAccess.Reporting.RDLC.10.0.0.0 Northwind.NET.zzz_OLD.sln ========================= 1. Northwind.NET.FE - WinForms Front-End with MS SQL backend using "plain old" ADO.NET data sets - the project we did last year's April. 2. All the other projects from as in Northwind.NET.VS2010.sln ----------- From jwcolby at colbyconsulting.com Fri Dec 31 20:56:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 31 Dec 2010 21:56:06 -0500 Subject: [dba-VB] Happy new year Message-ID: <4D1E97C6.3060000@colbyconsulting.com> To all our members around the world, may the new year be a good one. I am about to go down stairs and watch a movie with my wife, and ring in the new year with a glass of sparkling cider. If you party, do so with restraint. This is a particularly dangerous night to be out on the roads. Happy new year. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 1 00:20:26 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 09:20:26 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Message-ID: <97A3212846794197B97BAABCF7A3510D@nant> Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Dec 1 03:04:44 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 10:04:44 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView head Message-ID: Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 05:20:01 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 22:20:01 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001901cb9149$b20456a0$160d03e0$@com.au> Hi Shamil, I tried rdr.Dispose and still no luck. I don't think the datareader is the issue, it's the connection to the DB. I think the issue is not being able to set the value to nothing. Is there any way of setting the connection to nothing within a Using Statement? I appreciate your patience with me on this matter... Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 05:20:24 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 06:20:24 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001801cb910b$45a462e0$d0ed28a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> <001801cb910b$45a462e0$d0ed28a0$@com.au> Message-ID: <4CF62F78.5070000@colbyconsulting.com> Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > 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 1 05:25:15 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:25:15 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head In-Reply-To: References: Message-ID: <698BA6DF81FF4146B59F3F59A5BC1A64@nant> Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. 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: 1 ??????? 2010 ?. 12:05 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 05:49:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:49:53 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head References: Message-ID: <1EC85A575A1845A3B3D1F1352912CF74@nant> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil <<< snip >>> From Gustav at cactus.dk Wed Dec 1 06:24:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 13:24:03 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.itags.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7&hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/346e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil From actebs at actebs.com.au Wed Dec 1 07:16:38 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:16:38 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF62F78.5070000@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> Message-ID: <001a01cb9159$fc891430$f59b3c90$@com.au> Hi John, Wow! I'm just returning to application development after a 5 years absence. Destructor and Constructor classes are just a little out of my realm at the moment. I need to find a good resource that outlines classes use in VB.Net. Do you know of any? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 10:20 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 07:22:58 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:22:58 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001b01cb915a$df2502e0$9d6f08a0$@com.au> Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 07:45:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 08:45:06 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001a01cb9159$fc891430$f59b3c90$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> <001a01cb9159$fc891430$f59b3c90$@com.au> Message-ID: <4CF65162.6020403@colbyconsulting.com> Vlad, The destructor is not a class but (kind of) a method of the class. The destructor is called when the last reference to the class is set to null, just as the constructor is called in the new MyClass(). By creating a destructor, and placing an explicit call to all unmanaged object's Dispose() methods, the dispose of all such unmanaged objects gets called immediately as the last pointer is set to null. AFAICT (and I am no expert, so anyone else is free to jump in here) what really happens is that: 1) You create an instance to your class. 2) In your class you create a pointer to an unmanaged object such as a sql server connection. 3) You use your class 4) You do not explicitly call the dispose() of the connection but... 5) You set the last pointer to your class to null (or exit the block that defined your class)... Now... the instance of your class still sits in memory until the GC decides it needs the memory that your class takes up, but it may be quite some time before it does so. AFAICT when the GC actually gets around to disposing of the memory, it explicitly attempts to call Dispose() of any unmanaged object (ignoring errors if the unmanaged object does not have a dispose method) so *at that time* the unmanaged object is finally released. By your creating a destructor and explicitly calling the unmanaged object's dispose() method in the destructor, the unmanaged object is released at the instant the last pointer to the class is set to null (when the containing block is exited). Thus YOU decide the timing, rather than the GC deciding the timing. This was an issue to me because I was creating thousands of connections in a very short period of time. Because the GC decided I had lots of memory and it didn't need to take out the trash for long periods, I ran out of connections. By explicitly creating destructors in every class that created a connection, and explicitly calling the dispose() of the connection (unmanaged object) in the destructor, I explicitly released the connection at the instant that the class was destroyed rather than when the GC ran, and my problems went away. Or at least this is my understanding of the process. What I know is that my problems went away when I did this. It is a PITA to create the destructor and all the code to correctly manage it but once done you are gold (for that class). Just remember to place calls to dispose() in the destructor for all unmanaged objects. John W. Colby www.ColbyConsulting.com On 12/1/2010 8:16 AM, ACTEBS wrote: > Hi John, > > Wow! I'm just returning to application development after a 5 years absence. > Destructor and Constructor classes are just a little out of my realm at the > moment. > > I need to find a good resource that outlines classes use in VB.Net. Do you > know of any? > > Thanks > > Vlad From shamil at smsconsulting.spb.ru Wed Dec 1 08:39:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 17:39:51 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001b01cb915a$df2502e0$9d6f08a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au><97A3212846794197B97BAABCF7A3510D@nant> <001b01cb915a$df2502e0$9d6f08a0$@com.au> Message-ID: Hi Vlad -- Yes, that's OK to call .Dispose() on every iteration - you're disposing current instance. When you just create a new instance by using the same object variable previous instance isn't getting disposed: it's supposed to get disposed later by Garbage Collector (GC). I must note I have never used .Dispose() for OleDbCommand and all worked well - checked with memory profiler as I noted here about yesterday. But I didn't use OleDbCommand with parameters. In your case it could also be that you use parameters and you use OleDbDataReader instance reference to set parameter values. My (wild) guess is that VS uses some optimization while translating your code into IL, and that translation results in OleDbDataReader reference "captured" by OleDbCommand reader. Then you have many cycles of rdr.Read() and on every cycle a new instance of OleDbCommand is created, and a previous one is left hanging with OleDbDataReader instance referenced from parameters. Then GC doesn't work well/promptly somehow. If you write a function to get values from OleDbDatReader: private function getFieldValue(ByRef rdr as OleDbDataReader, ByVal fldName as string) as string return rdr(fldName).ToString() end function your issue might get solved "automagically". But that is just a guess. I'd also note that the way you set parameters doesn't look good enough from here - I mean internationalization issues, which may arise if you'll use you program with different formats of day/time. (My above function sample isn't good from internationalization point of view too). If you drop using parameterized OleDbCommand and return to plain dumb string.Format(....) to make Insert sql command text it would be easier to handle internationalization issues IMO, and also you can just create OleDbCommand once and then set its connection property before your While(rdr.read()) cycle, and set CommandText property on every iteration, and then calling .Dispose within every cycle will not be needed as you'll use the same OleDbCommand instance, and I suppose calling .Dispose for OleDbCommand after End While will not be needed at all... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 16:23 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 09:00:47 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 18:00:47 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <93125E633C84416C87A4A89117ADED7C@nant> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Wed Dec 1 16:28:18 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 23:28:18 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav From shamil at smsconsulting.spb.ru Wed Dec 1 16:58:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 01:58:21 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <00263D45306144F1AB39894F91360A4E@nant> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 04:27:10 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 11:27:10 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From shamil at smsconsulting.spb.ru Thu Dec 2 06:22:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 15:22:18 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <97D4BD40E52F4C43AC4CA44AEC90560E@nant> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 07:56:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 14:56:47 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil That sounds like a good approach. I just wondered because the option to build custom controls is promoted quite a lot. /gustav >>> shamil at smsconsulting.spb.ru 02-12-2010 13:22 >>> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From jwcolby at colbyconsulting.com Thu Dec 2 09:06:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 02 Dec 2010 10:06:57 -0500 Subject: [dba-VB] How to - Test environment Message-ID: <4CF7B611.7090706@colbyconsulting.com> I am trying to figure out how to do a test environment for C# development. I have a SQL Server with a bunch of application specific databases. We are developing a custom C# application to drive this business. My problem is that ATM I cannot run the program while my developer is working on the application because we are operating out of the same database. Due to the size of the database and my finances, cloning it on a dev environment server is not feasible. This means I need a software solution. My solution as of this morning is to add a field to the supervisor table that is either null (default) or holds a machine name string. By adding a couple of controls in the application I can fill in this field with a machine name when a "test" check box is set in the interface form and we add a record to that table. Then when anyone runs the program, the code checks for the test checkbox and only pulls records for that machine if the check box is set. This seems rather kludgy. If anyone has addressed this, please let me know how you are doing it. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:14:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:14:30 -0500 Subject: [dba-VB] Thread safe list Message-ID: <4CF8ED36.8070906@colbyconsulting.com> I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 3 07:40:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 16:40:21 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8ED36.8070906@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com> Message-ID: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Hi John -- I do use a dedicated static object instance to lock shared lists, dictionaries, ... (obviously psuedocode) Dictionary<> Dict; private static object _dictLocker = new object(); public void AddObjToList(obj) { lock(_dictLocker) { Dict.Add(); } } private GetObjFromList() { lock(_dictLocker) { Obj = Dict[0]; } Continue processing Obj here... } Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:15 To: VBA Subject: [dba-VB] Thread safe list I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 07:41:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:41:55 -0500 Subject: [dba-VB] C# and .Net 4.0 Message-ID: <4CF8F3A3.4050806@colbyconsulting.com> Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:57:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:57:06 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> References: <4CF8ED36.8070906@colbyconsulting.com> <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Message-ID: <4CF8F732.3010703@colbyconsulting.com> OK, two questions: 1) Does it have to be static? 2) My "GetObjFromList" actually uses a foreach(). It seems that is not going to work so well... Basically all of the work is done inside of that ForEach which would block the thread placing objects onto the list for long periods. Is it possible to somehow use ForEach and lock of the object being iterated or am I going to have to move to a do loop construct where I lock / grab an object / process? John W. Colby www.ColbyConsulting.com On 12/3/2010 8:40 AM, Shamil Salakhetdinov wrote: > Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places objects onto > a list for processing. > Another gets pointers to objects on the list for processing, and later > removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some sort > since a simultaneous write by one thread while reading by the other will > cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no clear > example of two different methods actually locking / unlocking the collection > object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place an > object onto the list. I have another (private) method called by the class > to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] C# and .Net 4.0 In-Reply-To: <4CF8F3A3.4050806@colbyconsulting.com> References: <4CF8F3A3.4050806@colbyconsulting.com> Message-ID: John -- As far as I see you can't create .NET Framework 4.0 projects in VS2008. :( Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:42 To: VBA Subject: [dba-VB] C# and .Net 4.0 Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8F732.3010703@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> Message-ID: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Hi John -- 1. Yes, static. Object ref isn't thread-safe AFAIU. 2. Yes, foreach isn't good. You can use int count = getCount(); // getCount should use locking for (int i=0; i Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places > objects onto a list for processing. > Another gets pointers to objects on the list for processing, and > later removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some > sort since a simultaneous write by one thread while reading by the > other will cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no > clear example of two different methods actually locking / unlocking > the collection object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place > an object onto the list. I have another (private) method called by > the class to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 13:39:03 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 14:39:03 -0500 Subject: [dba-VB] PGP Message-ID: <4CF94757.1070005@colbyconsulting.com> Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 14:15:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 15:15:43 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Message-ID: <4CF94FEF.8010902@colbyconsulting.com> I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking > for (int i=0; i { > MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, which will > be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that advanced > stuff... > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Dec 3 14:25:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 23:25:58 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF94FEF.8010902@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com><7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> <4CF94FEF.8010902@colbyconsulting.com> Message-ID: <2CAA780B74744345B7B244545399626D@nant> John -- <<< I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? >>> Yes. You can serialize/deserialize whole collections. No need to program imperatively such serialization/deserialization usually. Just Xml attributes and tiny generic serialize/deserialize methods will do all the tricks. It would be lighting fast for your collections having under hundred objects. Folks tend to use JSON for serialization/deserialization these days. But I haven't used it yet. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 23:16 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Thread safe list I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking for (int i=0; > i MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, > which will be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that > advanced stuff... > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 18:45:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 03:45:54 +0300 Subject: [dba-VB] Observations on VS2008 - not good but having simple workarounds ... Message-ID: Hi All -- Just echoing Mark Simms' thread from AccessD ("Observations on AC 2007) :) - here is one of VS2008 "glitches": http://sms-web.biz/ss/nierr.jpg I mean that cryptic and with a cut ending part error message which you can see on the above screenshot reported by VS2008 while in design mode. The only solution to this issue was to quit & start VS2008 again - and it worked fine. That happens with VS2008, it can also GPF once in a while etc. So, when you get stuck with such VS2008 issues try to "Clean All" followed by "Rebuild All" - if that would not help then just restart VS2008 - in 90% of cases that "simple trick" helps... Thank you. -- Shamil From stuart at lexacorp.com.pg Fri Dec 3 23:43:46 2010 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 04 Dec 2010 16:43:46 +1100 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CF9D512.22578.1E2F04EE@stuart.lexacorp.com.pg> http://www.gnupg.org/ The GNU Privacy Guard GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. Version 2 of GnuPG also provides support for S/MIME. GnuPG is Free Software (meaning that it respects your freedom). It can be freely used, modified and distributed under the terms of the GNU General Public License . GnuPG comes in two flavours: 1.4.11 is the well known and portable standalone version, whereas 2.0.16 is the enhanced and somewhat harder to build version. Project Gpg4win provides a Windows version of GnuPG. It is nicely integrated into an installer and features several frontends as well as (German) manuals. -- Stuart On 3 Dec 2010 at 14:39, jwcolby wrote: > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Dec 4 06:38:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 15:38:52 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: Hi John -- If the task is to just use cryptography to encrypt/decrypt data sent via Internet then you can use .NET built-in advanced cryptography classes/algorithms: http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec tionID=60 http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 5053700AM/CryptographyInDotNET.aspx http://www.codeproject.com/KB/security/dotnetcryptog.aspx Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 22:39 To: VBA Subject: [dba-VB] PGP Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 10:43:07 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 11:43:07 -0500 Subject: [dba-VB] PGP In-Reply-To: References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CFA6F9B.5000804@colbyconsulting.com> PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent via > Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > 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 shamil at smsconsulting.spb.ru Sat Dec 4 11:46:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 20:46:46 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CFA6F9B.5000804@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> <4CFA6F9B.5000804@colbyconsulting.com> Message-ID: John -- PGP uses IDEA algorithm by default they say here: http://stackoverflow.com/questions/3321174/what-algorithm-does-pgp-use-to-en crypt-the-private-key-using-the-passphrase Try to google it for C# implementation: http://www.google.ru/#hl=ru&&sa=X&ei=R336TK3pAoXsOdzE4NQK&sqi=2&ved=0CC4QBSg A&q=C%23+IDEA+algorithm+implementation&spell=1&fp=eb9a0cff6abb8ea8 If that will not work then it should not be a big issue to wrap a free command line PGP (GNU?) utility into a C# class library simple API activating such utility and collecting its results... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 4 ??????? 2010 ?. 19:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] PGP PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent > via Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1& > SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1 > 128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 16:26:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 17:26:43 -0500 Subject: [dba-VB] use a font in a class Message-ID: <4CFAC023.7010905@colbyconsulting.com> I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:52:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:52:18 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: Hi John -- What is that for: Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ? Note that you have new Font(Font, ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:55:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:55:34 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> John -- You can use: Font font = new Font(this.Font, FontStyle.Bold); Ignore my prev. posting in this thread. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 17:25:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:25:25 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <4CFACDE5.2000003@colbyconsulting.com> Yes, to set the font for a specific column. > Note that you have > new Font(Font, Yes, I know. I didn't write the code, but if I try to mod that part (for ecample lowercase the first letter) it won't compile. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:52 PM, Shamil Salakhetdinov wrote: > Hi John -- > > What is that for: > > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > > ? > > Note that you have > > new Font(Font, ... > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Dec 4 17:27:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:27:30 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> References: <4CFAC023.7010905@colbyconsulting.com> <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> Message-ID: <4CFACE62.8040608@colbyconsulting.com> Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 4 17:46:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 02:46:51 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFACE62.8040608@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: But you can pass form's Font instance to your class as a parameter, dont' you?... Or you can create a Font instance in your class, don't you? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 2:28 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff > into the list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, > bold); //status text > } > > Now I want to wrap the list and this code in a class so that I do not > have to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) > that Font reference only works in a form. > > Is there any way other than passing the font in to this method to us > the code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 19:25:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 20:25:19 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: <4CFAE9FF.4030403@colbyconsulting.com> > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, "this" is > the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:39:07 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:39:07 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAE9FF.4030403@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> Message-ID: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> John -- Did you try it like that?: //----------------------------------------- using System.Drawing; ... Font font = new Font("Arial", 3.1f); System.Console.WriteLine("{0}", font); // the above line will output: //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] //----------------------------------------- with System.Windows.Forms and System.Drawing references set? It works here in console app or class lib. I have used something like that many times... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 4:25 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, > "this" is the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 20:42:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 21:42:39 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> <71FC24F2CFA54A19AD4CCB53DA53917C@nant> Message-ID: <4CFAFC1F.70709@colbyconsulting.com> No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); > // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in a > class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >>> bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do not >>> have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:56:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:56:54 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAFC1F.70709@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com><71FC24F2CFA54A19AD4CCB53DA53917C@nant> <4CFAFC1F.70709@colbyconsulting.com> Message-ID: <66F2AA795DF244B1AC1EE7E74A3BBB0E@nant> Try it, it will make the "trick". Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 5:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, > GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in > a class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, >>> Color.White, bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do >>> not have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 23:55:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 00:55:25 -0500 Subject: [dba-VB] Blocking Message-ID: <4CFB294D.8040709@colbyconsulting.com> I have a trick new status listview and wrapper class to hold the delegates and all of the code for manipulating the status listview. It is all working fine. I added a new method of the wrapper class to call the ListView.Clear to clear out the list view. When I call that from the form's thread immediately before my process starts (the thread from the process ends up writing to that ListView through a delegate) it appears that I get a deadlock of some kind. The listview goes funny looking and the application hangs. If I comment out the call to the clear, everything works fine. I need to clear the listview before each run though so I need to make this work. I am not sure how to get the clear working. Any ideas? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Dec 5 12:43:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 13:43:06 -0500 Subject: [dba-VB] Tough to track down bug (in VS?) Message-ID: <4CFBDD3A.4050705@colbyconsulting.com> I ended up with a list view with a column named DateTime. The .Net framework has a DateTime object. As soon as I dropped a copy of this list view on a form that had the .Net DateTime object in its code, the project had build errors. VS decided that the DateTime object (DateTime.now anyone?) that was already in my code was magically a column object, which dies not have a .Now property. Lesson (which everyone already knows): Never name your objects using keywords from the language. As soon as I renamed my column to Date_Time, VS went through the code in that form and renamed the DateTime objects out in code to Date_Time as well. Once I found and fixed *those*, voila, my code compiled again. That one had me going for quite awhile. I knew it had something to do with that listview because dropping that on the form was the last thing I did before the compile error popped up, but tracking down the exact cause was tough! -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Mon Dec 6 04:20:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 11:20:03 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From shamil at smsconsulting.spb.ru Mon Dec 6 04:29:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 13:29:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Mon Dec 6 05:15:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 12:15:21 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From marklbreen at gmail.com Mon Dec 6 06:03:18 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 6 Dec 2010 12:03:18 +0000 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <58D794B0B29E4F709D49D46577A5B050@nant> Thank you, Mark. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 6 ??????? 2010 ?. 15:03 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Thank you, Gustav, -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ??????? 2010 ?. 14:15 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Silverlight 5 in 2011 Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From ha at phulse.com Mon Dec 6 07:26:47 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Mon, 6 Dec 2010 05:26:47 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:44:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:44:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Hans-Christian -- I suppose that "rumors about that Silverlight is dead are greatly exaggerated" :) I do not intend to start a "religious war" here iPhone, IPad, ... vs. Windows 7 Phone but I'd expect MS will make it this time as they did it many times before - they will get at least 50%(I'd bet) of the mobile/smart phones installed OSes market sooner or later... I can be wrong of course. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Hans-Christian Andersen Sent: 6 ??????? 2010 ?. 16:27 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > From accessd at shaw.ca Mon Dec 6 12:02:01 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 6 Dec 2010 10:02:01 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <811DDCCD3842473E8DB5C7AEF52DDB2B@creativesystemdesigns.com> Gustav: Have you heard what percentage of computers are now using or have it installed it on their computers? It seems Silverlight is competing with Flash and HTML5 and both these products which seem very well established and run on all platforms. Here is an ASP.Net programmer's 10 recommended supporting applications for development work: http://stephenwalther.com/blog/archive/2010/11/22/10-essential-tools-for-bui lding-asp-net-websites.aspx Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, December 06, 2010 2:20 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Tue Dec 7 21:18:32 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 8 Dec 2010 14:18:32 +1100 Subject: [dba-VB] Type Is Not Defined Message-ID: <000101cb9686$9805c490$c8114db0$@com.au> Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad From michael at ddisolutions.com.au Wed Dec 8 16:22:20 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 09:22:20 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 From actebs at actebs.com.au Wed Dec 8 20:56:51 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 13:56:51 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> Message-ID: <000601cb974c$bac8c6a0$305a53e0$@com.au> Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Dec 8 21:23:27 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 14:23:27 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 From actebs at actebs.com.au Wed Dec 8 21:58:25 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 14:58:25 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au><000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <000701cb9755$54841df0$fd8c59d0$@com.au> Now that's funny! Yep in Canberra and it's just stopped raining! Over 100mm overnight and everything is under water. Luckily we haven't been affected, but a lot of people around Canberra are struggling... Where are you located? Have you been affected by the rains? I've got the Crystal Report to work with some mucking around, but once I've gotten the hang of it, it seems OK. When you say huge assemblies to move around, aren't they just part of the .Net Framework or are there additional files to be included in the install package? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 2:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 8 22:05:47 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 08 Dec 2010 23:05:47 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <4D00559B.6050008@colbyconsulting.com> I love .Net. Someday I will be good enough to whip out .Net apps like I can whip out Access apps. ;) John W. Colby www.ColbyConsulting.com On 12/8/2010 10:23 PM, Michael Maddison wrote: > Lol, > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb > > > > It used to be like pulling teeth to get it to work right. Had to write > heaps of code to make them portable IIRC. > > Huge assemblies to move around and keep up to date. > > I haven't used it for years, I just use MS builtin reports now. > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > BTW you're in Canberra aren't you? > > Keeping dry? > > > > Cheers > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Thursday, 9 December 2010 1:57 PM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] Type Is Not Defined > > > > Hi Michael, > > Thanks for your reply. I got to the bottom of it eventually. I needed to > make a data table schema of what I wanted returned from the DB. After I > did > that, everything worked as expected. > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > why > wouldn't you use that as a basis for learning how to use classes? > > Thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > Maddison > Sent: Thursday, 9 December 2010 9:22 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Type Is Not Defined > > The compiler cant find 'CustomerDataSetSchema'. > > Is it in another project? Set a ref to the project. > > If you don't have the class then you need to get it and it needs to be > in the scope of the calling class, the tutorial should have it. > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > tutorial! > > > > Cheers > > > > Michael > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Wednesday, 8 December 2010 2:19 PM > To: 'dba-vb' > Subject: [dba-VB] Type Is Not Defined > > > > Hi Everyone, > > > > This is my first attempt at a class, so don't laugh. I am doing this via > a > tutorial, and keep getting: > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > I can't understand why this is throwing this error and hope someone can > shed > some light on it. The code is below: > > > > Imports System.Data > > Imports System.Data.OleDb > > > > Public Class DataSetConfiguration > > 'Private Const CONNECTION_STRING As String = > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb" > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > Private Const DATATABLE_NAME As String = "tblMainData" > > 'Bloew is for use within a website > > 'Private Const DIRECTORY_FILE_PATH As String = > "C:\WebSites\VB_Web_Data_DataSets\" > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > Get > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > Dim myOleDbConnection As OleDbConnection = New > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > Return myDataSet > > > > End Get > > End Property > > > > End Class > > > > Many Thanks > > > > Vlad > > > > > > > > > > > > _______________________________________________ > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > _______________________________________________ > 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 Thu Dec 9 03:14:09 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 09:14:09 +0000 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <4D00559B.6050008@colbyconsulting.com> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/8/2010 10:23 PM, Michael Maddison wrote: > > Lol, > > > > > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb > > > > > > > > It used to be like pulling teeth to get it to work right. Had to write > > heaps of code to make them portable IIRC. > > > > Huge assemblies to move around and keep up to date. > > > > I haven't used it for years, I just use MS builtin reports now. > > > > > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > > > > > BTW you're in Canberra aren't you? > > > > Keeping dry? > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Thursday, 9 December 2010 1:57 PM > > To: 'Discussion concerning Visual Basic and related programming issues.' > > Subject: Re: [dba-VB] Type Is Not Defined > > > > > > > > Hi Michael, > > > > Thanks for your reply. I got to the bottom of it eventually. I needed to > > make a data table schema of what I wanted returned from the DB. After I > > did > > that, everything worked as expected. > > > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > > why > > wouldn't you use that as a basis for learning how to use classes? > > > > Thanks... > > > > Vlad > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > > Maddison > > Sent: Thursday, 9 December 2010 9:22 AM > > To: Discussion concerning Visual Basic and related programming issues. > > Subject: Re: [dba-VB] Type Is Not Defined > > > > The compiler cant find 'CustomerDataSetSchema'. > > > > Is it in another project? Set a ref to the project. > > > > If you don't have the class then you need to get it and it needs to be > > in the scope of the calling class, the tutorial should have it. > > > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > > tutorial! > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Wednesday, 8 December 2010 2:19 PM > > To: 'dba-vb' > > Subject: [dba-VB] Type Is Not Defined > > > > > > > > Hi Everyone, > > > > > > > > This is my first attempt at a class, so don't laugh. I am doing this via > > a > > tutorial, and keep getting: > > > > > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > > > > > I can't understand why this is throwing this error and hope someone can > > shed > > some light on it. The code is below: > > > > > > > > Imports System.Data > > > > Imports System.Data.OleDb > > > > > > > > Public Class DataSetConfiguration > > > > 'Private Const CONNECTION_STRING As String = > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > > Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb" > > > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > > > Private Const DATATABLE_NAME As String = "tblMainData" > > > > 'Bloew is for use within a website > > > > 'Private Const DIRECTORY_FILE_PATH As String = > > "C:\WebSites\VB_Web_Data_DataSets\" > > > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > > > Get > > > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > > > Dim myOleDbConnection As OleDbConnection = New > > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > > > Return myDataSet > > > > > > > > End Get > > > > End Property > > > > > > > > End Class > > > > > > > > Many Thanks > > > > > > > > Vlad > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Thu Dec 9 04:36:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 09 Dec 2010 11:36:47 +0100 Subject: [dba-VB] Type Is Not Defined Message-ID: Hi Mark Love SQL Server? Not me. Like John I prefer to spend time with VS and .Net. /gustav >>> marklbreen at gmail.com 09-12-2010 10:14 >>> Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 9 05:17:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 06:17:48 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: <4D00BADC.4040301@colbyconsulting.com> Mark, I am a programmer at heart and .Net and C# gives me programming power like I have never had before. I love SQL Server for it's ability to give me big iron database engine capabilities, but I do not spend time in it, I just use it. I have never learned how to debug code in SQL Server the way I can in VS, so basically I write in C# and just drive SQL Server with my C# code. John W. Colby www.ColbyConsulting.com On 12/9/2010 4:14 AM, Mark Breen wrote: > Hey John, > > Just curious, would you say you love SQL Server also? > > I suppose if I love software of any kind, it has to be SQL server. > > Mark > > > > On 9 December 2010 04:05, jwcolby wrote: > >> I love .Net. Someday I will be good enough to whip out .Net apps like I >> can whip out Access apps. ;) >> >> John W. Colby >> www.ColbyConsulting.com From actebs at actebs.com.au Thu Dec 9 06:16:04 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 23:16:04 +1100 Subject: [dba-VB] VB.Net and Microsoft Report Viewer Message-ID: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad From shamil at smsconsulting.spb.ru Thu Dec 9 09:27:59 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 9 Dec 2010 18:27:59 +0300 Subject: [dba-VB] VB.Net and Microsoft Report Viewer In-Reply-To: <000801cb979a$d9b24d90$8d16e8b0$@com.au> References: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Message-ID: <33A5DC6AE6554B2EAF023160C2225706@nant> Hi Vlad -- <<< I would check out the Microsoft Report Viewer. Can anyone show me an example of how to achieve this please? >>> Welcome to http://northwind.codeplex.com/ ! <<< the issues distributing your app using the Crystal Report Viewer >>> That usually works well - you just need to install CRV runtime... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 9 ??????? 2010 ?. 15:16 To: 'dba-vb' Subject: [dba-VB] VB.Net and Microsoft Report Viewer Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:30:04 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:30:04 -0500 Subject: [dba-VB] Snippet editor Message-ID: <4D01121C.2010806@colbyconsulting.com> Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Thu Dec 9 11:33:50 2010 From: df.waters at comcast.net (Dan Waters) Date: Thu, 9 Dec 2010 11:33:50 -0600 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01121C.2010806@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> Message-ID: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> I did a search on 'visual studio snippets tutorial' and got lots of hits. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 09, 2010 11:30 AM To: VBA Subject: [dba-VB] Snippet editor Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:53:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:53:33 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> Message-ID: <4D01179D.5000003@colbyconsulting.com> As did I all about hand editing xml files. YUK! I thought perhaps someone on this list was using an actual snippet editor that integrated into SQL Server and allowed me to edit the snippet directly. John W. Colby www.ColbyConsulting.com On 12/9/2010 12:33 PM, Dan Waters wrote: > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 09, 2010 11:30 AM > To: VBA > Subject: [dba-VB] Snippet editor > > Does anyone know of one that is easy to use and integrated in VS? > From marklbreen at gmail.com Thu Dec 9 14:42:41 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 20:42:41 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01179D.5000003@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> Message-ID: Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet editor > that integrated into SQL > Server and allowed me to edit the snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > 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 9 15:42:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 00:42:39 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com> Message-ID: <19ACDAEBEACD47DB894BE71AFD067417@nant> Hi Mark -- <<< I struggle now when I am on a box that does not have it installed. >>> One of the best memory trainings is to study and to master SQL syntax hand typing from one own "memory cells", no Intellisense help of any kind provided:) I know, I know... lazy MS Access developers, spoiled by QBE (myself included) are rarely able to type lengthy SQL expressions from their own memory... :) 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: 9 ??????? 2010 ?. 23:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet > editor that integrated into SQL Server and allowed me to edit the > snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Fri Dec 10 03:25:42 2010 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 10 Dec 2010 09:25:42 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <19ACDAEBEACD47DB894BE71AFD067417@nant> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Dec 10 05:11:27 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 06:11:27 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: <4D020ADF.3080502@colbyconsulting.com> Yea, it is common. Who did you say you are? John W. Colby www.ColbyConsulting.com On 12/10/2010 4:25 AM, Mark Breen wrote: > Hi Shamil, > > Speaking of memory, > > I am 41 and I notice in the last 12 - 24 months that I no longer have the > memory I had when I was in my 20s and 30s. I am told by a few people that > it is rather common, but I still hate this lack of feeling sharp - does > anyone else recognise this. Is it common as a few friends have said? IOW > am I just getting old? > > Mark > > > > On 9 December 2010 21:42, Shamil Salakhetdinov > wrote: > >> >> Hi Mark -- >> >> <<< >> I struggle now when I am on a box that does not have it installed. >>>>> >> One of the best memory trainings is to study and to master SQL syntax hand >> typing from one own "memory cells", no Intellisense help of any kind >> provided:) >> I know, I know... lazy MS Access developers, spoiled by QBE (myself >> included) are rarely able to type lengthy SQL expressions from their own >> memory... >> >> :) >> >> 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: 9 ??????? 2010 ?. 23:43 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] Snippet editor >> >> Hello John, >> >> I use SQL Promot by redgate and find it extremely useful, so much so, I >> struggle now when I am on a box that does not have it installed. >> >> thanks >> >> Mark >> >> >> On 9 December 2010 17:53, jwcolby wrote: >> >>> As did I all about hand editing xml files. >>> >>> YUK! >>> >>> I thought perhaps someone on this list was using an actual snippet >>> editor that integrated into SQL Server and allowed me to edit the >>> snippet directly. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 12/9/2010 12:33 PM, Dan Waters wrote: >>>> I did a search on 'visual studio snippets tutorial' and got lots of >> hits. >>>> >>>> Dan >>>> >>>> -----Original Message----- >>>> From: dba-vb-bounces at databaseadvisors.com >>>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>>> Sent: Thursday, December 09, 2010 11:30 AM >>>> To: VBA >>>> Subject: [dba-VB] Snippet editor >>>> >>>> Does anyone know of one that is easy to use and integrated in VS? >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Fri Dec 10 08:43:08 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 10 Dec 2010 06:43:08 -0800 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark: This is why we have computers...fills in those little gaps. (Spoken from a man over 60.) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, December 10, 2010 1:26 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 08:56:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 09:56:15 -0500 Subject: [dba-VB] how do i get coderush back Message-ID: <4D023F8F.40804@colbyconsulting.com> I have coderush on my computer, and I see it working in the little lines that show the program structure, but I do not have the code rush menu or toolbar. Any idea how to get those back? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 10 09:06:23 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 18:06:23 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com><19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark -- <<< I am 41... am I just getting old? >>> Not old but older. When you turned your 40 you've got to the "mature people club". Welcome to the Club! :) 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: 10 ??????? 2010 ?. 12:26 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax > hand typing from one own "memory cells", no Intellisense help of any > kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their > own memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, > I struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots > > > of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 15:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:30:11 -0500 Subject: [dba-VB] Web page manipulation Message-ID: <4D029BE3.1070407@colbyconsulting.com> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Dec 10 15:33:49 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:33:49 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Yes. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Dec 10 15:44:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:44:30 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D029F3E.5080401@colbyconsulting.com> You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > From DWUTKA at Marlow.com Fri Dec 10 15:54:01 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:54:01 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029F3E.5080401@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: No. You asked if you can programmatically manipulate web pages to cause specific pages to open, etc. The answer is yes. You didn't ask how to do it! LOL I have done a few projects that do this. The 'how' is both simple, complicated, easy, and a complete PITA. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:45 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From davidmcafee at gmail.com Fri Dec 10 16:16:29 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:16:29 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: If you know the final link to the file in question you can use that. That's what I do with some of the click once stuff for prerequisites. On Fri, Dec 10, 2010 at 1:54 PM, Drew Wutka wrote: > No. You asked if you can programmatically manipulate web pages to cause > specific pages to open, etc. The answer is yes. You didn't ask how to > do it! LOL > > I have done a few projects that do this. The 'how' is both simple, > complicated, easy, and a complete PITA. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:45 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > You must be a Microsoft employee eh? ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/10/2010 4:33 PM, Drew Wutka wrote: > > Yes. > > > > Drew > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Friday, December 10, 2010 3:30 PM > > To: VBA > > Subject: [dba-VB] Web page manipulation > > > > My client has to go through a process where he clicks about 20 - 30 > > things to manage to get a file > > downloaded. It sounded totally convoluted but the question is (and I > > have asked this before without > > a usable response) can I programmatically manipulate web pages to > cause > > specific pages to open, > > click buttons, input data into controls etc. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 10 16:28:43 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 10 Dec 2010 23:28:43 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John It is. I even think I posted a code snippet in C# I ran with success when you asked for this the first time. The trick these days is to find out which Java Script functions and parameters are called for navigating the pages and submit data. I used FireFox and an HTTP add-in debugger and/or Google Chrome and its debug feature for this. Be prepared for some "fun" hours and start with testing your code towards a simple site. /gustav >>> jwcolby at colbyconsulting.com 10-12-2010 22:30 >>> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From davidmcafee at gmail.com Fri Dec 10 16:24:08 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:24:08 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: Message-ID: not to mention when they make changes to their site. On Fri, Dec 10, 2010 at 2:28 PM, Gustav Brock wrote: > > Be prepared for some "fun" hours and start with testing your code towards a > simple site. > > /gustav > > From DWUTKA at Marlow.com Fri Dec 10 16:33:05 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 16:33:05 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Now for a little more info for you. Yes, you can certainly do this. Technically, it's not much different than if someone handed you an .mde, and asked you to automate tasks in the mde (so you couldn't tweak the source code running the program itself, but you could open the mde with VBA, and use the objects within it just like you'd use the objects in your own application.) Trick #1: Just like with an .mde, you have to have a reference to the database itself, so with a browser, you need a reference to it. You can either programmatically open a browser window (so you'll both create the object, and have a reference to it), or you can ask the user which browser window they want you to use (so you can grab the browser window through code). Here's an example of how to grab an existing browser window: Function GetExistingBrowser(strKey As String) Dim SWs As New SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As InternetExplorer Dim Resp For Each IE In SWs Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + vbQuestion, "Select IE") If Resp = vbYes Then Set mdie = Nothing Set mdie = IE.Application NewSormDataEntry strKey, mdie Exit Function End If Next End Function The 'NewSormDataEntry' function is the function I am sending the mdie object too (the referenced browser window). In this function strKey is the primary key of a record that will be used in that NewSormDataEntry to submit data into a web site. Trick #2: Just like when the development world got a wedgie when Microsoft 'secured' Outlook from programs just using it to send email, web security can be a real pain in doing something like this. The security is put in place to impede (note, I didn't say prevent) a hacker from doing nasty stuff to the site. So the 'impeding' garbage designed to trip up hackers can get in the way of a legitimate developer trying to create a helpful tool. So before you COMMIT to being able to make the tool, you'll need to look at the site itself, to see what all will get in your way. Trick #3: There are two ways to 'find' the objects you will need your code to work with. The first is to just look at the HTML of the page(s) you are going to manipulate. This is where some of those 'impediments' come into play. Some sites prevent you from right clicking on a page and selecting 'View Source'. Ironically, this is just removing a 'shortcut' way to view the HTML source behind a page. It doesn't actually HIDE the source, because your browser is viewing the source, it has too, otherwise it will have nothing to display. So there are multiple ways to 'download' the HTML you can view yourself. Create your own browser, and dump the HTML to a file. You can also use API calls to just directly download the HTML, without a browser. If the page is derived from internal (on the website server) variables, you'll need to use your own browser to get there and download the source. The second way to 'find' the objects you need to deal with are with the object browser. Running your code in debug mode, you'll be able to see the browser object, and all of it's child elements. Trick #4: Events and properties. Setting the value of a textbox, or clicking a button, just requires that you know what the events and properties of those objects are. I use the MSDN that came with the developer edition of Office 2000. It's got a nice HTML guide with common HTML form elements, their properties, methods, and events. But all that information is also plastered all over the web. Trick #5: When a page loads, the browser object is there, but you may not be able to capture 'download complete' events. What I have done in these cases, where my code puts in data on a page, clicks a button to go to the next page, I put my code in a loop, that sits and waits for an object from the next page to exist. Of course, if there are applets, or flash media elements, required for interaction... can't help ya there, haven't tackled one of those. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sun Dec 12 23:32:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 00:32:34 -0500 Subject: [dba-VB] Browser based database Message-ID: <4D05AFF2.3070701@colbyconsulting.com> I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Dec 13 00:03:50 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 13 Dec 2010 17:03:50 +1100 Subject: [dba-VB] Browser based database References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <99266C61B516644D9727F983FAFAB465046771@remote.ddisolutions.com.au> John, I was the same way. Still very much finding my way in ASP.net. But the basics are pretty straightforward. An ASP.net application is basically, Normal .net code, c# or vb.net whatever. Normal HTML Javascript (optional)(inserted by VS) Create a new asp.net project. Add a webform, select code in separate file. Change to split view Add a SQLDataSource control to the designer part of the form, hook it up to a small table. Add a DataGrid control to the designer part of the form, set the datasource. Run the project. See http://www.asp.net/get-started to get started. I've only done web forms and Ajax so far. Cheers Michael M From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 13 December 2010 4:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com ________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3311 - Release Date: 12/12/10 From ebarro at roadrunner.com Mon Dec 13 00:45:47 2010 From: ebarro at roadrunner.com (Eric Barro) Date: Sun, 12 Dec 2010 22:45:47 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D05AFF2.3070701@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <013d01cb9a91$604a5250$20def6f0$@com> John, ASP.NET uses either C# or VB.NET as the underlying development language. Of course there are other technologies involved such as Javascript, HMTL, CSS etc. There's no way to convert a WinForm application to a web app with one click of a button. You'd have to recreate your WinForm in ASP.NET using the built-in .NET equivalent controls. The good thing is that they are one and the same type of control on the web app (ie TextBox in WinForms is still TextBox on a web app). If you programmed your business logic in separate classes and you refrained from directly referencing controls in the methods then you should be fine and you should be able to use most of your code in a web app. The main things you will need to deal with in a web app such as ASP.NET are the following: 1. Session variables - this is one of the ways you can pass data back and forth from one page to the next since web apps are stateless apps and there is no "automatic way" of "remembering" data from one page to the next. 2. Postback events - when a user clicks a button on a WinForm all you need to do is trap for the click event. On a web app you need to be aware of when postbacks (basically trips to the server) occur so that you can properly trap events or intercept them. 3. Server side versus client side events - this is probably the hardest concept to grasp for most beginning web app developers. 4. Client side scripting - When it's done and said, all ASP.NET does really is render the page in HTML and handle the events using Javascript. You will need to get your feet wet learning Javascript as well. Fortunately, the syntax is based on C but variables and objects are not strongly-typed. --Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, December 12, 2010 9:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Mon Dec 13 03:45:37 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:45:37 +0000 Subject: [dba-VB] Browser based database In-Reply-To: <013d01cb9a91$604a5250$20def6f0$@com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: Hello John, There are lots of things to consider when you out an app online, security being just one. But there are really many other things also, most of which I do not know. However, I am currently happily developing web apps myself, and I spent minutes and hours on my coding. I am using DotNetNuke as my framework and it works a treat. I keep it simple and try not to get too fancy. There is loads of help available from the groups and forums. It is not too wild to suggest that in the future 50% or more of our customers will want web based front ends, so I urge you to study DNN - a few days of reading the forums and the turorials on module development will have you coding apps in no time. Do not be put off by the initial barrier to entry, once you get the hang of it, and one you keep it simple, you can code in the same ol' c# style , but your GUI will be a DNN website. Oh, and it if fun also. Mark On 13 December 2010 06:45, Eric Barro wrote: > John, > > ASP.NET uses either C# or VB.NET as the underlying development language. > Of > course there are other technologies involved such as Javascript, HMTL, CSS > etc. > > There's no way to convert a WinForm application to a web app with one click > of a button. You'd have to recreate your WinForm in ASP.NET using the > built-in .NET equivalent controls. The good thing is that they are one and > the same type of control on the web app (ie TextBox in WinForms is still > TextBox on a web app). > > If you programmed your business logic in separate classes and you refrained > from directly referencing controls in the methods then you should be fine > and you should be able to use most of your code in a web app. > > The main things you will need to deal with in a web app such as ASP.NETare > the following: > > 1. Session variables - this is one of the ways you can pass data back and > forth from one page to the next since web apps are stateless apps and there > is no "automatic way" of "remembering" data from one page to the next. > 2. Postback events - when a user clicks a button on a WinForm all you need > to do is trap for the click event. On a web app you need to be aware of > when > postbacks (basically trips to the server) occur so that you can properly > trap events or intercept them. > 3. Server side versus client side events - this is probably the hardest > concept to grasp for most beginning web app developers. > 4. Client side scripting - When it's done and said, all ASP.NET does > really > is render the page in HTML and handle the events using Javascript. You will > need to get your feet wet learning Javascript as well. Fortunately, the > syntax is based on C but variables and objects are not strongly-typed. > > --Eric > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Sunday, December 12, 2010 9:33 PM > To: VBA > Subject: [dba-VB] Browser based database > > I need to do two different browser based databases (I think). I know > nothing about this. Both > clients need to enter data and have multiple users hitting the database > from > home and office computers. > > Where do I start? I am getting pretty good with C# / SQL Server but those > are computer based > "applications". If I could do an internet download installation, I could > probably (maybe) go there. > Except what about admin rights etc. > > Is asp.net viable? Is it close to C#? If I keep the data entry screens > simple can I do it in C# > and then just "press a button" to turn it into ASP.net? Please don't make > rude noises here. > > ;) > > I just know nothing about internet facing application programming and I > feel > really inadequate on > this stuff. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 Mon Dec 13 03:48:10 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:48:10 +0000 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Hello John Another choice is to use Sillennium It is built for this task and will allow you to easily change your library of routines when your website changes. Mark On 10 December 2010 22:33, Drew Wutka wrote: > Now for a little more info for you. Yes, you can certainly do this. > Technically, it's not much different than if someone handed you an .mde, > and asked you to automate tasks in the mde (so you couldn't tweak the > source code running the program itself, but you could open the mde with > VBA, and use the objects within it just like you'd use the objects in > your own application.) > > Trick #1: Just like with an .mde, you have to have a reference to the > database itself, so with a browser, you need a reference to it. You can > either programmatically open a browser window (so you'll both create the > object, and have a reference to it), or you can ask the user which > browser window they want you to use (so you can grab the browser window > through code). > > Here's an example of how to grab an existing browser window: > > Function GetExistingBrowser(strKey As String) > Dim SWs As New SHDocVw.ShellWindows > Dim IE As SHDocVw.InternetExplorer > Dim mdie As InternetExplorer > Dim Resp > For Each IE In SWs > Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & > IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + > vbQuestion, "Select IE") > If Resp = vbYes Then > Set mdie = Nothing > Set mdie = IE.Application > NewSormDataEntry strKey, mdie > Exit Function > End If > Next > End Function > > The 'NewSormDataEntry' function is the function I am sending the mdie > object too (the referenced browser window). In this function strKey is > the primary key of a record that will be used in that NewSormDataEntry > to submit data into a web site. > > Trick #2: Just like when the development world got a wedgie when > Microsoft 'secured' Outlook from programs just using it to send email, > web security can be a real pain in doing something like this. The > security is put in place to impede (note, I didn't say prevent) a hacker > from doing nasty stuff to the site. So the 'impeding' garbage designed > to trip up hackers can get in the way of a legitimate developer trying > to create a helpful tool. So before you COMMIT to being able to make > the tool, you'll need to look at the site itself, to see what all will > get in your way. > > Trick #3: There are two ways to 'find' the objects you will need your > code to work with. The first is to just look at the HTML of the page(s) > you are going to manipulate. This is where some of those 'impediments' > come into play. Some sites prevent you from right clicking on a page > and selecting 'View Source'. Ironically, this is just removing a > 'shortcut' way to view the HTML source behind a page. It doesn't > actually HIDE the source, because your browser is viewing the source, it > has too, otherwise it will have nothing to display. So there are > multiple ways to 'download' the HTML you can view yourself. Create your > own browser, and dump the HTML to a file. You can also use API calls to > just directly download the HTML, without a browser. If the page is > derived from internal (on the website server) variables, you'll need to > use your own browser to get there and download the source. The second > way to 'find' the objects you need to deal with are with the object > browser. Running your code in debug mode, you'll be able to see the > browser object, and all of it's child elements. > > Trick #4: Events and properties. Setting the value of a textbox, or > clicking a button, just requires that you know what the events and > properties of those objects are. I use the MSDN that came with the > developer edition of Office 2000. It's got a nice HTML guide with > common HTML form elements, their properties, methods, and events. But > all that information is also plastered all over the web. > > Trick #5: When a page loads, the browser object is there, but you may > not be able to capture 'download complete' events. What I have done in > these cases, where my code puts in data on a page, clicks a button to go > to the next page, I put my code in a loop, that sits and waits for an > object from the next page to exist. > > Of course, if there are applets, or flash media elements, required for > interaction... can't help ya there, haven't tackled one of those. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > > -- > 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 > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:11:31 -0500 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: <4D0637A3.8020609@colbyconsulting.com> Thanks everyone who has responded. Both of these are cases where the company is "virtual" and all the stakeholders are scattered around. The database has to be accessed over the internet, and from who knows where. I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but then you run into installation issues etc. With "clickonce" deployment even that might be possible. I think if I could do a real app distributed with ClickOnce I would go that route. It just puts off learning all of the web / html / java stuff. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:45 AM, Mark Breen wrote: > Hello John, > > There are lots of things to consider when you out an app online, security > being just one. But there are really many other things also, most of which > I do not know. > > However, I am currently happily developing web apps myself, and I spent > minutes and hours on my coding. > > I am using DotNetNuke as my framework and it works a treat. I keep it > simple and try not to get too fancy. There is loads of help available from > the groups and forums. > > It is not too wild to suggest that in the future 50% or more of our > customers will want web based front ends, so I urge you to study DNN - a few > days of reading the forums and the turorials on module development will have > you coding apps in no time. > > Do not be put off by the initial barrier to entry, once you get the hang of > it, and one you keep it simple, you can code in the same ol' c# style , but > your GUI will be a DNN website. > > Oh, and it if fun also. > > Mark > > > On 13 December 2010 06:45, Eric Barro wrote: > >> John, >> >> ASP.NET uses either C# or VB.NET as the underlying development language. >> Of >> course there are other technologies involved such as Javascript, HMTL, CSS >> etc. >> >> There's no way to convert a WinForm application to a web app with one click >> of a button. You'd have to recreate your WinForm in ASP.NET using the >> built-in .NET equivalent controls. The good thing is that they are one and >> the same type of control on the web app (ie TextBox in WinForms is still >> TextBox on a web app). >> >> If you programmed your business logic in separate classes and you refrained >> from directly referencing controls in the methods then you should be fine >> and you should be able to use most of your code in a web app. >> >> The main things you will need to deal with in a web app such as ASP.NETare >> the following: >> >> 1. Session variables - this is one of the ways you can pass data back and >> forth from one page to the next since web apps are stateless apps and there >> is no "automatic way" of "remembering" data from one page to the next. >> 2. Postback events - when a user clicks a button on a WinForm all you need >> to do is trap for the click event. On a web app you need to be aware of >> when >> postbacks (basically trips to the server) occur so that you can properly >> trap events or intercept them. >> 3. Server side versus client side events - this is probably the hardest >> concept to grasp for most beginning web app developers. >> 4. Client side scripting - When it's done and said, all ASP.NET does >> really >> is render the page in HTML and handle the events using Javascript. You will >> need to get your feet wet learning Javascript as well. Fortunately, the >> syntax is based on C but variables and objects are not strongly-typed. >> >> --Eric >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Sunday, December 12, 2010 9:33 PM >> To: VBA >> Subject: [dba-VB] Browser based database >> >> I need to do two different browser based databases (I think). I know >> nothing about this. Both >> clients need to enter data and have multiple users hitting the database >> from >> home and office computers. >> >> Where do I start? I am getting pretty good with C# / SQL Server but those >> are computer based >> "applications". If I could do an internet download installation, I could >> probably (maybe) go there. >> Except what about admin rights etc. >> >> Is asp.net viable? Is it close to C#? If I keep the data entry screens >> simple can I do it in C# >> and then just "press a button" to turn it into ASP.net? Please don't make >> rude noises here. >> >> ;) >> >> I just know nothing about internet facing application programming and I >> feel >> really inadequate on >> this stuff. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:33:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:33:44 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D063CD8.4020303@colbyconsulting.com> The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your library > of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an .mde, >> and asked you to automate tasks in the mde (so you couldn't tweak the >> source code running the program itself, but you could open the mde with >> VBA, and use the objects within it just like you'd use the objects in >> your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to the >> database itself, so with a browser, you need a reference to it. You can >> either programmatically open a browser window (so you'll both create the >> object, and have a reference to it), or you can ask the user which >> browser window they want you to use (so you can grab the browser window >> through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) >> Dim SWs As New SHDocVw.ShellWindows >> Dim IE As SHDocVw.InternetExplorer >> Dim mdie As InternetExplorer >> Dim Resp >> For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey is >> the primary key of a record that will be used in that NewSormDataEntry >> to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send email, >> web security can be a real pain in doing something like this. The >> security is put in place to impede (note, I didn't say prevent) a hacker >> from doing nasty stuff to the site. So the 'impeding' garbage designed >> to trip up hackers can get in the way of a legitimate developer trying >> to create a helpful tool. So before you COMMIT to being able to make >> the tool, you'll need to look at the site itself, to see what all will >> get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need your >> code to work with. The first is to just look at the HTML of the page(s) >> you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, it >> has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create your >> own browser, and dump the HTML to a file. You can also use API calls to >> just directly download the HTML, without a browser. If the page is >> derived from internal (on the website server) variables, you'll need to >> use your own browser to get there and download the source. The second >> way to 'find' the objects you need to deal with are with the object >> browser. Running your code in debug mode, you'll be able to see the >> browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. But >> all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you may >> not be able to capture 'download complete' events. What I have done in >> these cases, where my code puts in data on a page, clicks a button to go >> to the next page, I put my code in a loop, that sits and waits for an >> object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required for >> interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file >> downloaded. It sounded totally convoluted but the question is (and I >> have asked this before without >> a usable response) can I programmatically manipulate web pages to cause >> specific pages to open, >> click buttons, input data into controls etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for the >> person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI >> Business >> Sensitive material. If you are not the intended recipient, please contact >> the sender >> immediately and destroy the material in its entirety, whether electronic or >> hard copy. >> You are notified that any review, retransmission, copying, disclosure, >> dissemination, >> or other use of, or taking of any action in reliance upon this information >> by persons >> or entities other than the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From davidmcafee at gmail.com Mon Dec 13 10:09:41 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 08:09:41 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D0637A3.8020609@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: U use a click once app for our nationwide sales force. Very easy to implement and using webservice calls, seems like a local app. I'll post some samples when I get into the office Sent from my Droid phone. On Dec 13, 2010 7:12 AM, "jwcolby" wrote: > > Thanks everyone who has responded. > > Both of these are cases where the company is "virtual" and all the stakeholders are scattered > around. The database has to be accessed over the internet, and from who knows where. > > I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but > then you run into installation issues etc. With "clickonce" deployment even that might be possible. > I think if I could do a real app distributed with ClickOnce I would go that route. It just puts > off learning all of the web / html / java stuff. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:45 AM, Mark Breen wrote: > > Hello John, > > > > There are lots of things to consider when you out an app online, security > > being just one. But there are really many other things also, most of which > > I do not know. > > > > However, I am currently happily developing web apps myself, and I spent > > minutes and hours on my coding. > > > > I am using DotNetNuke as my framework and it works a treat. I keep it > > simple and try not to get too fancy. There is loads of help available from > > the groups and forums. > > > > It is not too wild to suggest that in the future 50% or more of our > > customers will want web based front ends, so I urge you to study DNN - a few > > days of reading the forums and the turorials on module development will have > > you coding apps in no time. > > > > Do not be put off by the initial barrier to entry, once you get the hang of > > it, and one you keep it simple, you can code in the same ol' c# style , but > > your GUI will be a DNN website. > > > > Oh, and it if fun also. > > > > Mark > > > > > > On 13 December 2010 06:45, Eric Barro wrote: > > > >> John, > >> > >> ASP.NET uses either C# or VB.NET as the underlying development language. > >> Of > >> course there are other technologies involved such as Javascript, HMTL, CSS > >> etc. > >> > >> There's no way to convert a WinForm application to a web app with one click > >> of a button. You'd have to recreate your WinForm in ASP.NET using the > >> built-in .NET equivalent controls. The good thing is that they are one and > >> the same type of control on the web app (ie TextBox in WinForms is still > >> TextBox on a web app). > >> > >> If you programmed your business logic in separate classes and you refrained > >> from directly referencing controls in the methods then you should be fine > >> and you should be able to use most of your code in a web app. > >> > >> The main things you will need to deal with in a web app such as ASP.NETare > >> the following: > >> > >> 1. Session variables - this is one of the ways you can pass data back and > >> forth from one page to the next since web apps are stateless apps and there > >> is no "automatic way" of "remembering" data from one page to the next. > >> 2. Postback events - when a user clicks a button on a WinForm all you need > >> to do is trap for the click event. On a web app you need to be aware of > >> when > >> postbacks (basically trips to the server) occur so that you can properly > >> trap events or intercept them. > >> 3. Server side versus client side events - this is probably the hardest > >> concept to grasp for most beginning web app developers. > >> 4. Client side scripting - When it's done and said, all ASP.NET does > >> really > >> is render the page in HTML and handle the events using Javascript. You will > >> need to get your feet wet learning Javascript as well. Fortunately, the > >> syntax is based on C but variables and objects are not strongly-typed. > >> > >> --Eric > >> > >> -----Original Message----- > >> From: dba-vb-bounces at databaseadvisors.com > >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > >> Sent: Sunday, December 12, 2010 9:33 PM > >> To: VBA > >> Subject: [dba-VB] Browser based database > >> > >> I need to do two different browser based databases (I think). I know > >> nothing about this. Both > >> clients need to enter data and have multiple users hitting the database > >> from > >> home and office computers. > >> > >> Where do I start? I am getting pretty good with C# / SQL Server but those > >> are computer based > >> "applications". If I could do an internet download installation, I could > >> probably (maybe) go there. > >> Except what about admin rights etc. > >> > >> Is asp.net viable? Is it close to C#? If I keep the data entry screens > >> simple can I do it in C# > >> and then just "press a button" to turn it into ASP.net? Please don't make > >> rude noises here. > >> > >> ;) > >> > >> I just know nothing about internet facing application programming and I > >> feel > >> really inadequate on > >> this stuff. > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Dec 13 10:35:04 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 13 Dec 2010 08:35:04 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D063CD8.4020303@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> Message-ID: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 13, 2010 7:34 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your > library of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an >> .mde, and asked you to automate tasks in the mde (so you couldn't >> tweak the source code running the program itself, but you could open >> the mde with VBA, and use the objects within it just like you'd use >> the objects in your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to >> the database itself, so with a browser, you need a reference to it. >> You can either programmatically open a browser window (so you'll both >> create the object, and have a reference to it), or you can ask the >> user which browser window they want you to use (so you can grab the >> browser window through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) Dim SWs As New >> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >> InternetExplorer Dim Resp For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey >> is the primary key of a record that will be used in that >> NewSormDataEntry to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send >> email, web security can be a real pain in doing something like this. >> The security is put in place to impede (note, I didn't say prevent) a >> hacker from doing nasty stuff to the site. So the 'impeding' garbage >> designed to trip up hackers can get in the way of a legitimate >> developer trying to create a helpful tool. So before you COMMIT to >> being able to make the tool, you'll need to look at the site itself, >> to see what all will get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need >> your code to work with. The first is to just look at the HTML of the >> page(s) you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, >> it has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create >> your own browser, and dump the HTML to a file. You can also use API >> calls to just directly download the HTML, without a browser. If the >> page is derived from internal (on the website server) variables, >> you'll need to use your own browser to get there and download the >> source. The second way to 'find' the objects you need to deal with >> are with the object browser. Running your code in debug mode, you'll >> be able to see the browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. >> But all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you >> may not be able to capture 'download complete' events. What I have >> done in these cases, where my code puts in data on a page, clicks a >> button to go to the next page, I put my code in a loop, that sits and >> waits for an object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required >> for interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file downloaded. It sounded totally >> convoluted but the question is (and I have asked this before without >> a usable response) can I programmatically manipulate web pages to >> cause specific pages to open, click buttons, input data into controls >> etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and >> destroy the material in its entirety, whether electronic or hard >> copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than >> the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 13 10:57:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 11:57:48 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> Message-ID: <4D06508C.6030004@colbyconsulting.com> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:48 AM, Mark Breen wrote: >> Hello John >> >> Another choice is to use Sillennium >> >> It is built for this task and will allow you to easily change your >> library of routines when your website changes. >> >> Mark >> >> >> >> >> On 10 December 2010 22:33, Drew Wutka wrote: >> >>> Now for a little more info for you. Yes, you can certainly do this. >>> Technically, it's not much different than if someone handed you an >>> .mde, and asked you to automate tasks in the mde (so you couldn't >>> tweak the source code running the program itself, but you could open >>> the mde with VBA, and use the objects within it just like you'd use >>> the objects in your own application.) >>> >>> Trick #1: Just like with an .mde, you have to have a reference to >>> the database itself, so with a browser, you need a reference to it. >>> You can either programmatically open a browser window (so you'll both >>> create the object, and have a reference to it), or you can ask the >>> user which browser window they want you to use (so you can grab the >>> browser window through code). >>> >>> Here's an example of how to grab an existing browser window: >>> >>> Function GetExistingBrowser(strKey As String) Dim SWs As New >>> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >>> InternetExplorer Dim Resp For Each IE In SWs >>> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >>> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >>> vbQuestion, "Select IE") >>> If Resp = vbYes Then >>> Set mdie = Nothing >>> Set mdie = IE.Application >>> NewSormDataEntry strKey, mdie >>> Exit Function >>> End If >>> Next >>> End Function >>> >>> The 'NewSormDataEntry' function is the function I am sending the mdie >>> object too (the referenced browser window). In this function strKey >>> is the primary key of a record that will be used in that >>> NewSormDataEntry to submit data into a web site. >>> >>> Trick #2: Just like when the development world got a wedgie when >>> Microsoft 'secured' Outlook from programs just using it to send >>> email, web security can be a real pain in doing something like this. >>> The security is put in place to impede (note, I didn't say prevent) a >>> hacker from doing nasty stuff to the site. So the 'impeding' garbage >>> designed to trip up hackers can get in the way of a legitimate >>> developer trying to create a helpful tool. So before you COMMIT to >>> being able to make the tool, you'll need to look at the site itself, >>> to see what all will get in your way. >>> >>> Trick #3: There are two ways to 'find' the objects you will need >>> your code to work with. The first is to just look at the HTML of the >>> page(s) you are going to manipulate. This is where some of those > 'impediments' >>> come into play. Some sites prevent you from right clicking on a page >>> and selecting 'View Source'. Ironically, this is just removing a >>> 'shortcut' way to view the HTML source behind a page. It doesn't >>> actually HIDE the source, because your browser is viewing the source, >>> it has too, otherwise it will have nothing to display. So there are >>> multiple ways to 'download' the HTML you can view yourself. Create >>> your own browser, and dump the HTML to a file. You can also use API >>> calls to just directly download the HTML, without a browser. If the >>> page is derived from internal (on the website server) variables, >>> you'll need to use your own browser to get there and download the >>> source. The second way to 'find' the objects you need to deal with >>> are with the object browser. Running your code in debug mode, you'll >>> be able to see the browser object, and all of it's child elements. >>> >>> Trick #4: Events and properties. Setting the value of a textbox, or >>> clicking a button, just requires that you know what the events and >>> properties of those objects are. I use the MSDN that came with the >>> developer edition of Office 2000. It's got a nice HTML guide with >>> common HTML form elements, their properties, methods, and events. >>> But all that information is also plastered all over the web. >>> >>> Trick #5: When a page loads, the browser object is there, but you >>> may not be able to capture 'download complete' events. What I have >>> done in these cases, where my code puts in data on a page, clicks a >>> button to go to the next page, I put my code in a loop, that sits and >>> waits for an object from the next page to exist. >>> >>> Of course, if there are applets, or flash media elements, required >>> for interaction... can't help ya there, haven't tackled one of those. >>> >>> Drew >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Friday, December 10, 2010 3:30 PM >>> To: VBA >>> Subject: [dba-VB] Web page manipulation >>> >>> My client has to go through a process where he clicks about 20 - 30 >>> things to manage to get a file downloaded. It sounded totally >>> convoluted but the question is (and I have asked this before without >>> a usable response) can I programmatically manipulate web pages to >>> cause specific pages to open, click buttons, input data into controls >>> etc. >>> >>> -- >>> 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 >>> >>> The information contained in this transmission is intended only for >>> the person or entity to which it is addressed and may contain II-VI >>> Proprietary and/or II-VI Business Sensitive material. If you are not >>> the intended recipient, please contact the sender immediately and >>> destroy the material in its entirety, whether electronic or hard >>> copy. >>> You are notified that any review, retransmission, copying, >>> disclosure, dissemination, or other use of, or taking of any action >>> in reliance upon this information by persons or entities other than >>> the intended recipient is prohibited. >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Dec 13 11:24:37 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 13 Dec 2010 18:24:37 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John How about LightSwitch: http://www.microsoft.com/visualstudio/en-us/lightswitch It is still in beta, I know, but given the modest requirements of these two apps ... /gustav >>> jwcolby at colbyconsulting.com 13-12-2010 17:57 >>> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com From davidmcafee at gmail.com Mon Dec 13 18:50:49 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 16:50:49 -0800 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: This time without the RTF Damn, keyboard. That was supposed to say "I use a click once app for our sales force" Here's a sub that calls a webservice and populates a table for a SSCE database: (but you could do what ever you want with your returned dataset) private void retrieveData(int intMode) { // This process will call a webservice passing a parameter which in turn executes a SQL stored procedure, returning a dataset try { // call webservice and populate dataset localhost.Service1 MyObj = new localhost.Service1(); DataSet ds; ds = MyObj.RetrieveSQLdata(intMode); // At this point, the dataset has already been filled by the web service SqlServerCe.SqlCeConnection CEconn; SqlServerCe.SqlCeCommand CEcmd; CEconn = new SqlServerCe.SqlCeConnection(("Data Source =" + (PathPC + FileName))); CEconn.Open(); CEcmd = new SqlServerCe.SqlCeCommand(); CEcmd.Connection = CEconn; // Delete the exisiting data from the iPAQ tables before populating it string TableName = ""; switch (intMode) { case 1: TableName = "PListHdr"; break; case 12: TableName = "PListItems"; break; } CEcmd.CommandText = ("DELETE " + TableName); CEcmd.ExecuteNonQuery(); this.lblStatus.Text = ("Retrieving " + (TableName + " data from SQL")); System.Windows.Forms.Application.DoEvents(); DataRow row; string mystr = ""; int RowCount = 0; foreach (row in ds.Tables[0].Rows) { mystr = ""; if ((intMode == 1)) { mystr = (mystr + "INSERT INTO PListHdr (PListID, PListDesc) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["PListDesc"].ToString + "\')"))); } else if ((intMode == 12)) { mystr = (mystr + "INSERT INTO PListItems (PListID, ItemNo, Price) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["ItemNo"].ToString + "\', "))); mystr = (mystr + (row["Price"].ToString + ")")); } CEcmd.CommandText = mystr; CEcmd.ExecuteNonQuery(); } this.lblStatus.Text = (TableName + " data retrieved from SQL"); System.Windows.Forms.Application.DoEvents(); CEcmd.Dispose(); CEconn.Close(); CEconn.Dispose(); } catch (Exception ex) { throw new Exception("updateCustMast() Failed"); } } This is how the sub is called from within my local/users' app: public void UpdatePListHdr() { if ((DoesTableExist("PListHdr") == true)) { if (this.chkRunInDebugMode.Checked) { MessageBox.Show("UpdatePListHdr()"); } this.lblStatus.Text = "Retrieving PListHdr data"; System.Windows.Forms.Application.DoEvents(); this.retrieveData(1); } } This is the web service call (you can replace the string mystr=(); line with your favorite dynamic SQL : [WebMethod()] public DataSet RetrieveSQLdata(int intMode) { SqlConnection conn; SqlDataAdapter da; DataSet ds; string mystr = ("EXEC stpRetrieveData \'" + (LoginUser + ("\', " + intMode))); conn = new SqlConnection(strConn); da = new SqlDataAdapter(mystr, conn); da.SelectCommand.Parameters.AddWithValue("@Mode", intMode); ds = new DataSet(); da.Fill(ds); return ds; conn.Close(); } so you can see, it is pretty simple if you are already making similar calls in C# From jwcolby at colbyconsulting.com Wed Dec 15 07:33:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 15 Dec 2010 08:33:48 -0500 Subject: [dba-VB] SSDS Message-ID: <4D08C3BC.7020900@colbyconsulting.com> I am trying to learn how to host data on my own servers, or on a web site that I contract for, and use a service to get that data. I thought that SSDS was the technology that allowed me to do that, but when I start viewing Microsoft's clinics, specifically clinic 6341, I am told I need to "register for, set up a user name" etc... IOW "We have a server in the cloud and sell you"... That is decidedly NOT what I want to do, simply because I have no budget for the "we sell you" part of that contract. Do we know whether SSDS allows me to host my own data and write services to access my own data hosted wherever I want to host that data? If so, where do I go to learn how to do this. I viewed a blog last night. specifically http://channel9.msdn.com/blogs/pdc2008/tl07 which was pretty cool. I have to say I am skeptical that it would work for high volume data transfers simply because of the overhead for each actual piece of data. However for working with databases in the traditional "fill in the tables and generate reports" it looks like a killer way to do business over the internet. I now have three different places (clients) where this would appear to solve my problems with remote users. Is anyone using this stuff to build applications that run on a client but add / edit / browse / report to a database "out there somewhere"? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 16 10:26:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 11:26:19 -0500 Subject: [dba-VB] Wrapper classes Message-ID: <4D0A3DAB.2030103@colbyconsulting.com> Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu Dec 16 12:28:09 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Dec 2010 21:28:09 +0300 Subject: [dba-VB] Wrapper classes In-Reply-To: <4D0A3DAB.2030103@colbyconsulting.com> References: <4D0A3DAB.2030103@colbyconsulting.com> Message-ID: <3976E26898A345C0AD1865DEB2146C8D@nant> Hi John -- You'd better keep your code within User Custom Control in a (User Custom Controls) class library. User Custom Controls can be nested or inherited - such a nesting/inheritance rarely gets deeper than three levels. And even more strong assertion is true - it never gets deeper than three levels in the projects of my customers, with one-two levels being the most common application cases. And in the case of two levels the upper level User Custom Control (dropped on WinForms) is usually used just as a container (nest) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 16 ??????? 2010 ?. 19:26 To: VBA Subject: [dba-VB] Wrapper classes Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 16 15:47:41 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 16:47:41 -0500 Subject: [dba-VB] WCF Message-ID: <4D0A88FD.3080409@colbyconsulting.com> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Dec 17 05:43:46 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 12:43:46 +0100 Subject: [dba-VB] WCF Message-ID: Hi John Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. Microsoft has some intro stuff as well: http://msdn.microsoft.com/en-us/library/gg132851.aspx I haven't worked with WCF for any practical project but would love to follow the thread. /gustav >>> jwcolby at colbyconsulting.com 16-12-2010 22:47 >>> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 08:20:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:20:17 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0B71A1.5040703@colbyconsulting.com> Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the internet using a client .Net > application. I have three different projects for three different clients all of which really need > to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) > chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has > done this and wants to start a discussion thread. > From jwcolby at colbyconsulting.com Fri Dec 17 08:25:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:25:52 -0500 Subject: [dba-VB] Why use a contract? Message-ID: <4D0B72F0.6010902@colbyconsulting.com> The WCF book I am reading discusses building interfaces / contracts. He uses the term interchangeably. Basically you set up a file that has just the variables and method signatures, and name it. Then you build an actual implementation class that implements the contract. I am the kind of person that likes to know the "why". I don't mind doing something but I find it useful to know the reasons for what I do. So what does the interface / contract do for us in the development process. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 09:13:53 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 10:13:53 -0500 Subject: [dba-VB] DAAB Message-ID: <4D0B7E31.1020902@colbyconsulting.com> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Dec 17 09:39:10 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 17 Dec 2010 10:39:10 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0B71A1.5040703@colbyconsulting.com> References: <4D0B71A1.5040703@colbyconsulting.com> Message-ID: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 17, 2010 9:20 AM To: Discussion concerning Visual Basic and related programming issues.; Access Developers discussion and problem solving Subject: Re: [dba-VB] WCF Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the > internet using a client .Net application. I have three different > projects for three different clients all of which really need to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many > acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd > see if anyone on the list has done this and wants to start a discussion thread. > _______________________________________________ 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 17 10:07:23 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 17:07:23 +0100 Subject: [dba-VB] DAAB Message-ID: Hi John It looks like that link is superseded by the Enterprise Library of which the newest version is found here: http://msdn.microsoft.com/en-us/library/ff632023.aspx I haven't used it. /gustav >>> jwcolby at colbyconsulting.com 17-12-2010 16:13 >>> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 10:23:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 11:23:17 -0500 Subject: [dba-VB] WCF In-Reply-To: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> References: <4D0B71A1.5040703@colbyconsulting.com> <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Message-ID: <4D0B8E75.5060201@colbyconsulting.com> Michael, Glad to have you. I am using VS 2008 Standard edition. I will probably go with SQL Server Express in order to allow each client to use their own database hosted wherever they need. My intention is to develop a client application in C#, and a service application in C#. The service application will talk to a database layer and through to SQL Server or MySQL. I will use WCF and services to talk from the client through the internet to the service application. I am so new to this that I am just talking generalities here. From what I am reading, this is the big picture of how it is done. The first chapter of John Sharp's book dives right in and I will be diving right in following along exactly, using his tools / database etc. Once I am able to do so I will bring up a parallel track of the volunteer database. I want to go with the C# client because I just don't like browser based applications. I don't like using them when I am forced to out on the internet, they just always feel clumsy. At this time my clients all use Windows, are all at least at Windows XP, and so can easily host a windows based application. IOW I do not need to run my client app on Linux or other non windows OS so why do browser based apps. I use VisualSVN / Tortoise for source control internal to my business. IIRC Gustav, Shamil and Mark Breen used this same combination for Source control but had the repository on the web. If you remember those guys did a rewrite of Microsoft's Tradewind Access demo database into C#. Back then I was not up to speed in C#. While I hesitate to say I am up to speed now, I am at least minimally functional in C# now, though this WCF thing is going to be a stretch. I will ask them if that repository is still up and whether we can use it. Source control is critical for a community project in order to be able to share the source code and not step on toes. This volunteer database is a real application and a real (non-paying) client (Prison Ministries) and I am using this as a learning tool to get to this paradigm, to be comfortable with this for future development of distributed applications. I may very well start to design even my internal app to use the services paradigm, if for no other reason that to get good at it and stay there. Anyway, that is what I am up to. I have committed to delivering an Access database to Prison Ministries by the first of the year. I am so fast in Access that doing so (for something this small) is doable, however I cannot see how to publish that application over the web in a manner that will stay useful and current and easy to maintain for the future. Not to mention my faith in the future of Access is not very high right now. Ergo C# / WCF services / SQL Server / MySQL. That would seem to be the future. John W. Colby www.ColbyConsulting.com On 12/17/2010 10:39 AM, Michael Mattys wrote: > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called > HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 10:22:32 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 11:22:32 -0500 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: <4D0CDFC8.1010001@colbyconsulting.com> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:16:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:16:09 -0500 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: <4D0CFA69.1050706@colbyconsulting.com> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 12:24:04 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 19:24:04 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Could this be your case: http://forums.asp.net/t/1290251.aspx /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 17:22 >>> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:24:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:24:15 -0500 Subject: [dba-VB] objectbuilder.dll is missing In-Reply-To: References: Message-ID: <4D0CFC4F.8070903@colbyconsulting.com> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? > From jwcolby at colbyconsulting.com Sat Dec 18 13:31:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 14:31:39 -0500 Subject: [dba-VB] And the beat goes on... Message-ID: <4D0D0C1B.8030907@colbyconsulting.com> http://thessdreview.com/latest-buzz/sandforce-firmware-update-confirmed-great-news-for-new-ssd-buyers/ -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 14:16:32 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:16:32 +0100 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: Hi John Not me. Never had the need for such "factories". It looks like very clever stuff. Thanks for the link - I'll certainly study it. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:16 >>> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx From gustav at cactus.dk Sat Dec 18 14:17:48 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:17:48 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Oh, but I haven't installed this myself, so I'm out of ideas. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:24 >>> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? From listmaster at databaseadvisors.com Sun Dec 19 13:08:22 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sun, 19 Dec 2010 14:08:22 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - Dec 2010 Message-ID: Good day everyone. I hope your Christmas preparations are going well. During the last few months the mail server has been having some problems. So over the Christmas holiday the mail server that all your favourite lists run on will be undergoing a complete upgrade right from the OS to the mail server to the mailing list software. This will mean that there will be some outages of the lists. This outage will most likely happen on Wednesday Dec 29, 2010 starting around 8am ET (1pm GMT). I will send out a notice approx. 30 minutes prior to the server going down. As well, once everything is back up and running, I will send out another notice. If you have any concerns, please let me know. I can be reached at listmaster at databaseadvisors.com or carbonnb at gmail.com. Thanks, Your humble list master Bryan -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From Gustav at cactus.dk Mon Dec 20 06:28:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 20 Dec 2010 13:28:21 +0100 Subject: [dba-VB] WCF Message-ID: Hi all The link for the book: http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 17-12-2010 16:39 >>> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com From jwcolby at colbyconsulting.com Mon Dec 20 06:57:16 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 07:57:16 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0F52AC.3050008@colbyconsulting.com> Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-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 20 12:11:50 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 13:11:50 -0500 Subject: [dba-VB] Multiple instances of SQl Server express Message-ID: <4D0F9C66.6000300@colbyconsulting.com> I have a client using Access BEs which I would like to move to SQL Server Express. The biggest issue in my mind is near term expansion. One reason we need to move is simply that we have already split the BEs a couple of times to keep the size reasonable. We have a BE at 850 MB, 750MB and 500 MB. These are just too big for Access IMHO. OTOH merging them all back into a single SQL Server express BE would result in a pretty large database (by Express standards), although it appears that they did increase the SSE 2008 limitation to 10 gigs. Is anyone using SS Express to try to run a small business - under 50 employees, ~25 users in the db most of the day? Any insights, gotchas, words of wisdom? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 09:07:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 10:07:17 -0500 Subject: [dba-VB] CAL aware software Message-ID: <4D10C2A5.8060007@colbyconsulting.com> I am trying to understand the CAL requirements of Microsoft's Windows 2008 Server and SQL Server 2008. The way I understand it, you buy CALs for each simultaneous connection. Server software gets rather expensive once you buy the software itself and then 30 or more CALs for the OS as well as for SQL Server. Do any of you spend time worrying about how to minimize the effect of the database on CAL utilization? For example do linked tables count differently than ado disconnected recordsets? Linked tables are connected from the time the person opens access to the time they close it as opposed to disconnected recordsets where a connection is made just long enough to get the data. Would the user be legally "connected" even though the application used disconnected recordsets? Any thoughts on how all this applies to CAL requirements. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 15:52:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 16:52:48 -0500 Subject: [dba-VB] Microsoft: Bringing Supercomputing To The Masses - Network Computing Message-ID: <4D1121B0.3020101@colbyconsulting.com> Need to model an atomic bomb? -- John W. Colby www.ColbyConsulting.com http://www.networkcomputing.com/cloud-computing/microsoft-bringing-supercomputing-to-the-masses.php From michael at mattysconsulting.com Tue Dec 21 22:27:19 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 21 Dec 2010 23:27:19 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0F52AC.3050008@colbyconsulting.com> References: <4D0F52AC.3050008@colbyconsulting.com> Message-ID: <923DD10436104846AC478F9A26AF2CC7@Gateway> I found that book needed correction and the following worked for me: My Service.svc contains: <%@ ServiceHost Language="C#" Debug="true" Service=" Products.ProductsServiceImpl" CodeBehind="~/App_Code/ProductsService.cs" %> My Web.config contains: Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 20, 2010 7:57 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] WCF Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:07:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:07:08 -0500 Subject: [dba-VB] wcf reading Message-ID: <4D12060C.3010905@colbyconsulting.com> ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Wed Dec 22 08:35:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 22 Dec 2010 09:35:51 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <4D12060C.3010905@colbyconsulting.com> References: <4D12060C.3010905@colbyconsulting.com> Message-ID: <7450A227F8B74909A4C32DE228083400@Gateway> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:38:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:38:20 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D120D5C.1090409@colbyconsulting.com> Ahhh... time to order up I guess. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:13:40 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:13:40 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi Michael So this link is for an outdated version: Windows Communication Foundation Step By Step by John Sharp 2007 http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 22-12-2010 15:35 >>> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. From jwcolby at colbyconsulting.com Wed Dec 22 09:26:12 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:26:12 -0500 Subject: [dba-VB] wcf reading In-Reply-To: References: Message-ID: <4D121894.2040209@colbyconsulting.com> That is for the book that I am reading. I bought it used awhile back, and it definitely is outdated - assuming that you have moved on from VS 2005 - which I have. AFAICT the underlying discussions still work, but the VS user interface has changed and very likely there are enhancements to WCF in .Net 4. I have been needing a reason to move up to VS 2010. I guess this is it. ;) John W. Colby www.ColbyConsulting.com On 12/22/2010 10:13 AM, Gustav Brock wrote: > Hi Michael > > So this link is for an outdated version: > > Windows Communication Foundation Step By Step > by John Sharp 2007 > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 22-12-2010 15:35>>> > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 From jwcolby at colbyconsulting.com Wed Dec 22 09:36:56 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:36:56 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D121B18.80604@colbyconsulting.com> I just ordered the latest from Amazon and it will be here in time for some light Christmas reading. ;) Now to install VS 2010. I actually need to learn this stuff. Up to this point all of my clients were location centric and everything happened over an internal network which lessened the need to go here. But services over the internet is the future. The nice thing about WCF is that you can do WWW and TCP endpoints in the same class which makes it possible to use the same system (and possible even application) for internal or external client applications. It is fascinating stuff and may allow me to get around needing to have share rights and the likes for everything. I do a lot of stuff like "save a CSV file to a shared directory", then have a program import the stuff into SQL server etc. As I create servers and stuff, setting up rights to shares is a pita. A service could get around all of that. Maybe. It's a brave new world. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:53:26 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:53:26 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi all This seems right! A 700+ pages monster book. Should keep you busy for the Christmas holiday. /gustav >>> "Michael Mattys" 22-12-2010 15:57 >>> Try here: http://www.free-ebooks-download.org/free-ebook/dotnet/Framework/windows-communication-foundation-4-step-by-step.php From jwcolby at colbyconsulting.com Thu Dec 23 10:22:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 23 Dec 2010 11:22:25 -0500 Subject: [dba-VB] OCZ's RevoDrive Preview: An Affordable PCIe SSD - AnandTech :: Your Source for Hardware Analysis and News Message-ID: <4D137741.1020907@colbyconsulting.com> http://www.anandtech.com/show/3788/oczs-revodrive-pcie-ssd-preview-an-affordable-pcie-ssd/8 http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&N=100008120%2050001550%20600038468&IsNodeId=1&name=PCI-E -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 24 11:11:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 24 Dec 2010 12:11:09 -0500 Subject: [dba-VB] VS 2010 user interface Message-ID: <4D14D42D.9000501@colbyconsulting.com> Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Fri Dec 24 11:21:21 2010 From: dbdoug at gmail.com (Doug Steele) Date: Fri, 24 Dec 2010 09:21:21 -0800 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: Well, John, once you've worked with Microsoft products for a couple of years, you'll get used to the idea that the interfaces change constantly. Always for the better, of course. They do test this stuff on thousands of users before releasing it. I think. Or not. Doug On Fri, Dec 24, 2010 at 9:11 AM, jwcolby wrote: > Note to self, never make abrupt and radical changes to the user experience. > > What a jarring experience opening VS 2010. Very likely the menus are > identical but the look and > feel of the opening screen is completely different. > > Why? > > Did the old start page not work? Is the new one miles ahead of / better > than the old? > > Or did we just need to be able to say we made it better? > > I don't know the answer but I know it is jarring. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Dec 24 16:11:00 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 25 Dec 2010 01:11:00 +0300 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: <8FF9D8E62966431780E6EF07937BD2E4@nant> Hi John -- >>> I don't know the answer but I know it is jarring. <<< Yes, the same feeling here. And it was easy to switch VS2003->VS2005->VS2008... Although I'd note they (MS) have completely reworked VS2010 IDE - it's written using Windows Presentation Foundation AFAIHH with many new IDE features therefore the current trouble to adapt to the new IDE isn't worth to worry about :) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 ??????? 2010 ?. 20:11 To: VBA Subject: [dba-VB] VS 2010 user interface Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 25 22:40:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 25 Dec 2010 23:40:17 -0500 Subject: [dba-VB] SQL Server Express version Message-ID: <4D16C731.4080203@colbyconsulting.com> I have SQL Server Express 10 on my laptop (dev machine). That appears to be 2005. I actually have the service there (not running) but I cannot seem to find it in the "programs and features". So how do I uninstall it in order to install the 2008 version? Or if I just do an install will it overwrite the old one? I suspect not. I just installed VS 2010 yesterday and kind of expected that it would install the latest express as part of its install but it does not seem to have done so. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Mon Dec 27 03:40:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 12:40:39 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: <5ADDFD61397040118F381468EF41A779@nant> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From gustav at cactus.dk Mon Dec 27 07:04:00 2010 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 27 Dec 2010 14:04:00 +0100 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From shamil at smsconsulting.spb.ru Mon Dec 27 07:53:36 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 16:53:36 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? In-Reply-To: References: Message-ID: <20053C1394F2453397A1D32185E51EF1@nant> Hi Gustav -- Sorry, that wasn't copy and paste part of code - original code compiled well. Anyway, I decided to not make it using dynamic approach because this approach creates additional layer of indirection/dynamics, which I should better avoid - it's not worth to introduce that indirection/complexity. 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: 27 ??????? 2010 ?. 16:04 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 27 21:13:40 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:13:40 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? Message-ID: <4D1955E4.5070504@colbyconsulting.com> I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 27 21:25:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:25:36 -0500 Subject: [dba-VB] You're gonna love this one Message-ID: <4D1958B0.2080602@colbyconsulting.com> http://www.johndcook.com/blog/2010/04/22/visual-studio-2010-is-a-pig/ 1.5 MILLION files? Hmm.... -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Mon Dec 27 21:40:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Mon, 27 Dec 2010 22:40:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <4D1955E4.5070504@colbyconsulting.com> References: <4D1955E4.5070504@colbyconsulting.com> Message-ID: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 27 22:12:51 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 23:12:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <4D1963C3.2@colbyconsulting.com> I will play with it more but VS 2008 worked fine for me, in fact I pretty much love it. I really only installed 2010 to do the WCF4 stuff. If I can run WCF 3.5 (or whatever) then I can afford to wait for MS to sort out the issues with VS 2010. I do real work with VS2008, and it works really well for what I am doing. My only complaints are that sometimes debug step is really slow. Sometimes not. Really strange. My Windows 2008 8 core machine is lightning fast for VS 2008 though, even debug stepping. Of course because it is X64 there is no edit and continue. Sigh. John W. Colby www.ColbyConsulting.com On 12/27/2010 10:40 PM, Michael Mattys wrote: > I have to agree with some of the comments there ... > the one that really puts a lump in my throat is "it will take decades to get > back to a 'Rapid Quality Application Development'" > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 27, 2010 10:14 PM > To: VBA > Subject: [dba-VB] Is VS 2010 extremely slow? > > I installed 2010 and it seems to be a dog! > > Anyone else with a similar experience? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 27 23:16:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 28 Dec 2010 00:16:08 -0500 Subject: [dba-VB] Adding an entity model Message-ID: <4D197298.9070806@colbyconsulting.com> The entity modeler does not like nullable FKs. IOW a location might / might not have an organization etc. Generates copious errors! Once I decided to go in and fix that, I had to delete the model and recreate in order to repair the "errors". Just telling it to go fetch the latest from the database did not fix the "errors". OTOH, deleting the entire model and rebuilding it did in fact get rid of all the errors. What a PITA. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Dec 28 07:44:13 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 16:44:13 +0300 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <3A19A89FC90248139C333B686AC14B69@nant> Hi All -- Yes, VS2010 looks slower than VS2008, and VS2010 is a "memory-hog" for sure but that's all I have found so far. Well, one other thing I have got VS2010 GPF-in while in design/IDE mode with "Out Of Memory" error message after about a day of working with it with about 10 projects in a solution. And I have had here on the same simple 2 core 2GB Win2003 PC three or four instances of VS2008 with many projects in every solution used without problems for days... Anyway I do suppose/hope MS should solve most of the issues in VS2010 because the issues AFAIU are mostly caused by the fact that MS developers have rewritten all/most of IDE using managed code (WPF), and solving memory leakage issues of managed code is a tough task but doable (memory leakage in managed code are mainly related to all kinds of "hooks"/delegates/event listeners and that ones can be "unhooked" after accurate code review - MS developers, I guess, simply didn't have enough time for that work because of VS2010 release schedule forced by MS marketing "army"...)... BTW, in that current context of VS2010 being "memory-hog" and slower than VS2008 it's a good time to start using Test Driven Development if you haven't yet started to use it.. Would be also great if MS will release VS2008 SP2 supporting C#4.0 and .NET Framework 4.0... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: 28 ??????? 2010 ?. 6:41 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Is VS 2010 extremely slow? I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- 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 shamil at smsconsulting.spb.ru Tue Dec 28 09:44:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 18:44:10 +0300 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From Gustav at cactus.dk Tue Dec 28 10:02:17 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 28 Dec 2010 17:02:17 +0100 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Tue Dec 28 13:03:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 22:03:25 +0300 Subject: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... In-Reply-To: References: Message-ID: <272AD233109B49728A5A39D959CAF68E@nant> Hi Gustav -- Yes, and with ASP.NET it even (a bit more) nasty: just changing reference to the newer version of Report Viewer Control 10.0 doesn't help. Some manual work is needed. A bit cryptic. And it starts working finally. Hint make new ASP.NET 4.0 Web Reporting project then compare web.config and .aspx files - and make manual editing... I will try to write more on that issue in coming days in I will have time... 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: 28 ??????? 2010 ?. 19:02 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) <<< snip >>> From listmaster at databaseadvisors.com Wed Dec 29 07:19:58 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Wed, 29 Dec 2010 08:19:58 -0500 Subject: [dba-VB] Administrivia - Server Upgrade Message-ID: Good morning folks, The server will be going down in half an hour, at approx 845 ET It will be down for approx 4-6 hours for a complete upgrade. I will send out another email, once we are all back up and running again. If you have any questions while the server is done, please get in touch with me at carbonnb at gmail.com -- Bryan Carbonnell - list master at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From listmaster at databaseadvisors.com Thu Dec 30 08:59:57 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 30 Dec 2010 09:59:57 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - UPDATE - Dec 30 @ 0955 Message-ID: Good Morning folks, I hope you didn't suffer too many withdrawals from not having your favourite lists yesterday and this morning. The Server upgrade was a challenge to say the least. A Royal PITA to say it closer to what it really was. There are still lots of things to work out, like putting the archives back online. Have no fear, your words of wisdom are being archived (for those lists that have archiving turned on), but the archives aren't available yet. The main goal was to get the lists back up and running, which it appears they are. If you encounter any abnormalities, please let me know ASAP so I can look into it. Things will slowly become normal again over the remainder of the week. Thanks for your patience. during the upgrade. -- Bryan Carbonnell - listmaster at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From shamil at smsconsulting.spb.ru Fri Dec 31 06:13:44 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 31 Dec 2010 15:13:44 +0300 Subject: [dba-VB] Ded Moroz sends you links on sample projects... :) Message-ID: <88C8330964FC47F7A753561E66B42346@nant> Hi All -- New Year Eve is approaching here, and I wanted to send you some gifts from Ded Moroz - here they are: This is a set of projects I have got developed a few days ago during 40+ hours R&D coding marathon. The task was to finish all the work in about 40 hours. So a few bugs left in there as release deadline wasn't possible to move. They (the bugs) are described in readme. But in general all the sample apps work rather well as my tests here show. I'd be interested to hear any comments - in what direction that sample should be better developed. Please write them here, or on http://northwind.codeplex.com . Please do not "judge severely" as as I noted that was very intensive R&D work with little time to think through while coding :) But feel free to comment it as you like. *Do not try* to be politcorrect. Please. I wish all of your Very Happy and Prosperous New Year! Thank you. -- Shamil P.S. Short description of published projects (the sources get downloaded 19 times already and I have got informed privately a couple of days ago just three people): NorthwindNET_4_0_Sources.zip (~24MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192044 NorthwindNET_4_0_SampleApps_Setup.zip (~5MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192043 Northwind.NET.VS2010.sln ======================== 1. Northwind.NET.EDM.FE - WinForms Front-End (just start-up class and app.config); 2. Northwind.NET.EDM.WinForms.Controls - UI UserControls; 3. Northwind.NET.EDM.Reports - MS ReportViewer 10.0 Reports; 4. Northwind.NET.BLL - Business Layer Library (ADO.NET EDM LINQ Reports' data sources); 5. Northwind.NET.Model - ADO.NET EDM; 6. Northwind.NET.Settings - application settings (wrappers); 7. Northwind.NET.Resources - application resource file; 8. Northwind.NET.Utilities - utility class library; 9. Northwind.NET.Testing.Console - some test functions - it's not true TDD - just a rough approximation; Northwind.NET.MSAccess.sln ========================== I. WinForms FE with MS Access backend Northwind.NET.FE.1.1 - Northwind.NET FE with MS Access backend Northwind.NET.Utilities - Utilities project II. ASP.NET sample application with MS Access backend E:/Projects/SMS/Northwind/Northwind.ASP.NET.MSAccess.Reporting/ - ASP.NET project III. Just a test ASP.NET app - can be removed E:\Projects\SMS\Northwind\Northwind.ASP.NET.MSAccess.Reporting.RDLC.10.0.0.0 Northwind.NET.zzz_OLD.sln ========================= 1. Northwind.NET.FE - WinForms Front-End with MS SQL backend using "plain old" ADO.NET data sets - the project we did last year's April. 2. All the other projects from as in Northwind.NET.VS2010.sln ----------- From jwcolby at colbyconsulting.com Fri Dec 31 20:56:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 31 Dec 2010 21:56:06 -0500 Subject: [dba-VB] Happy new year Message-ID: <4D1E97C6.3060000@colbyconsulting.com> To all our members around the world, may the new year be a good one. I am about to go down stairs and watch a movie with my wife, and ring in the new year with a glass of sparkling cider. If you party, do so with restraint. This is a particularly dangerous night to be out on the roads. Happy new year. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Wed Dec 1 00:20:26 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 09:20:26 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <001701cb910a$e5a7c8f0$b0f75ad0$@com.au> Message-ID: <97A3212846794197B97BAABCF7A3510D@nant> Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Wed Dec 1 03:04:44 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 10:04:44 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView head Message-ID: Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 05:20:01 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 1 Dec 2010 22:20:01 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001901cb9149$b20456a0$160d03e0$@com.au> Hi Shamil, I tried rdr.Dispose and still no luck. I don't think the datareader is the issue, it's the connection to the DB. I think the issue is not being able to set the value to nothing. Is there any way of setting the connection to nothing within a Using Statement? I appreciate your patience with me on this matter... Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 05:20:24 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 06:20:24 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001801cb910b$45a462e0$d0ed28a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com> <001801cb910b$45a462e0$d0ed28a0$@com.au> Message-ID: <4CF62F78.5070000@colbyconsulting.com> Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > 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 1 05:25:15 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:25:15 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head In-Reply-To: References: Message-ID: <698BA6DF81FF4146B59F3F59A5BC1A64@nant> Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. 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: 1 ??????? 2010 ?. 12:05 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Shamil Don't know about a DataGridView but for a tab control I used DrawItem. Nothing fancy: private void tabControlMail_DrawItem(object sender, DrawItemEventArgs e) { DrawTabColor(sender, e, Color.LightBlue, Color.Black, Color.BlueViolet, Color.Gray); } private void DrawTabColor(object sender, System.Windows.Forms.DrawItemEventArgs e, Color FocusedBackColor, Color FocusedForeColor, Color NonFocusedBackColor, Color NonFocusedForeColor) { Font myFont = new Font(e.Font, FontStyle.Regular); Brush backColorBrush; Brush foreColorBrush; StringFormat myFormat = new StringFormat(); TabControl tabControl = (TabControl)sender; Rectangle rectangle = new Rectangle(tabControl.Left , 15,tabControl.Width, tabControl.Height); backColorBrush = new System.Drawing.SolidBrush(Color.Linen); foreColorBrush = new System.Drawing.SolidBrush(Color.Gray); e.Graphics.FillRectangle(backColorBrush, rectangle); Console.WriteLine("s: " + this.tabControlMail.SelectedIndex.ToString ()+ ", e: " + e.Index.ToString()); if (e.Index == this.tabControlMail.SelectedIndex) { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(FocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(FocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 4, e.Bounds.Y, e.Bounds.Width - 6, e.Bounds.Height); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X + 1, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } else { myFont = new Font(e.Font, FontStyle.Regular); backColorBrush = new System.Drawing.SolidBrush(NonFocusedBackColor); foreColorBrush = new System.Drawing.SolidBrush(NonFocusedForeColor); this.tabControlMail.TabPages[e.Index].BackColor = Color.Linen; // FocusedBackColor; string tabName = this.tabControlMail.TabPages[e.Index].Text; Rectangle rect = new Rectangle(e.Bounds.X + 1, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height + 1); myFormat.Alignment = StringAlignment.Center; e.Graphics.FillRectangle(backColorBrush, rect); RectangleF r = new RectangleF(e.Bounds.X, e.Bounds.Y + 4, e.Bounds.Width, e.Bounds.Height - 4); e.Graphics.DrawString(tabName, myFont, foreColorBrush, r, myFormat); } myFormat.Dispose(); myFont.Dispose(); backColorBrush.Dispose(); foreColorBrush.Dispose(); } What are you trying to do? /gustav >>> shamil at smsconsulting.spb.ru 30-11-2010 19:44 >>> Hi All -- What is the best suitable event for custom drawing on a top/left cell of DataGridView ( .TopLeftHeaderCell)? .RowHeadersVisible = true Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 05:49:53 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 14:49:53 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head References: Message-ID: <1EC85A575A1845A3B3D1F1352912CF74@nant> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil <<< snip >>> From Gustav at cactus.dk Wed Dec 1 06:24:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 13:24:03 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.itags.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7&hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/346e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil From actebs at actebs.com.au Wed Dec 1 07:16:38 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:16:38 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <4CF62F78.5070000@colbyconsulting.com> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> Message-ID: <001a01cb9159$fc891430$f59b3c90$@com.au> Hi John, Wow! I'm just returning to application development after a 5 years absence. Destructor and Constructor classes are just a little out of my realm at the moment. I need to find a good resource that outlines classes use in VB.Net. Do you know of any? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, 1 December 2010 10:20 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Close DB Connection Vlad, Just as a class can have a constructor, it can have a destructor. The destructor (in c#) begins with the special character ~ Building a destructor is an art form ... http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx but basically looks like: class Car { ~Car() // destructor { // cleanup statements... } } All by itself building the destructor does not do you much good. Yes, it gives the GC something to call but the GC does that anyway. So we create a dispose method and a flag that says we have done that. http://www.informit.com/articles/article.aspx?p=101373&seqNum=13 public class Worker: System.IDisposable { private bool alreadyDisposed = false; public Worker() { System.Console.WriteLine("In the constructor."); } public void Dispose(bool explicitCall) { if(!this.alreadyDisposed) { if(explicitCall) { System.Console.WriteLine("Not in the destructor, " + "so cleaning up other objects."); // Not in the destructor, so we can reference other objects. //OtherObject1.Dispose(); //OtherObject2.Dispose(); } // Perform standard cleanup here... System.Console.WriteLine("Cleaning up."); } alreadyDisposed = true; } public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } ~Worker() { System.Console.WriteLine("In the destructor now."); Dispose(false); } } Having done all this, you place your explicit calls to the dispose method of things like connection objects in your dispose method. Then you manually call your dispose method when you are done with the class. This just cleans up all of the unmanaged objects in an organized fashion. John W. Colby www.ColbyConsulting.com On 11/30/2010 10:53 PM, ACTEBS wrote: > Hi John, > > Would you please give me an example of how you use the destructor class to > close an open db connection? I've researched it, but can't conceptualise how > you'd set it up. > > Many thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, 1 December 2010 12:47 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Close DB Connection > > I had a similar issue with connections to SQL Server. When I was > investigating the problem I > discovered that (in my case) the issue was that the garbage collector (GC) > was taking its sweet time > collecting the trash, and the connections were not released until the trash > was taken out. > > Understand that in my case I was creating classes which created a > collection, then I would destroy > the class. Since the GC does its thing whenever it decides that it needs to > free up memory, and > since I had a lot of memory, the GC decided to take its sweet time. > > Once I discovered destructors and dispose, my problems went away. > > John W. Colby > www.ColbyConsulting.com > > On 11/30/2010 8:06 AM, ACTEBS wrote: >> Hi Everyone, >> >> >> >> I've got this issue with my app where the app keeps it's connection to the >> Access DB open even after the application has finished it's task. I can't >> figure out for the life of me where I've missed closing it in the various >> Functions and Sub Routines. >> >> >> >> I've ensured that cn.Close and cn = Nothing, has been included in all the >> code where the DB is opened. The only place I can't include cn = Nothing > is >> when the connection is encapsulated within a Using Statement where for > some >> reason this is not allowed. Could this be the problem? If so, how can I >> release the connection? >> >> >> >> Also, is there any way of finding out which bit of code is keeping the >> connection open? >> >> >> >> Many Thanks >> >> >> >> Vlad >> >> >> >> >> >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > > > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Wed Dec 1 07:22:58 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 2 Dec 2010 00:22:58 +1100 Subject: [dba-VB] Close DB Connection In-Reply-To: <97A3212846794197B97BAABCF7A3510D@nant> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au> <97A3212846794197B97BAABCF7A3510D@nant> Message-ID: <001b01cb915a$df2502e0$9d6f08a0$@com.au> Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 1 07:45:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 01 Dec 2010 08:45:06 -0500 Subject: [dba-VB] Close DB Connection In-Reply-To: <001a01cb9159$fc891430$f59b3c90$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au> <4CF50049.6030803@colbyconsulting.com><001801cb910b$45a462e0$d0ed28a0$@com.au> <4CF62F78.5070000@colbyconsulting.com> <001a01cb9159$fc891430$f59b3c90$@com.au> Message-ID: <4CF65162.6020403@colbyconsulting.com> Vlad, The destructor is not a class but (kind of) a method of the class. The destructor is called when the last reference to the class is set to null, just as the constructor is called in the new MyClass(). By creating a destructor, and placing an explicit call to all unmanaged object's Dispose() methods, the dispose of all such unmanaged objects gets called immediately as the last pointer is set to null. AFAICT (and I am no expert, so anyone else is free to jump in here) what really happens is that: 1) You create an instance to your class. 2) In your class you create a pointer to an unmanaged object such as a sql server connection. 3) You use your class 4) You do not explicitly call the dispose() of the connection but... 5) You set the last pointer to your class to null (or exit the block that defined your class)... Now... the instance of your class still sits in memory until the GC decides it needs the memory that your class takes up, but it may be quite some time before it does so. AFAICT when the GC actually gets around to disposing of the memory, it explicitly attempts to call Dispose() of any unmanaged object (ignoring errors if the unmanaged object does not have a dispose method) so *at that time* the unmanaged object is finally released. By your creating a destructor and explicitly calling the unmanaged object's dispose() method in the destructor, the unmanaged object is released at the instant the last pointer to the class is set to null (when the containing block is exited). Thus YOU decide the timing, rather than the GC deciding the timing. This was an issue to me because I was creating thousands of connections in a very short period of time. Because the GC decided I had lots of memory and it didn't need to take out the trash for long periods, I ran out of connections. By explicitly creating destructors in every class that created a connection, and explicitly calling the dispose() of the connection (unmanaged object) in the destructor, I explicitly released the connection at the instant that the class was destroyed rather than when the GC ran, and my problems went away. Or at least this is my understanding of the process. What I know is that my problems went away when I did this. It is a PITA to create the destructor and all the code to correctly manage it but once done you are gold (for that class). Just remember to place calls to dispose() in the destructor for all unmanaged objects. John W. Colby www.ColbyConsulting.com On 12/1/2010 8:16 AM, ACTEBS wrote: > Hi John, > > Wow! I'm just returning to application development after a 5 years absence. > Destructor and Constructor classes are just a little out of my realm at the > moment. > > I need to find a good resource that outlines classes use in VB.Net. Do you > know of any? > > Thanks > > Vlad From shamil at smsconsulting.spb.ru Wed Dec 1 08:39:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 17:39:51 +0300 Subject: [dba-VB] Close DB Connection In-Reply-To: <001b01cb915a$df2502e0$9d6f08a0$@com.au> References: <001201cb908f$7512cac0$5f386040$@com.au><001701cb910a$e5a7c8f0$b0f75ad0$@com.au><97A3212846794197B97BAABCF7A3510D@nant> <001b01cb915a$df2502e0$9d6f08a0$@com.au> Message-ID: Hi Vlad -- Yes, that's OK to call .Dispose() on every iteration - you're disposing current instance. When you just create a new instance by using the same object variable previous instance isn't getting disposed: it's supposed to get disposed later by Garbage Collector (GC). I must note I have never used .Dispose() for OleDbCommand and all worked well - checked with memory profiler as I noted here about yesterday. But I didn't use OleDbCommand with parameters. In your case it could also be that you use parameters and you use OleDbDataReader instance reference to set parameter values. My (wild) guess is that VS uses some optimization while translating your code into IL, and that translation results in OleDbDataReader reference "captured" by OleDbCommand reader. Then you have many cycles of rdr.Read() and on every cycle a new instance of OleDbCommand is created, and a previous one is left hanging with OleDbDataReader instance referenced from parameters. Then GC doesn't work well/promptly somehow. If you write a function to get values from OleDbDatReader: private function getFieldValue(ByRef rdr as OleDbDataReader, ByVal fldName as string) as string return rdr(fldName).ToString() end function your issue might get solved "automagically". But that is just a guess. I'd also note that the way you set parameters doesn't look good enough from here - I mean internationalization issues, which may arise if you'll use you program with different formats of day/time. (My above function sample isn't good from internationalization point of view too). If you drop using parameterized OleDbCommand and return to plain dumb string.Format(....) to make Insert sql command text it would be easier to handle internationalization issues IMO, and also you can just create OleDbCommand once and then set its connection property before your While(rdr.read()) cycle, and set CommandText property on every iteration, and then calling .Dispose within every cycle will not be needed as you'll use the same OleDbCommand instance, and I suppose calling .Dispose for OleDbCommand after End While will not be needed at all... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 16:23 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, I've gotten to the bottom of it. I needed to dispose of the OleDb.OleDbCommand. I simply added cmd2.Dispose within the While Statement and all is good. I doesn't seem to have had any unusual performance hit, but I do find it strange that you need to dispose of it at every iteration. Do you think that's a problem? Code: While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDb.OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() cmd2.Dispose() End While Many thanks for all your guidance... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 5:20 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Vlad -- <<< Thanks for that, but it didn't work >>> I did use rdr.Dispose() after rdr.Close() in my sample code . Try it... It will work. Sorry, I didn't use .Dispose() in my first sample in AccessD - but that has had "quick&dirty disclaimer" as I noted that time. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 1 ??????? 2010 ?. 6:50 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hi Shamil, Thanks for that, but it didn't work. I've traced it down and finally found the he offending code which is below. Can you see anywhere that I can set the connection to nothing? Like I said, you can't set the connection to nothing when it's within a Using Statement. Funnily enough, you can set the OleDbDataReader to nothing though... Public Sub AppendTempDataToMainTbl(ByVal strUniColumnName As String) Dim sourceDbFullPath As String = App_Path() & "TempImport.mdb" Dim destionationDbFullPath As String = GetIniSetting("DBPath", "SystemSettings") Try Using sourceConnection As New OleDbConnection(GetSourceConnectionString) sourceConnection.Open() Dim sql1 As String = "SELECT * FROM tblTempImport WHERE TempID > 10" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) Dim rdr As OleDbDataReader = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(GetDestConnectionString) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("INSERT INTO tblMainData (HeaderID, UnitID, RecDate, RecTime, RecDateTime, " & _ "Celsius) values (@HeaderID, at UnitID, at RecDate, at RecTime, at RecDateTime, at Celsius)") Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.Parameters.Add("@HeaderID", OleDbType.Integer).Value = gHeaderID cmd2.Parameters.Add("@UnitID", OleDbType.Integer).Value = gUnitID cmd2.Parameters.Add("@RecDate", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@RecDateTime", OleDbType.Date).Value = rdr("RecDate").ToString() cmd2.Parameters.Add("@Celsius", OleDbType.Double).Value = rdr(strUniColumnName).ToString() cmd2.ExecuteNonQuery() End While destinationConnection.Close() destinationConnection.Dispose() If destinationConnection.State.ToString IsNot Nothing Then destinationConnection.Close() destinationConnection.Dispose() 'destinationConnection = Nothing End If End Using rdr.Close() rdr = Nothing sourceConnection.Close() sourceConnection.Dispose() 'sourceConnection = Nothing If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() rdr = Nothing End If End Using Finally End Try End Sub Thnaks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, 1 December 2010 12:31 AM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Close DB Connection Hello Vlad -- Non-closed OleDbDataReader can keep connection objects alive (not collected by GC) - you can use the following coding style to have OleDbDataReader always closed and connection objects released automatically: Public Shared Sub Run() Dim rdr As OleDbDataReader = Nothing Dim sourceDbFullPath As String = "c:\temp\sourceDb.mdb" Dim destionationDbFullPath As String = "c:\temp\targetDb.mdb" Try Using sourceConnection As New OleDbConnection(MakeAccDdbConnectionStr(sourceDbFullPath)) sourceConnection.Open() Dim sql1 As String = "select [SourceField] from [SourceTable]" Dim cmd1 As New OleDbCommand(sql1, sourceConnection) rdr = cmd1.ExecuteReader() Using destinationConnection As New OleDbConnection(MakeAccDdbConnectionStr(destionationDbFullPath)) destinationConnection.Open() While rdr.Read() Dim sql2 As String = String.Format("insert into [MyTable](MyField) values ('{0}')", rdr("SourceField").ToString()) Dim cmd2 As New OleDbCommand(sql2, destinationConnection) cmd2.ExecuteNonQuery() End While End Using rdr.Close() rdr.Dispose() rdr = Nothing End Using Finally If rdr IsNot Nothing Then rdr.Close() rdr.Dispose() End If End Try End Sub .NET Memory Profiler (http://memprofiler.com/) is a great tool, which helped me to solve all the memory leakage issues in a large VS2008 solution having about 40 projects. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 30 ?????? 2010 ?. 16:07 To: 'dba-vb' Subject: [dba-VB] Close DB Connection Hi Everyone, I've got this issue with my app where the app keeps it's connection to the Access DB open even after the application has finished it's task. I can't figure out for the life of me where I've missed closing it in the various Functions and Sub Routines. I've ensured that cn.Close and cn = Nothing, has been included in all the code where the DB is opened. The only place I can't include cn = Nothing is when the connection is encapsulated within a Using Statement where for some reason this is not allowed. Could this be the problem? If so, how can I release the connection? Also, is there any way of finding out which bit of code is keeping the connection open? Many Thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Wed Dec 1 09:00:47 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 1 Dec 2010 18:00:47 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <93125E633C84416C87A4A89117ADED7C@nant> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 12:49 >>> Gustav -- I have currently used - Form.DefaultBackColor - that helped as my form backcolor is the same as gridview's rowheaders backcolor (see code below) - I'd still be interested is there a way to use .RowHeader cell's Style.BackColor to paint row header background without row selection arrow. There should be a "trick" I'm missing as .RowHeader cell's Style.BackColor is equal to [Control] system color, which is R(0),G(0),B(0) when you get it via code but it's in fact a very light gray color here. The trick should be somehow related to the fact that I'm getting Graphics (g variable) from GridView Handle, and then Style.BackColor becomes invisible - I should probably get Graphics somehow else or convert color before using it but I do not know how... private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { PlusMinusDrawer.Draw(dataGridView1, e, true, Form.DefaultBackColor); } ..... public class PlusMinusDrawer { public static void Draw(DataGridView grid, DataGridViewRowPostPaintEventArgs e, bool drawPlus, Color givenBackColor) { DataGridViewCell cell = null; Color usedBackColor = Color.LightGray; if (givenBackColor != null) usedBackColor = givenBackColor; if (e.RowIndex == 0) { cell = grid.TopLeftHeaderCell; //usedBackColor = cell.Style.BackColor; drawPlusMinus(cell, 0, drawPlus, usedBackColor); } DataGridViewCell cell1 = grid.Rows[e.RowIndex].HeaderCell; //usedBackColor = cell1.Style.BackColor; drawPlusMinus(cell1, e.RowBounds.Y, drawPlus, usedBackColor); } private static void drawPlusMinus(DataGridViewCell cell, int offsetY, bool drawPlus, Color backColor) { Graphics g = null; System.Drawing.Pen pen = null; Brush brush = null; try { DataGridView grid = cell.DataGridView; Rectangle headerBounds = new Rectangle(2, offsetY + 2, cell.Size.Width - 4, cell.Size.Height - 4); brush = new System.Drawing.SolidBrush(backColor); g = Graphics.FromHwnd(grid.Handle); pen = new System.Drawing.Pen(Color.Black, 2F); g.FillRectangle(brush, headerBounds); int offsetX = 0; int padX = 2; int padY = 2; int h2 = cell.Size.Height - padY * 2; int w2 = grid.RowHeadersWidth - padX * 2; int h = h2 / 2; int w = w2 / 2; int height = 14; // vertical line height int width = 14; // horisontal line width System.Drawing.Point[] p = new System.Drawing.Point[4]; // horizontal line p[0].X = 0 + offsetX + w - width / 2 + padY; p[0].Y = h + offsetY + padY; p[1].X = 0 + offsetX + w + width / 2 + padY; p[1].Y = h + offsetY + padY; g.DrawLine(pen, p[0], p[1]); if (drawPlus) { // vertical line p[2].X = w + offsetX + padX; p[2].Y = 0 + offsetY + padY + h - height / 2; p[3].X = w + offsetX + padX; p[3].Y = 0 + offsetY + padY + h + height / 2; g.DrawLine(pen, p[2], p[3]); } } finally { if (brush!= null) brush.Dispose(); if (pen != null) pen.Dispose(); if (g != null) g.Dispose(); } } } Thank you. -- Shamil -----Original Message----- From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru] Sent: 1 ??????? 2010 ?. 14:25 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: RE: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView head Hi Gustav -- Thank you for your sample code. I have to simulate hierarchical GridView (just one level) using DataGridView (I do not use third-party controls - that's my customer requirement). I do use RowPostPaint event to draw (+) - collpased , and (-) - expanded row sign on row header cells as well as on top-left cell - the latter is used to note/control collapsed/expanded datagridview rows on first level. All works fine except that I cannot find how to suppress/hide row selector arrow - when I use: - DataGridViewCell's .Style.BackColor to paint RowHeader cell's background - SelectionMode = CellSelect - ShowEditingIcon = False the record selector is still visible. I have to use custom color - Color.LightGray to paint it over. Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Wed Dec 1 16:28:18 2010 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 01 Dec 2010 23:28:18 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav From shamil at smsconsulting.spb.ru Wed Dec 1 16:58:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 01:58:21 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <00263D45306144F1AB39894F91360A4E@nant> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 16:00 >>> Hi Gustav -- Thank you. Yes, that should help. I must note I didn't google for that somehow - just for RowPostPaint event. It looks simple now - just information how to draw on left-top cell is missing. You're so quick with googling could you find that information? :) (If you'll not find it quickly in your free time - forget it... ) <<< Or could you do that and then use column 0 to simulate the row headers? >>> I wanted to use row headers - yes, simulation seems to be an "easy way to go" - but I'd prefer row headers, which have special display view and properties, which I do not want to spend time on simulation implementation... 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: 1 ??????? 2010 ?. 15:24 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I see. If you didn't need to draw your +/- you could just remove the row headers. Or could you do that and then use column 0 to simulate the row headers? This: http://webcache.googleusercontent.com/search?q=cache:lC1xHEMKuvUJ:dotnet.ita gs.org/web-forms/121172/+%22C%23%22+DataGridView+show+rowselector+arrow&cd=7 &hl=da&ct=clnk&gl=dk located in the Google cache suggests: Handle the RowPostPaint event (Code Snippet): void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); } Also, I located this thread which, however, perhaps collides with your +/- drawing: http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/34 6e5839-1813-472b-8b3a-7344118819b3 You may have seen it before (I just googled) but the topic seems pretty close to that of yours. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 04:27:10 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 11:27:10 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From shamil at smsconsulting.spb.ru Thu Dec 2 06:22:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 2 Dec 2010 15:22:18 +0300 Subject: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView In-Reply-To: References: Message-ID: <97D4BD40E52F4C43AC4CA44AEC90560E@nant> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Dec 2 07:56:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 02 Dec 2010 14:56:47 +0100 Subject: [dba-VB] WinForms: What is the best event for custom drawing on a leftmost cell of DataGridView Message-ID: Hi Shamil That sounds like a good approach. I just wondered because the option to build custom controls is promoted quite a lot. /gustav >>> shamil at smsconsulting.spb.ru 02-12-2010 13:22 >>> Hi Gustav -- No, I didn't turn it into a generic custom control. That coding (which I have put in a class library) is used within a custom control (UserControl) with a custom business functionality. I do not develop generic custom controls. But I do develop applications' UI using custom controls - WinForm (with a TabControl, with TableLayout and/or Splitter controls) are used just as a "frame" to put custom user controls in. That way happens to be here the most effective development approach in context of constantly changing customers' requirements. Recap: 1. I do put generic functionality in class libraries. 2. I do not develop generic custom controls. 3. I do "religiously" try to keep UI blocks' custom functionality within dedicated custom controls. 4. I do use "copy&paste" these days when I do not expect that a generic functionality will be used in more than three-four cases but even if I expect it will, I'm often "procrastinating" to develop a generic solution until such a generic functionality will be really needed to reuse here and to save quite a few time for further development and support... ... 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: 2 ??????? 2010 ?. 13:27 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil Quite tricky, I must say. So now you have turned all this into a custom control of yours? I've never made such (haven't had the need) but wouldn't this be a good example? /gustav >>> shamil at smsconsulting.spb.ru 01-12-2010 23:58 >>> Hi Gustav -- Google didn't help here. I finally used .Paint event to draw on TopLeftCell, .RowPostPaint to draw on RowHeaders with custom drawing in both cases. And (your google hint) e.PaintHeader(DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentBackground); to suppress arrow. It works fine now. 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: 2 ??????? 2010 ?. 1:28 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] WinForms: What is the best event for custom drawing ona leftmost cell of DataGridView Hi Shamil I guess you have googled what you need to at this moment ... The one strange thing about the row selectors is the default large width. Too wide in my opinion. /gustav From jwcolby at colbyconsulting.com Thu Dec 2 09:06:57 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 02 Dec 2010 10:06:57 -0500 Subject: [dba-VB] How to - Test environment Message-ID: <4CF7B611.7090706@colbyconsulting.com> I am trying to figure out how to do a test environment for C# development. I have a SQL Server with a bunch of application specific databases. We are developing a custom C# application to drive this business. My problem is that ATM I cannot run the program while my developer is working on the application because we are operating out of the same database. Due to the size of the database and my finances, cloning it on a dev environment server is not feasible. This means I need a software solution. My solution as of this morning is to add a field to the supervisor table that is either null (default) or holds a machine name string. By adding a couple of controls in the application I can fill in this field with a machine name when a "test" check box is set in the interface form and we add a record to that table. Then when anyone runs the program, the code checks for the test checkbox and only pulls records for that machine if the check box is set. This seems rather kludgy. If anyone has addressed this, please let me know how you are doing it. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:14:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:14:30 -0500 Subject: [dba-VB] Thread safe list Message-ID: <4CF8ED36.8070906@colbyconsulting.com> I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 3 07:40:21 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 16:40:21 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8ED36.8070906@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com> Message-ID: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Hi John -- I do use a dedicated static object instance to lock shared lists, dictionaries, ... (obviously psuedocode) Dictionary<> Dict; private static object _dictLocker = new object(); public void AddObjToList(obj) { lock(_dictLocker) { Dict.Add(); } } private GetObjFromList() { lock(_dictLocker) { Obj = Dict[0]; } Continue processing Obj here... } Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:15 To: VBA Subject: [dba-VB] Thread safe list I am using two threads in a part of my application. One places objects onto a list for processing. Another gets pointers to objects on the list for processing, and later removes those objects from the list when processing is complete. From my reading, this has to be synchronized with locking of some sort since a simultaneous write by one thread while reading by the other will cause corruption of some sort. I have found discussions about how it is necessary to do so but no clear example of two different methods actually locking / unlocking the collection object. In my class I have a class global dictionary object. I have one (public) method called from outside of the class to place an object onto the list. I have another (private) method called by the class to get an object on the list and use it. Can I simply wrap the actual object with a lock in each method? (obviously psuedocode) Dictionary<> Dict; public void AddObjToList(obj) { lock(Dict) { Dict.Add(); } } private GetObjFromList() { lock(Dict) { Obj = Dict[0]; } Continue processing Obj here... } Will something this simple actually work? Can someone provide simple psuedocode that shows how to do this? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 07:41:55 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:41:55 -0500 Subject: [dba-VB] C# and .Net 4.0 Message-ID: <4CF8F3A3.4050806@colbyconsulting.com> Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 07:57:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 08:57:06 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> References: <4CF8ED36.8070906@colbyconsulting.com> <2A9A4317BC4C4E1A9953E4E74CB10E35@nant> Message-ID: <4CF8F732.3010703@colbyconsulting.com> OK, two questions: 1) Does it have to be static? 2) My "GetObjFromList" actually uses a foreach(). It seems that is not going to work so well... Basically all of the work is done inside of that ForEach which would block the thread placing objects onto the list for long periods. Is it possible to somehow use ForEach and lock of the object being iterated or am I going to have to move to a do loop construct where I lock / grab an object / process? John W. Colby www.ColbyConsulting.com On 12/3/2010 8:40 AM, Shamil Salakhetdinov wrote: > Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places objects onto > a list for processing. > Another gets pointers to objects on the list for processing, and later > removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some sort > since a simultaneous write by one thread while reading by the other will > cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no clear > example of two different methods actually locking / unlocking the collection > object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place an > object onto the list. I have another (private) method called by the class > to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] C# and .Net 4.0 In-Reply-To: <4CF8F3A3.4050806@colbyconsulting.com> References: <4CF8F3A3.4050806@colbyconsulting.com> Message-ID: John -- As far as I see you can't create .NET Framework 4.0 projects in VS2008. :( Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 16:42 To: VBA Subject: [dba-VB] C# and .Net 4.0 Is .Net 4.0 usable from VS 2008 or do I have to move to 2010? It seems that .Net 4.0 has thread safe collections and stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 10:00:41 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 19:00:41 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF8F732.3010703@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> Message-ID: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Hi John -- 1. Yes, static. Object ref isn't thread-safe AFAIU. 2. Yes, foreach isn't good. You can use int count = getCount(); // getCount should use locking for (int i=0; i Hi John -- > > I do use a dedicated static object instance to lock shared lists, > dictionaries, ... > > (obviously psuedocode) > > Dictionary<> Dict; > private static object _dictLocker = new object(); > > public void AddObjToList(obj) > { > lock(_dictLocker) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(_dictLocker) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 16:15 > To: VBA > Subject: [dba-VB] Thread safe list > > I am using two threads in a part of my application. One places > objects onto a list for processing. > Another gets pointers to objects on the list for processing, and > later removes those objects from the list when processing is complete. > > From my reading, this has to be synchronized with locking of some > sort since a simultaneous write by one thread while reading by the > other will cause corruption of some sort. > > I have found discussions about how it is necessary to do so but no > clear example of two different methods actually locking / unlocking > the collection object. > > In my class I have a class global dictionary object. > > I have one (public) method called from outside of the class to place > an object onto the list. I have another (private) method called by > the class to get an object on the list and use it. > > Can I simply wrap the actual object with a lock in each method? > > (obviously psuedocode) > > Dictionary<> Dict; > > public void AddObjToList(obj) > { > lock(Dict) > { > Dict.Add(); > } > } > private GetObjFromList() > { > lock(Dict) > { > Obj = Dict[0]; > } > > Continue processing Obj here... > } > > > Will something this simple actually work? Can someone provide simple > psuedocode that shows how to do this? > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 3 13:39:03 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 14:39:03 -0500 Subject: [dba-VB] PGP Message-ID: <4CF94757.1070005@colbyconsulting.com> Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 3 14:15:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 03 Dec 2010 15:15:43 -0500 Subject: [dba-VB] Thread safe list In-Reply-To: <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com> <7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> Message-ID: <4CF94FEF.8010902@colbyconsulting.com> I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking > for (int i=0; i { > MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, which will > be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that advanced > stuff... > > Thank you. > > -- > Shamil From shamil at smsconsulting.spb.ru Fri Dec 3 14:25:58 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 3 Dec 2010 23:25:58 +0300 Subject: [dba-VB] Thread safe list In-Reply-To: <4CF94FEF.8010902@colbyconsulting.com> References: <4CF8ED36.8070906@colbyconsulting.com><2A9A4317BC4C4E1A9953E4E74CB10E35@nant> <4CF8F732.3010703@colbyconsulting.com><7FBDC38D6A3E45F6BFEAFA3C6BE17547@nant> <4CF94FEF.8010902@colbyconsulting.com> Message-ID: <2CAA780B74744345B7B244545399626D@nant> John -- <<< I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? >>> Yes. You can serialize/deserialize whole collections. No need to program imperatively such serialization/deserialization usually. Just Xml attributes and tiny generic serialize/deserialize methods will do all the tricks. It would be lighting fast for your collections having under hundred objects. Folks tend to use JSON for serialization/deserialization these days. But I haven't used it yet. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 23:16 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Thread safe list I saw something about locking the object, then doing a deep copy and using the copy. Have you ever done this? My collections are always well under a hundred objects and the objects are just pointers (and the key) so it seems like a deep copy of the dictionary should be lightning fast. Then I could use the ForEach on the copy and all would be right in the world. > (Advanced) thread-safe multi-threading is "another song" - a way more complicated than ordinary programming. We have moved to using threads for every time intensive task, but also using events to signal that we are finished with a time intensive task. For example we: 1) Build a database (fast) and then build a table, populate it with (tens of) millions of records and build a bunch of indexes (SLOW). The table build can take minutes to complete. We run that whole process on a thread and the very end of the process raises an event. The event sets a flag and throws a status object up the chain for display on the form, then exits (the thread). 2) A thread then creates a chunk table, pulls a set of up to two million records into a table, creates indexes etc (slow - up to a minute or more) and then raises an event which sets a flag and throws a status object up the chain for display on the form. 3) A thread then BCPs out that chunk table (slow - up to a minute or more) and raises an event which sets a flag, and throws a status object up the chain for display on the form. Steps 2 and 3 repeat until all records are BCPd to files on disk. This all happens in a custom database class which has a collection of ProcessFile objects (each of which is a chunk). A supervisor object (owns the ProcessFile objects) places ProcessFile objects into the collection in the database object. and the database object is responsible for getting the data out of SQL Server, getting the chunks, and BCPing them out. So the supervisor and the database are both accessing the collection that holds the ProcessFile objects, each using its own thread. All of that stuff is just "Stage1 - SQL Server to Staging". We have other classes which manage getting these files into a VM for processing and getting the resulting (processed) files back from the VM and back into SQL Server. This whole thing is morphing into a pretty well defined object model where each object has clearly defined responsibilities. I say morphing because it evolved from about 50-80 user stored procedures out on sql server, manually executed by hand from a list written on paper. Boy is C# / SQL Server faster, easier and more reliable than jwc keying stuff into a query window while reading a check list. ;) The key though is these collections where we place supervisors and ProcessFiles for processing, and these lists (the process file lists) are hit from two sides by independent threads - one placing items into the lists and the other getting them out of the lists for processing. Fun, efficient but tricky. John W. Colby www.ColbyConsulting.com On 12/3/2010 11:00 AM, Shamil Salakhetdinov wrote: > Hi John -- > > 1. Yes, static. Object ref isn't thread-safe AFAIU. > 2. Yes, foreach isn't good. You can use > > int count = getCount(); // getCount should use locking for (int i=0; > i MyClass obj = getObject(i); // getObject should use locking as well as to > have try/catch > } > > Obvisouly while iterating that way you can loose/skip some items, > which will be inserted/deleted by parallel threads. > > (Advanced) thread-safe multi-threading is "another song" - a way more > complicated than ordinary programming. > I'm not 100% sure my abive sample doesn't have some "hidden glitches". > > It' s time to master PLINQ, lamda-expressions, functional programming > principles, RESTFul web services,.... to name a few. > > The above is a "to do learning list" for myself also :) - I'm not yet there. > And I'm not sure I will find good enough time to master all that > advanced stuff... > > Thank you. > > -- > Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Fri Dec 3 18:45:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 03:45:54 +0300 Subject: [dba-VB] Observations on VS2008 - not good but having simple workarounds ... Message-ID: Hi All -- Just echoing Mark Simms' thread from AccessD ("Observations on AC 2007) :) - here is one of VS2008 "glitches": http://sms-web.biz/ss/nierr.jpg I mean that cryptic and with a cut ending part error message which you can see on the above screenshot reported by VS2008 while in design mode. The only solution to this issue was to quit & start VS2008 again - and it worked fine. That happens with VS2008, it can also GPF once in a while etc. So, when you get stuck with such VS2008 issues try to "Clean All" followed by "Rebuild All" - if that would not help then just restart VS2008 - in 90% of cases that "simple trick" helps... Thank you. -- Shamil From stuart at lexacorp.com.pg Fri Dec 3 23:43:46 2010 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 04 Dec 2010 16:43:46 +1100 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CF9D512.22578.1E2F04EE@stuart.lexacorp.com.pg> http://www.gnupg.org/ The GNU Privacy Guard GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications. A wealth of frontend applications and libraries are available. Version 2 of GnuPG also provides support for S/MIME. GnuPG is Free Software (meaning that it respects your freedom). It can be freely used, modified and distributed under the terms of the GNU General Public License . GnuPG comes in two flavours: 1.4.11 is the well known and portable standalone version, whereas 2.0.16 is the enhanced and somewhat harder to build version. Project Gpg4win provides a Windows version of GnuPG. It is nicely integrated into an installer and features several frontends as well as (German) manuals. -- Stuart On 3 Dec 2010 at 14:39, jwcolby wrote: > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Dec 4 06:38:52 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 15:38:52 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CF94757.1070005@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> Message-ID: Hi John -- If the task is to just use cryptography to encrypt/decrypt data sent via Internet then you can use .NET built-in advanced cryptography classes/algorithms: http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec tionID=60 http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 5053700AM/CryptographyInDotNET.aspx http://www.codeproject.com/KB/security/dotnetcryptog.aspx Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 3 ??????? 2010 ?. 22:39 To: VBA Subject: [dba-VB] PGP Is anyone using PGP? Is there a free / public domain version? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 10:43:07 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 11:43:07 -0500 Subject: [dba-VB] PGP In-Reply-To: References: <4CF94757.1070005@colbyconsulting.com> Message-ID: <4CFA6F9B.5000804@colbyconsulting.com> PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent via > Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > 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 shamil at smsconsulting.spb.ru Sat Dec 4 11:46:46 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 4 Dec 2010 20:46:46 +0300 Subject: [dba-VB] PGP In-Reply-To: <4CFA6F9B.5000804@colbyconsulting.com> References: <4CF94757.1070005@colbyconsulting.com> <4CFA6F9B.5000804@colbyconsulting.com> Message-ID: John -- PGP uses IDEA algorithm by default they say here: http://stackoverflow.com/questions/3321174/what-algorithm-does-pgp-use-to-en crypt-the-private-key-using-the-passphrase Try to google it for C# implementation: http://www.google.ru/#hl=ru&&sa=X&ei=R336TK3pAoXsOdzE4NQK&sqi=2&ved=0CC4QBSg A&q=C%23+IDEA+algorithm+implementation&spell=1&fp=eb9a0cff6abb8ea8 If that will not work then it should not be a big issue to wrap a free command line PGP (GNU?) utility into a C# class library simple API activating such utility and collecting its results... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 4 ??????? 2010 ?. 19:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] PGP PGP appears the be the gold standard for my client's industry. LOTS of folks tell me that I have to use PGP, though most accept Zip's "encryption". So I really want a C# driven PGP solution. I have looked and have never found anything that demonstrates an easy to program PGP solution. Most PGP solutions are like what Stuart suggested, a command line driven something. John W. Colby www.ColbyConsulting.com On 12/4/2010 7:38 AM, Shamil Salakhetdinov wrote: > Hi John -- > > If the task is to just use cryptography to encrypt/decrypt data sent > via Internet then you can use .NET built-in advanced cryptography > classes/algorithms: > > http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1& > SubSec > tionID=60 > > http://www.c-sharpcorner.com/UploadFile/Suprotim/CryptographyInDotNET1 > 128200 > 5053700AM/CryptographyInDotNET.aspx > > http://www.codeproject.com/KB/security/dotnetcryptog.aspx > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 3 ??????? 2010 ?. 22:39 > To: VBA > Subject: [dba-VB] PGP > > Is anyone using PGP? Is there a free / public domain version? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 16:26:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 17:26:43 -0500 Subject: [dba-VB] use a font in a class Message-ID: <4CFAC023.7010905@colbyconsulting.com> I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:52:18 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:52:18 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: Hi John -- What is that for: Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ? Note that you have new Font(Font, ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sat Dec 4 16:55:34 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 01:55:34 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAC023.7010905@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> John -- You can use: Font font = new Font(this.Font, FontStyle.Bold); Ignore my prev. posting in this thread. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 1:27 To: VBA Subject: [dba-VB] use a font in a class I am defining a system for displaying a status on a form. We have a listview object, in which we create three columns, then push stuff into the list using the following coed: private void UpdateStage1Status(StatusEventArgs stEvArgs) { Font bold = new Font(Font, FontStyle.Bold); //to make the font bold ListViewItem item; item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The image to display for the row //item.BackColor = stEvArgs.pColor; item.UseItemStyleForSubItems = false; //need to set this to allow changing font color item.SubItems.Add(stEvArgs.pDte.ToString()); //date item.SubItems.Add(stEvArgs.pObjectPath); //object path item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); //status text } Now I want to wrap the list and this code in a class so that I do not have to have all this (and other) stuff in the form. The problem is that the line Font bold = new Font(Font, FontStyle.Bold); //to make the font bold won't compile in a class. It complains that Font bold = new Font(Font That last class is bad (can't be inherited). AFAICT (just a guess) that Font reference only works in a form. Is there any way other than passing the font in to this method to us the code as written (in a class)? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 17:25:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:25:25 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com> Message-ID: <4CFACDE5.2000003@colbyconsulting.com> Yes, to set the font for a specific column. > Note that you have > new Font(Font, Yes, I know. I didn't write the code, but if I try to mod that part (for ecample lowercase the first letter) it won't compile. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:52 PM, Shamil Salakhetdinov wrote: > Hi John -- > > What is that for: > > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > > ? > > Note that you have > > new Font(Font, ... > > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Dec 4 17:27:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 18:27:30 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> References: <4CFAC023.7010905@colbyconsulting.com> <1C00F7426B354CD19B1F39B2D5E3FEA8@nant> Message-ID: <4CFACE62.8040608@colbyconsulting.com> Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff into the > list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, bold); > //status text > } > > Now I want to wrap the list and this code in a class so that I do not have > to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) that > Font reference only works in a form. > > Is there any way other than passing the font in to this method to us the > code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 4 17:46:51 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 02:46:51 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFACE62.8040608@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: But you can pass form's Font instance to your class as a parameter, dont' you?... Or you can create a Font instance in your class, don't you? Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 2:28 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class Yes, in a form that works because "this" has a font. In a class, "this" is the class (not a form) which doesn't have a font. John W. Colby www.ColbyConsulting.com On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: > John -- > > You can use: > > Font font = new Font(this.Font, FontStyle.Bold); > > Ignore my prev. posting in this thread. > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 1:27 > To: VBA > Subject: [dba-VB] use a font in a class > > I am defining a system for displaying a status on a form. We have a > listview object, in which we create three columns, then push stuff > into the list using the following coed: > > private void UpdateStage1Status(StatusEventArgs stEvArgs) { > Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold > ListViewItem item; > item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The > image to display for the row > //item.BackColor = stEvArgs.pColor; > item.UseItemStyleForSubItems = false; //need to set this to > allow changing font color > item.SubItems.Add(stEvArgs.pDte.ToString()); //date > item.SubItems.Add(stEvArgs.pObjectPath); //object path > item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, > bold); //status text > } > > Now I want to wrap the list and this code in a class so that I do not > have to have all this (and > other) stuff in the form. > > The problem is that the line > > Font bold = new Font(Font, FontStyle.Bold); //to make the font bold > > won't compile in a class. It complains that > > Font bold = new Font(Font > > That last class is bad (can't be inherited). AFAICT (just a guess) > that Font reference only works in a form. > > Is there any way other than passing the font in to this method to us > the code as written (in a class)? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 19:25:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 20:25:19 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> Message-ID: <4CFAE9FF.4030403@colbyconsulting.com> > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, "this" is > the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:39:07 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:39:07 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAE9FF.4030403@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> Message-ID: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> John -- Did you try it like that?: //----------------------------------------- using System.Drawing; ... Font font = new Font("Arial", 3.1f); System.Console.WriteLine("{0}", font); // the above line will output: //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] //----------------------------------------- with System.Windows.Forms and System.Drawing references set? It works here in console app or class lib. I have used something like that many times... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 4:25 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class > But you can pass form's Font instance to your class as a parameter, dont' you?... Yes, that is what I am having to do. > Or you can create a Font instance in your class, don't you? No, that is the original problem email. The code to do that fails in a class. Unless you have another way to do it that the code I sent. John W. Colby www.ColbyConsulting.com On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Or you can create a Font instance in your class, don't you? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 2:28 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > Yes, in a form that works because "this" has a font. In a class, > "this" is the class (not a form) which doesn't have a font. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >> John -- >> >> You can use: >> >> Font font = new Font(this.Font, FontStyle.Bold); >> >> Ignore my prev. posting in this thread. >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 1:27 >> To: VBA >> Subject: [dba-VB] use a font in a class >> >> I am defining a system for displaying a status on a form. We have a >> listview object, in which we create three columns, then push stuff >> into the list using the following coed: >> >> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >> ListViewItem item; >> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >> image to display for the row >> //item.BackColor = stEvArgs.pColor; >> item.UseItemStyleForSubItems = false; //need to set this to >> allow changing font color >> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >> item.SubItems.Add(stEvArgs.pObjectPath); //object path >> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >> bold); //status text >> } >> >> Now I want to wrap the list and this code in a class so that I do not >> have to have all this (and >> other) stuff in the form. >> >> The problem is that the line >> >> Font bold = new Font(Font, FontStyle.Bold); //to make the font > bold >> >> won't compile in a class. It complains that >> >> Font bold = new Font(Font >> >> That last class is bad (can't be inherited). AFAICT (just a guess) >> that Font reference only works in a form. >> >> Is there any way other than passing the font in to this method to us >> the code as written (in a class)? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 20:42:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 04 Dec 2010 21:42:39 -0500 Subject: [dba-VB] use a font in a class In-Reply-To: <71FC24F2CFA54A19AD4CCB53DA53917C@nant> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com> <71FC24F2CFA54A19AD4CCB53DA53917C@nant> Message-ID: <4CFAFC1F.70709@colbyconsulting.com> No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); > // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in a > class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, Color.White, >>> bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do not >>> have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Sat Dec 4 20:56:54 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 5 Dec 2010 05:56:54 +0300 Subject: [dba-VB] use a font in a class In-Reply-To: <4CFAFC1F.70709@colbyconsulting.com> References: <4CFAC023.7010905@colbyconsulting.com><1C00F7426B354CD19B1F39B2D5E3FEA8@nant> <4CFACE62.8040608@colbyconsulting.com> <4CFAE9FF.4030403@colbyconsulting.com><71FC24F2CFA54A19AD4CCB53DA53917C@nant> <4CFAFC1F.70709@colbyconsulting.com> Message-ID: <66F2AA795DF244B1AC1EE7E74A3BBB0E@nant> Try it, it will make the "trick". Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 5 ??????? 2010 ?. 5:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] use a font in a class No I didn't try that. John W. Colby www.ColbyConsulting.com On 12/4/2010 9:39 PM, Shamil Salakhetdinov wrote: > John -- > > Did you try it like that?: > > //----------------------------------------- > using System.Drawing; > ... > Font font = new Font("Arial", 3.1f); > System.Console.WriteLine("{0}", font); // the above line will output: > //[Font: Name=Arial, Size=3.1, Units=3, GdiCharSet=1, > GdiVerticalFont=False] > > > //----------------------------------------- > > with System.Windows.Forms and System.Drawing references set? > > It works here in console app or class lib. > I have used something like that many times... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 5 ??????? 2010 ?. 4:25 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] use a font in a class > > > But you can pass form's Font instance to your class as a parameter, dont' > you?... > > Yes, that is what I am having to do. > > > Or you can create a Font instance in your class, don't you? > > No, that is the original problem email. The code to do that fails in > a class. Unless you have another way to do it that the code I sent. > > John W. Colby > www.ColbyConsulting.com > > On 12/4/2010 6:46 PM, Shamil Salakhetdinov wrote: >> But you can pass form's Font instance to your class as a parameter, dont' >> you?... >> >> Or you can create a Font instance in your class, don't you? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 5 ??????? 2010 ?. 2:28 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] use a font in a class >> >> Yes, in a form that works because "this" has a font. In a class, >> "this" is the class (not a form) which doesn't have a font. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 12/4/2010 5:55 PM, Shamil Salakhetdinov wrote: >>> John -- >>> >>> You can use: >>> >>> Font font = new Font(this.Font, FontStyle.Bold); >>> >>> Ignore my prev. posting in this thread. >>> >>> Thank you. >>> >>> -- >>> Shamil >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: 5 ??????? 2010 ?. 1:27 >>> To: VBA >>> Subject: [dba-VB] use a font in a class >>> >>> I am defining a system for displaying a status on a form. We have a >>> listview object, in which we create three columns, then push stuff >>> into the list using the following coed: >>> >>> private void UpdateStage1Status(StatusEventArgs stEvArgs) { >>> Font bold = new Font(Font, FontStyle.Bold); //to make the > font >>> bold >>> ListViewItem item; >>> item = lstvStatus.Items.Add("",stEvArgs.pImageIndex); //The >>> image to display for the row >>> //item.BackColor = stEvArgs.pColor; >>> item.UseItemStyleForSubItems = false; //need to set this to >>> allow changing font color >>> item.SubItems.Add(stEvArgs.pDte.ToString()); //date >>> item.SubItems.Add(stEvArgs.pObjectPath); //object path >>> item.SubItems.Add(stEvArgs.pStatus, Color.Black, >>> Color.White, bold); //status text >>> } >>> >>> Now I want to wrap the list and this code in a class so that I do >>> not have to have all this (and >>> other) stuff in the form. >>> >>> The problem is that the line >>> >>> Font bold = new Font(Font, FontStyle.Bold); //to make the font >> bold >>> >>> won't compile in a class. It complains that >>> >>> Font bold = new Font(Font >>> >>> That last class is bad (can't be inherited). AFAICT (just a guess) >>> that Font reference only works in a form. >>> >>> Is there any way other than passing the font in to this method to us >>> the code as written (in a class)? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 4 23:55:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 00:55:25 -0500 Subject: [dba-VB] Blocking Message-ID: <4CFB294D.8040709@colbyconsulting.com> I have a trick new status listview and wrapper class to hold the delegates and all of the code for manipulating the status listview. It is all working fine. I added a new method of the wrapper class to call the ListView.Clear to clear out the list view. When I call that from the form's thread immediately before my process starts (the thread from the process ends up writing to that ListView through a delegate) it appears that I get a deadlock of some kind. The listview goes funny looking and the application hangs. If I comment out the call to the clear, everything works fine. I need to clear the listview before each run though so I need to make this work. I am not sure how to get the clear working. Any ideas? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sun Dec 5 12:43:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sun, 05 Dec 2010 13:43:06 -0500 Subject: [dba-VB] Tough to track down bug (in VS?) Message-ID: <4CFBDD3A.4050705@colbyconsulting.com> I ended up with a list view with a column named DateTime. The .Net framework has a DateTime object. As soon as I dropped a copy of this list view on a form that had the .Net DateTime object in its code, the project had build errors. VS decided that the DateTime object (DateTime.now anyone?) that was already in my code was magically a column object, which dies not have a .Now property. Lesson (which everyone already knows): Never name your objects using keywords from the language. As soon as I renamed my column to Date_Time, VS went through the code in that form and renamed the DateTime objects out in code to Date_Time as well. Once I found and fixed *those*, voila, my code compiled again. That one had me going for quite awhile. I knew it had something to do with that listview because dropping that on the form was the last thing I did before the compile error popped up, but tracking down the exact cause was tough! -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Mon Dec 6 04:20:03 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 11:20:03 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From shamil at smsconsulting.spb.ru Mon Dec 6 04:29:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 13:29:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Mon Dec 6 05:15:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Dec 2010 12:15:21 +0100 Subject: [dba-VB] Silverlight 5 in 2011 Message-ID: Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav From marklbreen at gmail.com Mon Dec 6 06:03:18 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 6 Dec 2010 12:03:18 +0000 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <58D794B0B29E4F709D49D46577A5B050@nant> Thank you, Mark. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: 6 ??????? 2010 ?. 15:03 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Hello Guys, Michael Washington is working regularly on Silverlight - he tweets regularly also. I found his site useful http://silverlight.adefwebserver.com/ His USP is that he provides a lot of helpful, pragmatic advice. Mark On 6 December 2010 11:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Dec 6 07:18:57 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:18:57 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Thank you, Gustav, -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ??????? 2010 ?. 14:15 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Silverlight 5 in 2011 Hi Shamil Windows Phone development _is_ Silverlight only. That's why the (wrong) death rumours last month about Silverlight didn't make much sense. The phones have been released here but the marketing has been very poor. The phone company we use doesn't offer it yet so we are a bit reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. /gustav >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> Hi Gustav -- Yes, I, personally, do plan to start working with Silverlight 4 (I have done a few rather advanced WPF projects in the past and I liked that technology and Silverlight is also based on WPF, and has a lot more AFAIU)... Have you heard what are the plans there in MS on Silverlight and Windows 7 Phone? Are Windows 7 Phones already available in Denmark? (Not yet here in Russia - IPhone is everywhere here now...) 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: 6 ??????? 2010 ?. 13:20 To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From ha at phulse.com Mon Dec 6 07:26:47 2010 From: ha at phulse.com (Hans-Christian Andersen) Date: Mon, 6 Dec 2010 05:26:47 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the (wrong) > death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit reluctant, but > my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I have > done > a few rather advanced WPF projects in the past and I liked that technology > and Silverlight is also based on WPF, and has a lot more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and Windows 7 > Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /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 Mon Dec 6 07:44:37 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Dec 2010 16:44:37 +0300 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: Hello Hans-Christian -- I suppose that "rumors about that Silverlight is dead are greatly exaggerated" :) I do not intend to start a "religious war" here iPhone, IPad, ... vs. Windows 7 Phone but I'd expect MS will make it this time as they did it many times before - they will get at least 50%(I'd bet) of the mobile/smart phones installed OSes market sooner or later... I can be wrong of course. Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Hans-Christian Andersen Sent: 6 ??????? 2010 ?. 16:27 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Silverlight 5 in 2011 Silverlight may live on as a development platform for Windows Phone development (an arguably good & practical choice), however Silverlight is essentially dead for the web in general. It may also be possible that Microsoft hasn't entirely given up hope, is shifting tactics and is trying to take a page out of Apples' book - trying to build some momentum for Silverlight by forcing it on developers and tying it to the success or failure of the Windows Phone 7... * Hans-Christian Andersen **Web Application Developer, Vancouver, Canada* *Unique Gifts, Collectables, Artwork* *Come one, come all to.... *www.corinnajasmine.com On 6 December 2010 03:15, Gustav Brock wrote: > Hi Shamil > > Windows Phone development _is_ Silverlight only. That's why the > (wrong) death rumours last month about Silverlight didn't make much sense. > > The phones have been released here but the marketing has been very poor. > The phone company we use doesn't offer it yet so we are a bit > reluctant, but my plan is to obtain these to replace our seven(!) years old T610 veterans. > > /gustav > > > >>> shamil at smsconsulting.spb.ru 06-12-2010 11:29 >>> > Hi Gustav -- > > Yes, I, personally, do plan to start working with Silverlight 4 (I > have done a few rather advanced WPF projects in the past and I liked > that technology and Silverlight is also based on WPF, and has a lot > more AFAIU)... > > Have you heard what are the plans there in MS on Silverlight and > Windows 7 Phone? > Are Windows 7 Phones already available in Denmark? (Not yet here in > Russia > - > IPhone is everywhere here now...) > > 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: 6 ??????? 2010 ?. 13:20 > To: dba-vb at databaseadvisors.com > Subject: [dba-VB] Silverlight 5 in 2011 > > Hi all > > The link tells it all: > > http://www.microsoft.com/silverlight/future/ > > /gustav > > From accessd at shaw.ca Mon Dec 6 12:02:01 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 6 Dec 2010 10:02:01 -0800 Subject: [dba-VB] Silverlight 5 in 2011 In-Reply-To: References: Message-ID: <811DDCCD3842473E8DB5C7AEF52DDB2B@creativesystemdesigns.com> Gustav: Have you heard what percentage of computers are now using or have it installed it on their computers? It seems Silverlight is competing with Flash and HTML5 and both these products which seem very well established and run on all platforms. Here is an ASP.Net programmer's 10 recommended supporting applications for development work: http://stephenwalther.com/blog/archive/2010/11/22/10-essential-tools-for-bui lding-asp-net-websites.aspx Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, December 06, 2010 2:20 AM To: dba-vb at databaseadvisors.com Subject: [dba-VB] Silverlight 5 in 2011 Hi all The link tells it all: http://www.microsoft.com/silverlight/future/ /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From actebs at actebs.com.au Tue Dec 7 21:18:32 2010 From: actebs at actebs.com.au (ACTEBS) Date: Wed, 8 Dec 2010 14:18:32 +1100 Subject: [dba-VB] Type Is Not Defined Message-ID: <000101cb9686$9805c490$c8114db0$@com.au> Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad From michael at ddisolutions.com.au Wed Dec 8 16:22:20 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 09:22:20 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 From actebs at actebs.com.au Wed Dec 8 20:56:51 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 13:56:51 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> Message-ID: <000601cb974c$bac8c6a0$305a53e0$@com.au> Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Dec 8 21:23:27 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 9 Dec 2010 14:23:27 +1100 Subject: [dba-VB] Type Is Not Defined References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> Message-ID: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 From actebs at actebs.com.au Wed Dec 8 21:58:25 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 14:58:25 +1100 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au><000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <000701cb9755$54841df0$fd8c59d0$@com.au> Now that's funny! Yep in Canberra and it's just stopped raining! Over 100mm overnight and everything is under water. Luckily we haven't been affected, but a lot of people around Canberra are struggling... Where are you located? Have you been affected by the rains? I've got the Crystal Report to work with some mucking around, but once I've gotten the hang of it, it seems OK. When you say huge assemblies to move around, aren't they just part of the .Net Framework or are there additional files to be included in the install package? Thanks Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 2:23 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined Lol, C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb It used to be like pulling teeth to get it to work right. Had to write heaps of code to make them portable IIRC. Huge assemblies to move around and keep up to date. I haven't used it for years, I just use MS builtin reports now. You will enjoy the .net world once you get the hang of it. Just ask JC! BTW you're in Canberra aren't you? Keeping dry? Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Thursday, 9 December 2010 1:57 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Type Is Not Defined Hi Michael, Thanks for your reply. I got to the bottom of it eventually. I needed to make a data table schema of what I wanted returned from the DB. After I did that, everything worked as expected. BTW, how did you know I was using the Crystal Reports tutorial? Also, why wouldn't you use that as a basis for learning how to use classes? Thanks... Vlad -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Thursday, 9 December 2010 9:22 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Type Is Not Defined The compiler cant find 'CustomerDataSetSchema'. Is it in another project? Set a ref to the project. If you don't have the class then you need to get it and it needs to be in the scope of the calling class, the tutorial should have it. BTW, the last place I'd be learning .net classes is in a Crystal Reports tutorial! Cheers Michael From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: Wednesday, 8 December 2010 2:19 PM To: 'dba-vb' Subject: [dba-VB] Type Is Not Defined Hi Everyone, This is my first attempt at a class, so don't laugh. I am doing this via a tutorial, and keep getting: Type 'CustomerDataSetSchema' Is Not Defined. I can't understand why this is throwing this error and hope someone can shed some light on it. The code is below: Imports System.Data Imports System.Data.OleDb Public Class DataSetConfiguration 'Private Const CONNECTION_STRING As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\MicrosoftVisual Studio 8\Crystal Reports\Samples\En\Database\xtreme.mdb" Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" Private Const DATATABLE_NAME As String = "tblMainData" 'Bloew is for use within a website 'Private Const DIRECTORY_FILE_PATH As String = "C:\WebSites\VB_Web_Data_DataSets\" Public Shared ReadOnly Property CustomerDataSet() As DataSet Get Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() Dim myOleDbConnection As OleDbConnection = New OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) Dim myOleDbDataAdapter As OleDbDataAdapter = New OleDbDataAdapter(QUERY_STRING, myOleDbConnection) myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) Return myDataSet End Get End Property End Class Many Thanks Vlad _______________________________________________ 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb 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 message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 8 22:05:47 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 08 Dec 2010 23:05:47 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> References: <000101cb9686$9805c490$c8114db0$@com.au><99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> Message-ID: <4D00559B.6050008@colbyconsulting.com> I love .Net. Someday I will be good enough to whip out .Net apps like I can whip out Access apps. ;) John W. Colby www.ColbyConsulting.com On 12/8/2010 10:23 PM, Michael Maddison wrote: > Lol, > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb > > > > It used to be like pulling teeth to get it to work right. Had to write > heaps of code to make them portable IIRC. > > Huge assemblies to move around and keep up to date. > > I haven't used it for years, I just use MS builtin reports now. > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > BTW you're in Canberra aren't you? > > Keeping dry? > > > > Cheers > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Thursday, 9 December 2010 1:57 PM > To: 'Discussion concerning Visual Basic and related programming issues.' > Subject: Re: [dba-VB] Type Is Not Defined > > > > Hi Michael, > > Thanks for your reply. I got to the bottom of it eventually. I needed to > make a data table schema of what I wanted returned from the DB. After I > did > that, everything worked as expected. > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > why > wouldn't you use that as a basis for learning how to use classes? > > Thanks... > > Vlad > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > Maddison > Sent: Thursday, 9 December 2010 9:22 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Type Is Not Defined > > The compiler cant find 'CustomerDataSetSchema'. > > Is it in another project? Set a ref to the project. > > If you don't have the class then you need to get it and it needs to be > in the scope of the calling class, the tutorial should have it. > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > tutorial! > > > > Cheers > > > > Michael > > > > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > Sent: Wednesday, 8 December 2010 2:19 PM > To: 'dba-vb' > Subject: [dba-VB] Type Is Not Defined > > > > Hi Everyone, > > > > This is my first attempt at a class, so don't laugh. I am doing this via > a > tutorial, and keep getting: > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > I can't understand why this is throwing this error and hope someone can > shed > some light on it. The code is below: > > > > Imports System.Data > > Imports System.Data.OleDb > > > > Public Class DataSetConfiguration > > 'Private Const CONNECTION_STRING As String = > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > Files\MicrosoftVisual Studio 8\Crystal > Reports\Samples\En\Database\xtreme.mdb" > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > Private Const DATATABLE_NAME As String = "tblMainData" > > 'Bloew is for use within a website > > 'Private Const DIRECTORY_FILE_PATH As String = > "C:\WebSites\VB_Web_Data_DataSets\" > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > Get > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > Dim myOleDbConnection As OleDbConnection = New > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > Return myDataSet > > > > End Get > > End Property > > > > End Class > > > > Many Thanks > > > > Vlad > > > > > > > > > > > > _______________________________________________ > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > 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 message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > _______________________________________________ > 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 Thu Dec 9 03:14:09 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 09:14:09 +0000 Subject: [dba-VB] Type Is Not Defined In-Reply-To: <4D00559B.6050008@colbyconsulting.com> References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/8/2010 10:23 PM, Michael Maddison wrote: > > Lol, > > > > > > > > C:\Program Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb > > > > > > > > It used to be like pulling teeth to get it to work right. Had to write > > heaps of code to make them portable IIRC. > > > > Huge assemblies to move around and keep up to date. > > > > I haven't used it for years, I just use MS builtin reports now. > > > > > > > > You will enjoy the .net world once you get the hang of it. Just ask JC! > > > > > > > > BTW you're in Canberra aren't you? > > > > Keeping dry? > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Thursday, 9 December 2010 1:57 PM > > To: 'Discussion concerning Visual Basic and related programming issues.' > > Subject: Re: [dba-VB] Type Is Not Defined > > > > > > > > Hi Michael, > > > > Thanks for your reply. I got to the bottom of it eventually. I needed to > > make a data table schema of what I wanted returned from the DB. After I > > did > > that, everything worked as expected. > > > > BTW, how did you know I was using the Crystal Reports tutorial? Also, > > why > > wouldn't you use that as a basis for learning how to use classes? > > > > Thanks... > > > > Vlad > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael > > Maddison > > Sent: Thursday, 9 December 2010 9:22 AM > > To: Discussion concerning Visual Basic and related programming issues. > > Subject: Re: [dba-VB] Type Is Not Defined > > > > The compiler cant find 'CustomerDataSetSchema'. > > > > Is it in another project? Set a ref to the project. > > > > If you don't have the class then you need to get it and it needs to be > > in the scope of the calling class, the tutorial should have it. > > > > BTW, the last place I'd be learning .net classes is in a Crystal Reports > > tutorial! > > > > > > > > Cheers > > > > > > > > Michael > > > > > > > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS > > Sent: Wednesday, 8 December 2010 2:19 PM > > To: 'dba-vb' > > Subject: [dba-VB] Type Is Not Defined > > > > > > > > Hi Everyone, > > > > > > > > This is my first attempt at a class, so don't laugh. I am doing this via > > a > > tutorial, and keep getting: > > > > > > > > Type 'CustomerDataSetSchema' Is Not Defined. > > > > > > > > I can't understand why this is throwing this error and hope someone can > > shed > > some light on it. The code is below: > > > > > > > > Imports System.Data > > > > Imports System.Data.OleDb > > > > > > > > Public Class DataSetConfiguration > > > > 'Private Const CONNECTION_STRING As String = > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program > > Files\MicrosoftVisual Studio 8\Crystal > > Reports\Samples\En\Database\xtreme.mdb" > > > > Private Const QUERY_STRING As String = "SELECT * FROM tblMainData" > > > > Private Const DATATABLE_NAME As String = "tblMainData" > > > > 'Bloew is for use within a website > > > > 'Private Const DIRECTORY_FILE_PATH As String = > > "C:\WebSites\VB_Web_Data_DataSets\" > > > > Public Shared ReadOnly Property CustomerDataSet() As DataSet > > > > Get > > > > Dim myDataSet As CustomerDataSetSchema = New CustomerDataSetSchema() > > > > Dim myOleDbConnection As OleDbConnection = New > > OleDbConnection(GetDestConnectionString) '(CONNECTION_STRING) > > > > Dim myOleDbDataAdapter As OleDbDataAdapter = New > > OleDbDataAdapter(QUERY_STRING, myOleDbConnection) > > > > > > > > myOleDbDataAdapter.Fill(myDataSet, DATATABLE_NAME) > > > > Return myDataSet > > > > > > > > End Get > > > > End Property > > > > > > > > End Class > > > > > > > > Many Thanks > > > > > > > > Vlad > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3302 - Release Date: 12/07/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > 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 message. > > Checked by AVG - www.avg.com > > Version: 10.0.1170 / Virus Database: 426/3304 - Release Date: 12/08/10 > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Thu Dec 9 04:36:47 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 09 Dec 2010 11:36:47 +0100 Subject: [dba-VB] Type Is Not Defined Message-ID: Hi Mark Love SQL Server? Not me. Like John I prefer to spend time with VS and .Net. /gustav >>> marklbreen at gmail.com 09-12-2010 10:14 >>> Hey John, Just curious, would you say you love SQL Server also? I suppose if I love software of any kind, it has to be SQL server. Mark On 9 December 2010 04:05, jwcolby wrote: > I love .Net. Someday I will be good enough to whip out .Net apps like I > can whip out Access apps. ;) > > John W. Colby > www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 9 05:17:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 06:17:48 -0500 Subject: [dba-VB] Type Is Not Defined In-Reply-To: References: <000101cb9686$9805c490$c8114db0$@com.au> <99266C61B516644D9727F983FAFAB465046733@remote.ddisolutions.com.au> <000601cb974c$bac8c6a0$305a53e0$@com.au> <99266C61B516644D9727F983FAFAB465046740@remote.ddisolutions.com.au> <4D00559B.6050008@colbyconsulting.com> Message-ID: <4D00BADC.4040301@colbyconsulting.com> Mark, I am a programmer at heart and .Net and C# gives me programming power like I have never had before. I love SQL Server for it's ability to give me big iron database engine capabilities, but I do not spend time in it, I just use it. I have never learned how to debug code in SQL Server the way I can in VS, so basically I write in C# and just drive SQL Server with my C# code. John W. Colby www.ColbyConsulting.com On 12/9/2010 4:14 AM, Mark Breen wrote: > Hey John, > > Just curious, would you say you love SQL Server also? > > I suppose if I love software of any kind, it has to be SQL server. > > Mark > > > > On 9 December 2010 04:05, jwcolby wrote: > >> I love .Net. Someday I will be good enough to whip out .Net apps like I >> can whip out Access apps. ;) >> >> John W. Colby >> www.ColbyConsulting.com From actebs at actebs.com.au Thu Dec 9 06:16:04 2010 From: actebs at actebs.com.au (ACTEBS) Date: Thu, 9 Dec 2010 23:16:04 +1100 Subject: [dba-VB] VB.Net and Microsoft Report Viewer Message-ID: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad From shamil at smsconsulting.spb.ru Thu Dec 9 09:27:59 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 9 Dec 2010 18:27:59 +0300 Subject: [dba-VB] VB.Net and Microsoft Report Viewer In-Reply-To: <000801cb979a$d9b24d90$8d16e8b0$@com.au> References: <000801cb979a$d9b24d90$8d16e8b0$@com.au> Message-ID: <33A5DC6AE6554B2EAF023160C2225706@nant> Hi Vlad -- <<< I would check out the Microsoft Report Viewer. Can anyone show me an example of how to achieve this please? >>> Welcome to http://northwind.codeplex.com/ ! <<< the issues distributing your app using the Crystal Report Viewer >>> That usually works well - you just need to install CRV runtime... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of ACTEBS Sent: 9 ??????? 2010 ?. 15:16 To: 'dba-vb' Subject: [dba-VB] VB.Net and Microsoft Report Viewer Hi Everyone, After discussions with Michael this afternoon about the issues distributing your app using the Crystal Report Viewer, I thought I would check out the Microsoft Report Viewer. A lot of similarities, but I can't find how to pass the Dataset to the report and can't find any examples on the net. Basically what I have is a class that returns a Dataset which works well in CRV and I'd like to use the same methodology using MRV if at all possible. Can anyone show me an example of how to achieve this please? Many thanks Vlad _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:30:04 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:30:04 -0500 Subject: [dba-VB] Snippet editor Message-ID: <4D01121C.2010806@colbyconsulting.com> Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Thu Dec 9 11:33:50 2010 From: df.waters at comcast.net (Dan Waters) Date: Thu, 9 Dec 2010 11:33:50 -0600 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01121C.2010806@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> Message-ID: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> I did a search on 'visual studio snippets tutorial' and got lots of hits. Dan -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, December 09, 2010 11:30 AM To: VBA Subject: [dba-VB] Snippet editor Does anyone know of one that is easy to use and integrated in VS? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 9 11:53:33 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 09 Dec 2010 12:53:33 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> Message-ID: <4D01179D.5000003@colbyconsulting.com> As did I all about hand editing xml files. YUK! I thought perhaps someone on this list was using an actual snippet editor that integrated into SQL Server and allowed me to edit the snippet directly. John W. Colby www.ColbyConsulting.com On 12/9/2010 12:33 PM, Dan Waters wrote: > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > Dan > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, December 09, 2010 11:30 AM > To: VBA > Subject: [dba-VB] Snippet editor > > Does anyone know of one that is easy to use and integrated in VS? > From marklbreen at gmail.com Thu Dec 9 14:42:41 2010 From: marklbreen at gmail.com (Mark Breen) Date: Thu, 9 Dec 2010 20:42:41 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <4D01179D.5000003@colbyconsulting.com> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> Message-ID: Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet editor > that integrated into SQL > Server and allowed me to edit the snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > 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 9 15:42:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 00:42:39 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com> Message-ID: <19ACDAEBEACD47DB894BE71AFD067417@nant> Hi Mark -- <<< I struggle now when I am on a box that does not have it installed. >>> One of the best memory trainings is to study and to master SQL syntax hand typing from one own "memory cells", no Intellisense help of any kind provided:) I know, I know... lazy MS Access developers, spoiled by QBE (myself included) are rarely able to type lengthy SQL expressions from their own memory... :) 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: 9 ??????? 2010 ?. 23:43 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hello John, I use SQL Promot by redgate and find it extremely useful, so much so, I struggle now when I am on a box that does not have it installed. thanks Mark On 9 December 2010 17:53, jwcolby wrote: > As did I all about hand editing xml files. > > YUK! > > I thought perhaps someone on this list was using an actual snippet > editor that integrated into SQL Server and allowed me to edit the > snippet directly. > > John W. Colby > www.ColbyConsulting.com > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > I did a search on 'visual studio snippets tutorial' and got lots of hits. > > > > Dan > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Thursday, December 09, 2010 11:30 AM > > To: VBA > > Subject: [dba-VB] Snippet editor > > > > Does anyone know of one that is easy to use and integrated in VS? > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://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 Fri Dec 10 03:25:42 2010 From: marklbreen at gmail.com (Mark Breen) Date: Fri, 10 Dec 2010 09:25:42 +0000 Subject: [dba-VB] Snippet editor In-Reply-To: <19ACDAEBEACD47DB894BE71AFD067417@nant> References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Dec 10 05:11:27 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 06:11:27 -0500 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: <4D020ADF.3080502@colbyconsulting.com> Yea, it is common. Who did you say you are? John W. Colby www.ColbyConsulting.com On 12/10/2010 4:25 AM, Mark Breen wrote: > Hi Shamil, > > Speaking of memory, > > I am 41 and I notice in the last 12 - 24 months that I no longer have the > memory I had when I was in my 20s and 30s. I am told by a few people that > it is rather common, but I still hate this lack of feeling sharp - does > anyone else recognise this. Is it common as a few friends have said? IOW > am I just getting old? > > Mark > > > > On 9 December 2010 21:42, Shamil Salakhetdinov > wrote: > >> >> Hi Mark -- >> >> <<< >> I struggle now when I am on a box that does not have it installed. >>>>> >> One of the best memory trainings is to study and to master SQL syntax hand >> typing from one own "memory cells", no Intellisense help of any kind >> provided:) >> I know, I know... lazy MS Access developers, spoiled by QBE (myself >> included) are rarely able to type lengthy SQL expressions from their own >> memory... >> >> :) >> >> 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: 9 ??????? 2010 ?. 23:43 >> To: Discussion concerning Visual Basic and related programming issues. >> Subject: Re: [dba-VB] Snippet editor >> >> Hello John, >> >> I use SQL Promot by redgate and find it extremely useful, so much so, I >> struggle now when I am on a box that does not have it installed. >> >> thanks >> >> Mark >> >> >> On 9 December 2010 17:53, jwcolby wrote: >> >>> As did I all about hand editing xml files. >>> >>> YUK! >>> >>> I thought perhaps someone on this list was using an actual snippet >>> editor that integrated into SQL Server and allowed me to edit the >>> snippet directly. >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 12/9/2010 12:33 PM, Dan Waters wrote: >>>> I did a search on 'visual studio snippets tutorial' and got lots of >> hits. >>>> >>>> Dan >>>> >>>> -----Original Message----- >>>> From: dba-vb-bounces at databaseadvisors.com >>>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>>> Sent: Thursday, December 09, 2010 11:30 AM >>>> To: VBA >>>> Subject: [dba-VB] Snippet editor >>>> >>>> Does anyone know of one that is easy to use and integrated in VS? >>>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From accessd at shaw.ca Fri Dec 10 08:43:08 2010 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 10 Dec 2010 06:43:08 -0800 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com> <72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters> <4D01179D.5000003@colbyconsulting.com> <19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark: This is why we have computers...fills in those little gaps. (Spoken from a man over 60.) Jim -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, December 10, 2010 1:26 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax hand > typing from one own "memory cells", no Intellisense help of any kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their own > memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, I > struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 08:56:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 09:56:15 -0500 Subject: [dba-VB] how do i get coderush back Message-ID: <4D023F8F.40804@colbyconsulting.com> I have coderush on my computer, and I see it working in the little lines that show the program structure, but I do not have the code rush menu or toolbar. Any idea how to get those back? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Fri Dec 10 09:06:23 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 10 Dec 2010 18:06:23 +0300 Subject: [dba-VB] Snippet editor In-Reply-To: References: <4D01121C.2010806@colbyconsulting.com><72566D13CC2C4FCC8AFDBE65C00456E4@DanWaters><4D01179D.5000003@colbyconsulting.com><19ACDAEBEACD47DB894BE71AFD067417@nant> Message-ID: Hi Mark -- <<< I am 41... am I just getting old? >>> Not old but older. When you turned your 40 you've got to the "mature people club". Welcome to the Club! :) 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: 10 ??????? 2010 ?. 12:26 To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Snippet editor Hi Shamil, Speaking of memory, I am 41 and I notice in the last 12 - 24 months that I no longer have the memory I had when I was in my 20s and 30s. I am told by a few people that it is rather common, but I still hate this lack of feeling sharp - does anyone else recognise this. Is it common as a few friends have said? IOW am I just getting old? Mark On 9 December 2010 21:42, Shamil Salakhetdinov wrote: > > Hi Mark -- > > <<< > I struggle now when I am on a box that does not have it installed. > >>> > One of the best memory trainings is to study and to master SQL syntax > hand typing from one own "memory cells", no Intellisense help of any > kind > provided:) > I know, I know... lazy MS Access developers, spoiled by QBE (myself > included) are rarely able to type lengthy SQL expressions from their > own memory... > > :) > > 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: 9 ??????? 2010 ?. 23:43 > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Snippet editor > > Hello John, > > I use SQL Promot by redgate and find it extremely useful, so much so, > I struggle now when I am on a box that does not have it installed. > > thanks > > Mark > > > On 9 December 2010 17:53, jwcolby wrote: > > > As did I all about hand editing xml files. > > > > YUK! > > > > I thought perhaps someone on this list was using an actual snippet > > editor that integrated into SQL Server and allowed me to edit the > > snippet directly. > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 12/9/2010 12:33 PM, Dan Waters wrote: > > > I did a search on 'visual studio snippets tutorial' and got lots > > > of > hits. > > > > > > Dan > > > > > > -----Original Message----- > > > From: dba-vb-bounces at databaseadvisors.com > > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > > Sent: Thursday, December 09, 2010 11:30 AM > > > To: VBA > > > Subject: [dba-VB] Snippet editor > > > > > > Does anyone know of one that is easy to use and integrated in VS? > > > > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 10 15:30:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:30:11 -0500 Subject: [dba-VB] Web page manipulation Message-ID: <4D029BE3.1070407@colbyconsulting.com> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Dec 10 15:33:49 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:33:49 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Yes. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Dec 10 15:44:30 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 10 Dec 2010 16:44:30 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D029F3E.5080401@colbyconsulting.com> You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > From DWUTKA at Marlow.com Fri Dec 10 15:54:01 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 15:54:01 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029F3E.5080401@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: No. You asked if you can programmatically manipulate web pages to cause specific pages to open, etc. The answer is yes. You didn't ask how to do it! LOL I have done a few projects that do this. The 'how' is both simple, complicated, easy, and a complete PITA. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:45 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation You must be a Microsoft employee eh? ;) John W. Colby www.ColbyConsulting.com On 12/10/2010 4:33 PM, Drew Wutka wrote: > Yes. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From davidmcafee at gmail.com Fri Dec 10 16:16:29 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:16:29 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> <4D029F3E.5080401@colbyconsulting.com> Message-ID: If you know the final link to the file in question you can use that. That's what I do with some of the click once stuff for prerequisites. On Fri, Dec 10, 2010 at 1:54 PM, Drew Wutka wrote: > No. You asked if you can programmatically manipulate web pages to cause > specific pages to open, etc. The answer is yes. You didn't ask how to > do it! LOL > > I have done a few projects that do this. The 'how' is both simple, > complicated, easy, and a complete PITA. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:45 PM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > You must be a Microsoft employee eh? ;) > > John W. Colby > www.ColbyConsulting.com > > On 12/10/2010 4:33 PM, Drew Wutka wrote: > > Yes. > > > > Drew > > > > -----Original Message----- > > From: dba-vb-bounces at databaseadvisors.com > > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > > Sent: Friday, December 10, 2010 3:30 PM > > To: VBA > > Subject: [dba-VB] Web page manipulation > > > > My client has to go through a process where he clicks about 20 - 30 > > things to manage to get a file > > downloaded. It sounded totally convoluted but the question is (and I > > have asked this before without > > a usable response) can I programmatically manipulate web pages to > cause > > specific pages to open, > > click buttons, input data into controls etc. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Fri Dec 10 16:28:43 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 10 Dec 2010 23:28:43 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John It is. I even think I posted a code snippet in C# I ran with success when you asked for this the first time. The trick these days is to find out which Java Script functions and parameters are called for navigating the pages and submit data. I used FireFox and an HTTP add-in debugger and/or Google Chrome and its debug feature for this. Be prepared for some "fun" hours and start with testing your code towards a simple site. /gustav >>> jwcolby at colbyconsulting.com 10-12-2010 22:30 >>> My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- John W. Colby www.ColbyConsulting.com From davidmcafee at gmail.com Fri Dec 10 16:24:08 2010 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 10 Dec 2010 14:24:08 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: References: Message-ID: not to mention when they make changes to their site. On Fri, Dec 10, 2010 at 2:28 PM, Gustav Brock wrote: > > Be prepared for some "fun" hours and start with testing your code towards a > simple site. > > /gustav > > From DWUTKA at Marlow.com Fri Dec 10 16:33:05 2010 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 10 Dec 2010 16:33:05 -0600 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D029BE3.1070407@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Now for a little more info for you. Yes, you can certainly do this. Technically, it's not much different than if someone handed you an .mde, and asked you to automate tasks in the mde (so you couldn't tweak the source code running the program itself, but you could open the mde with VBA, and use the objects within it just like you'd use the objects in your own application.) Trick #1: Just like with an .mde, you have to have a reference to the database itself, so with a browser, you need a reference to it. You can either programmatically open a browser window (so you'll both create the object, and have a reference to it), or you can ask the user which browser window they want you to use (so you can grab the browser window through code). Here's an example of how to grab an existing browser window: Function GetExistingBrowser(strKey As String) Dim SWs As New SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As InternetExplorer Dim Resp For Each IE In SWs Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + vbQuestion, "Select IE") If Resp = vbYes Then Set mdie = Nothing Set mdie = IE.Application NewSormDataEntry strKey, mdie Exit Function End If Next End Function The 'NewSormDataEntry' function is the function I am sending the mdie object too (the referenced browser window). In this function strKey is the primary key of a record that will be used in that NewSormDataEntry to submit data into a web site. Trick #2: Just like when the development world got a wedgie when Microsoft 'secured' Outlook from programs just using it to send email, web security can be a real pain in doing something like this. The security is put in place to impede (note, I didn't say prevent) a hacker from doing nasty stuff to the site. So the 'impeding' garbage designed to trip up hackers can get in the way of a legitimate developer trying to create a helpful tool. So before you COMMIT to being able to make the tool, you'll need to look at the site itself, to see what all will get in your way. Trick #3: There are two ways to 'find' the objects you will need your code to work with. The first is to just look at the HTML of the page(s) you are going to manipulate. This is where some of those 'impediments' come into play. Some sites prevent you from right clicking on a page and selecting 'View Source'. Ironically, this is just removing a 'shortcut' way to view the HTML source behind a page. It doesn't actually HIDE the source, because your browser is viewing the source, it has too, otherwise it will have nothing to display. So there are multiple ways to 'download' the HTML you can view yourself. Create your own browser, and dump the HTML to a file. You can also use API calls to just directly download the HTML, without a browser. If the page is derived from internal (on the website server) variables, you'll need to use your own browser to get there and download the source. The second way to 'find' the objects you need to deal with are with the object browser. Running your code in debug mode, you'll be able to see the browser object, and all of it's child elements. Trick #4: Events and properties. Setting the value of a textbox, or clicking a button, just requires that you know what the events and properties of those objects are. I use the MSDN that came with the developer edition of Office 2000. It's got a nice HTML guide with common HTML form elements, their properties, methods, and events. But all that information is also plastered all over the web. Trick #5: When a page loads, the browser object is there, but you may not be able to capture 'download complete' events. What I have done in these cases, where my code puts in data on a page, clicks a button to go to the next page, I put my code in a loop, that sits and waits for an object from the next page to exist. Of course, if there are applets, or flash media elements, required for interaction... can't help ya there, haven't tackled one of those. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 10, 2010 3:30 PM To: VBA Subject: [dba-VB] Web page manipulation My client has to go through a process where he clicks about 20 - 30 things to manage to get a file downloaded. It sounded totally convoluted but the question is (and I have asked this before without a usable response) can I programmatically manipulate web pages to cause specific pages to open, click buttons, input data into controls etc. -- 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 The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sun Dec 12 23:32:34 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 00:32:34 -0500 Subject: [dba-VB] Browser based database Message-ID: <4D05AFF2.3070701@colbyconsulting.com> I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Mon Dec 13 00:03:50 2010 From: michael at ddisolutions.com.au (Michael Maddison) Date: Mon, 13 Dec 2010 17:03:50 +1100 Subject: [dba-VB] Browser based database References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <99266C61B516644D9727F983FAFAB465046771@remote.ddisolutions.com.au> John, I was the same way. Still very much finding my way in ASP.net. But the basics are pretty straightforward. An ASP.net application is basically, Normal .net code, c# or vb.net whatever. Normal HTML Javascript (optional)(inserted by VS) Create a new asp.net project. Add a webform, select code in separate file. Change to split view Add a SQLDataSource control to the designer part of the form, hook it up to a small table. Add a DataGrid control to the designer part of the form, set the datasource. Run the project. See http://www.asp.net/get-started to get started. I've only done web forms and Ajax so far. Cheers Michael M From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, 13 December 2010 4:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com ________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3311 - Release Date: 12/12/10 From ebarro at roadrunner.com Mon Dec 13 00:45:47 2010 From: ebarro at roadrunner.com (Eric Barro) Date: Sun, 12 Dec 2010 22:45:47 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D05AFF2.3070701@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> Message-ID: <013d01cb9a91$604a5250$20def6f0$@com> John, ASP.NET uses either C# or VB.NET as the underlying development language. Of course there are other technologies involved such as Javascript, HMTL, CSS etc. There's no way to convert a WinForm application to a web app with one click of a button. You'd have to recreate your WinForm in ASP.NET using the built-in .NET equivalent controls. The good thing is that they are one and the same type of control on the web app (ie TextBox in WinForms is still TextBox on a web app). If you programmed your business logic in separate classes and you refrained from directly referencing controls in the methods then you should be fine and you should be able to use most of your code in a web app. The main things you will need to deal with in a web app such as ASP.NET are the following: 1. Session variables - this is one of the ways you can pass data back and forth from one page to the next since web apps are stateless apps and there is no "automatic way" of "remembering" data from one page to the next. 2. Postback events - when a user clicks a button on a WinForm all you need to do is trap for the click event. On a web app you need to be aware of when postbacks (basically trips to the server) occur so that you can properly trap events or intercept them. 3. Server side versus client side events - this is probably the hardest concept to grasp for most beginning web app developers. 4. Client side scripting - When it's done and said, all ASP.NET does really is render the page in HTML and handle the events using Javascript. You will need to get your feet wet learning Javascript as well. Fortunately, the syntax is based on C but variables and objects are not strongly-typed. --Eric -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Sunday, December 12, 2010 9:33 PM To: VBA Subject: [dba-VB] Browser based database I need to do two different browser based databases (I think). I know nothing about this. Both clients need to enter data and have multiple users hitting the database from home and office computers. Where do I start? I am getting pretty good with C# / SQL Server but those are computer based "applications". If I could do an internet download installation, I could probably (maybe) go there. Except what about admin rights etc. Is asp.net viable? Is it close to C#? If I keep the data entry screens simple can I do it in C# and then just "press a button" to turn it into ASP.net? Please don't make rude noises here. ;) I just know nothing about internet facing application programming and I feel really inadequate on this stuff. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From marklbreen at gmail.com Mon Dec 13 03:45:37 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:45:37 +0000 Subject: [dba-VB] Browser based database In-Reply-To: <013d01cb9a91$604a5250$20def6f0$@com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: Hello John, There are lots of things to consider when you out an app online, security being just one. But there are really many other things also, most of which I do not know. However, I am currently happily developing web apps myself, and I spent minutes and hours on my coding. I am using DotNetNuke as my framework and it works a treat. I keep it simple and try not to get too fancy. There is loads of help available from the groups and forums. It is not too wild to suggest that in the future 50% or more of our customers will want web based front ends, so I urge you to study DNN - a few days of reading the forums and the turorials on module development will have you coding apps in no time. Do not be put off by the initial barrier to entry, once you get the hang of it, and one you keep it simple, you can code in the same ol' c# style , but your GUI will be a DNN website. Oh, and it if fun also. Mark On 13 December 2010 06:45, Eric Barro wrote: > John, > > ASP.NET uses either C# or VB.NET as the underlying development language. > Of > course there are other technologies involved such as Javascript, HMTL, CSS > etc. > > There's no way to convert a WinForm application to a web app with one click > of a button. You'd have to recreate your WinForm in ASP.NET using the > built-in .NET equivalent controls. The good thing is that they are one and > the same type of control on the web app (ie TextBox in WinForms is still > TextBox on a web app). > > If you programmed your business logic in separate classes and you refrained > from directly referencing controls in the methods then you should be fine > and you should be able to use most of your code in a web app. > > The main things you will need to deal with in a web app such as ASP.NETare > the following: > > 1. Session variables - this is one of the ways you can pass data back and > forth from one page to the next since web apps are stateless apps and there > is no "automatic way" of "remembering" data from one page to the next. > 2. Postback events - when a user clicks a button on a WinForm all you need > to do is trap for the click event. On a web app you need to be aware of > when > postbacks (basically trips to the server) occur so that you can properly > trap events or intercept them. > 3. Server side versus client side events - this is probably the hardest > concept to grasp for most beginning web app developers. > 4. Client side scripting - When it's done and said, all ASP.NET does > really > is render the page in HTML and handle the events using Javascript. You will > need to get your feet wet learning Javascript as well. Fortunately, the > syntax is based on C but variables and objects are not strongly-typed. > > --Eric > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Sunday, December 12, 2010 9:33 PM > To: VBA > Subject: [dba-VB] Browser based database > > I need to do two different browser based databases (I think). I know > nothing about this. Both > clients need to enter data and have multiple users hitting the database > from > home and office computers. > > Where do I start? I am getting pretty good with C# / SQL Server but those > are computer based > "applications". If I could do an internet download installation, I could > probably (maybe) go there. > Except what about admin rights etc. > > Is asp.net viable? Is it close to C#? If I keep the data entry screens > simple can I do it in C# > and then just "press a button" to turn it into ASP.net? Please don't make > rude noises here. > > ;) > > I just know nothing about internet facing application programming and I > feel > really inadequate on > this stuff. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ > 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 Mon Dec 13 03:48:10 2010 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 13 Dec 2010 09:48:10 +0000 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: Hello John Another choice is to use Sillennium It is built for this task and will allow you to easily change your library of routines when your website changes. Mark On 10 December 2010 22:33, Drew Wutka wrote: > Now for a little more info for you. Yes, you can certainly do this. > Technically, it's not much different than if someone handed you an .mde, > and asked you to automate tasks in the mde (so you couldn't tweak the > source code running the program itself, but you could open the mde with > VBA, and use the objects within it just like you'd use the objects in > your own application.) > > Trick #1: Just like with an .mde, you have to have a reference to the > database itself, so with a browser, you need a reference to it. You can > either programmatically open a browser window (so you'll both create the > object, and have a reference to it), or you can ask the user which > browser window they want you to use (so you can grab the browser window > through code). > > Here's an example of how to grab an existing browser window: > > Function GetExistingBrowser(strKey As String) > Dim SWs As New SHDocVw.ShellWindows > Dim IE As SHDocVw.InternetExplorer > Dim mdie As InternetExplorer > Dim Resp > For Each IE In SWs > Resp = MsgBox("Do you want to select: " & vbCrLf & vbCrLf & > IE.LocationName & vbCrLf & vbCrLf & IE.LocationURL, vbYesNo + > vbQuestion, "Select IE") > If Resp = vbYes Then > Set mdie = Nothing > Set mdie = IE.Application > NewSormDataEntry strKey, mdie > Exit Function > End If > Next > End Function > > The 'NewSormDataEntry' function is the function I am sending the mdie > object too (the referenced browser window). In this function strKey is > the primary key of a record that will be used in that NewSormDataEntry > to submit data into a web site. > > Trick #2: Just like when the development world got a wedgie when > Microsoft 'secured' Outlook from programs just using it to send email, > web security can be a real pain in doing something like this. The > security is put in place to impede (note, I didn't say prevent) a hacker > from doing nasty stuff to the site. So the 'impeding' garbage designed > to trip up hackers can get in the way of a legitimate developer trying > to create a helpful tool. So before you COMMIT to being able to make > the tool, you'll need to look at the site itself, to see what all will > get in your way. > > Trick #3: There are two ways to 'find' the objects you will need your > code to work with. The first is to just look at the HTML of the page(s) > you are going to manipulate. This is where some of those 'impediments' > come into play. Some sites prevent you from right clicking on a page > and selecting 'View Source'. Ironically, this is just removing a > 'shortcut' way to view the HTML source behind a page. It doesn't > actually HIDE the source, because your browser is viewing the source, it > has too, otherwise it will have nothing to display. So there are > multiple ways to 'download' the HTML you can view yourself. Create your > own browser, and dump the HTML to a file. You can also use API calls to > just directly download the HTML, without a browser. If the page is > derived from internal (on the website server) variables, you'll need to > use your own browser to get there and download the source. The second > way to 'find' the objects you need to deal with are with the object > browser. Running your code in debug mode, you'll be able to see the > browser object, and all of it's child elements. > > Trick #4: Events and properties. Setting the value of a textbox, or > clicking a button, just requires that you know what the events and > properties of those objects are. I use the MSDN that came with the > developer edition of Office 2000. It's got a nice HTML guide with > common HTML form elements, their properties, methods, and events. But > all that information is also plastered all over the web. > > Trick #5: When a page loads, the browser object is there, but you may > not be able to capture 'download complete' events. What I have done in > these cases, where my code puts in data on a page, clicks a button to go > to the next page, I put my code in a loop, that sits and waits for an > object from the next page to exist. > > Of course, if there are applets, or flash media elements, required for > interaction... can't help ya there, haven't tackled one of those. > > Drew > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, December 10, 2010 3:30 PM > To: VBA > Subject: [dba-VB] Web page manipulation > > My client has to go through a process where he clicks about 20 - 30 > things to manage to get a file > downloaded. It sounded totally convoluted but the question is (and I > have asked this before without > a usable response) can I programmatically manipulate web pages to cause > specific pages to open, > click buttons, input data into controls etc. > > -- > 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 > > The information contained in this transmission is intended only for the > person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI > Business > Sensitive material. If you are not the intended recipient, please contact > the sender > immediately and destroy the material in its entirety, whether electronic or > hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, > or other use of, or taking of any action in reliance upon this information > by persons > or entities other than the intended recipient is prohibited. > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:11:31 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:11:31 -0500 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> Message-ID: <4D0637A3.8020609@colbyconsulting.com> Thanks everyone who has responded. Both of these are cases where the company is "virtual" and all the stakeholders are scattered around. The database has to be accessed over the internet, and from who knows where. I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but then you run into installation issues etc. With "clickonce" deployment even that might be possible. I think if I could do a real app distributed with ClickOnce I would go that route. It just puts off learning all of the web / html / java stuff. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:45 AM, Mark Breen wrote: > Hello John, > > There are lots of things to consider when you out an app online, security > being just one. But there are really many other things also, most of which > I do not know. > > However, I am currently happily developing web apps myself, and I spent > minutes and hours on my coding. > > I am using DotNetNuke as my framework and it works a treat. I keep it > simple and try not to get too fancy. There is loads of help available from > the groups and forums. > > It is not too wild to suggest that in the future 50% or more of our > customers will want web based front ends, so I urge you to study DNN - a few > days of reading the forums and the turorials on module development will have > you coding apps in no time. > > Do not be put off by the initial barrier to entry, once you get the hang of > it, and one you keep it simple, you can code in the same ol' c# style , but > your GUI will be a DNN website. > > Oh, and it if fun also. > > Mark > > > On 13 December 2010 06:45, Eric Barro wrote: > >> John, >> >> ASP.NET uses either C# or VB.NET as the underlying development language. >> Of >> course there are other technologies involved such as Javascript, HMTL, CSS >> etc. >> >> There's no way to convert a WinForm application to a web app with one click >> of a button. You'd have to recreate your WinForm in ASP.NET using the >> built-in .NET equivalent controls. The good thing is that they are one and >> the same type of control on the web app (ie TextBox in WinForms is still >> TextBox on a web app). >> >> If you programmed your business logic in separate classes and you refrained >> from directly referencing controls in the methods then you should be fine >> and you should be able to use most of your code in a web app. >> >> The main things you will need to deal with in a web app such as ASP.NETare >> the following: >> >> 1. Session variables - this is one of the ways you can pass data back and >> forth from one page to the next since web apps are stateless apps and there >> is no "automatic way" of "remembering" data from one page to the next. >> 2. Postback events - when a user clicks a button on a WinForm all you need >> to do is trap for the click event. On a web app you need to be aware of >> when >> postbacks (basically trips to the server) occur so that you can properly >> trap events or intercept them. >> 3. Server side versus client side events - this is probably the hardest >> concept to grasp for most beginning web app developers. >> 4. Client side scripting - When it's done and said, all ASP.NET does >> really >> is render the page in HTML and handle the events using Javascript. You will >> need to get your feet wet learning Javascript as well. Fortunately, the >> syntax is based on C but variables and objects are not strongly-typed. >> >> --Eric >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Sunday, December 12, 2010 9:33 PM >> To: VBA >> Subject: [dba-VB] Browser based database >> >> I need to do two different browser based databases (I think). I know >> nothing about this. Both >> clients need to enter data and have multiple users hitting the database >> from >> home and office computers. >> >> Where do I start? I am getting pretty good with C# / SQL Server but those >> are computer based >> "applications". If I could do an internet download installation, I could >> probably (maybe) go there. >> Except what about admin rights etc. >> >> Is asp.net viable? Is it close to C#? If I keep the data entry screens >> simple can I do it in C# >> and then just "press a button" to turn it into ASP.net? Please don't make >> rude noises here. >> >> ;) >> >> I just know nothing about internet facing application programming and I >> feel >> really inadequate on >> this stuff. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 13 09:33:44 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 10:33:44 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: References: <4D029BE3.1070407@colbyconsulting.com> Message-ID: <4D063CD8.4020303@colbyconsulting.com> The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your library > of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an .mde, >> and asked you to automate tasks in the mde (so you couldn't tweak the >> source code running the program itself, but you could open the mde with >> VBA, and use the objects within it just like you'd use the objects in >> your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to the >> database itself, so with a browser, you need a reference to it. You can >> either programmatically open a browser window (so you'll both create the >> object, and have a reference to it), or you can ask the user which >> browser window they want you to use (so you can grab the browser window >> through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) >> Dim SWs As New SHDocVw.ShellWindows >> Dim IE As SHDocVw.InternetExplorer >> Dim mdie As InternetExplorer >> Dim Resp >> For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey is >> the primary key of a record that will be used in that NewSormDataEntry >> to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send email, >> web security can be a real pain in doing something like this. The >> security is put in place to impede (note, I didn't say prevent) a hacker >> from doing nasty stuff to the site. So the 'impeding' garbage designed >> to trip up hackers can get in the way of a legitimate developer trying >> to create a helpful tool. So before you COMMIT to being able to make >> the tool, you'll need to look at the site itself, to see what all will >> get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need your >> code to work with. The first is to just look at the HTML of the page(s) >> you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, it >> has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create your >> own browser, and dump the HTML to a file. You can also use API calls to >> just directly download the HTML, without a browser. If the page is >> derived from internal (on the website server) variables, you'll need to >> use your own browser to get there and download the source. The second >> way to 'find' the objects you need to deal with are with the object >> browser. Running your code in debug mode, you'll be able to see the >> browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. But >> all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you may >> not be able to capture 'download complete' events. What I have done in >> these cases, where my code puts in data on a page, clicks a button to go >> to the next page, I put my code in a loop, that sits and waits for an >> object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required for >> interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file >> downloaded. It sounded totally convoluted but the question is (and I >> have asked this before without >> a usable response) can I programmatically manipulate web pages to cause >> specific pages to open, >> click buttons, input data into controls etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for the >> person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI >> Business >> Sensitive material. If you are not the intended recipient, please contact >> the sender >> immediately and destroy the material in its entirety, whether electronic or >> hard copy. >> You are notified that any review, retransmission, copying, disclosure, >> dissemination, >> or other use of, or taking of any action in reliance upon this information >> by persons >> or entities other than the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From davidmcafee at gmail.com Mon Dec 13 10:09:41 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 08:09:41 -0800 Subject: [dba-VB] Browser based database In-Reply-To: <4D0637A3.8020609@colbyconsulting.com> References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: U use a click once app for our nationwide sales force. Very easy to implement and using webservice calls, seems like a local app. I'll post some samples when I get into the office Sent from my Droid phone. On Dec 13, 2010 7:12 AM, "jwcolby" wrote: > > Thanks everyone who has responded. > > Both of these are cases where the company is "virtual" and all the stakeholders are scattered > around. The database has to be accessed over the internet, and from who knows where. > > I thought about trying to do an "application" that just pulled the data from a hosted SQL Server but > then you run into installation issues etc. With "clickonce" deployment even that might be possible. > I think if I could do a real app distributed with ClickOnce I would go that route. It just puts > off learning all of the web / html / java stuff. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:45 AM, Mark Breen wrote: > > Hello John, > > > > There are lots of things to consider when you out an app online, security > > being just one. But there are really many other things also, most of which > > I do not know. > > > > However, I am currently happily developing web apps myself, and I spent > > minutes and hours on my coding. > > > > I am using DotNetNuke as my framework and it works a treat. I keep it > > simple and try not to get too fancy. There is loads of help available from > > the groups and forums. > > > > It is not too wild to suggest that in the future 50% or more of our > > customers will want web based front ends, so I urge you to study DNN - a few > > days of reading the forums and the turorials on module development will have > > you coding apps in no time. > > > > Do not be put off by the initial barrier to entry, once you get the hang of > > it, and one you keep it simple, you can code in the same ol' c# style , but > > your GUI will be a DNN website. > > > > Oh, and it if fun also. > > > > Mark > > > > > > On 13 December 2010 06:45, Eric Barro wrote: > > > >> John, > >> > >> ASP.NET uses either C# or VB.NET as the underlying development language. > >> Of > >> course there are other technologies involved such as Javascript, HMTL, CSS > >> etc. > >> > >> There's no way to convert a WinForm application to a web app with one click > >> of a button. You'd have to recreate your WinForm in ASP.NET using the > >> built-in .NET equivalent controls. The good thing is that they are one and > >> the same type of control on the web app (ie TextBox in WinForms is still > >> TextBox on a web app). > >> > >> If you programmed your business logic in separate classes and you refrained > >> from directly referencing controls in the methods then you should be fine > >> and you should be able to use most of your code in a web app. > >> > >> The main things you will need to deal with in a web app such as ASP.NETare > >> the following: > >> > >> 1. Session variables - this is one of the ways you can pass data back and > >> forth from one page to the next since web apps are stateless apps and there > >> is no "automatic way" of "remembering" data from one page to the next. > >> 2. Postback events - when a user clicks a button on a WinForm all you need > >> to do is trap for the click event. On a web app you need to be aware of > >> when > >> postbacks (basically trips to the server) occur so that you can properly > >> trap events or intercept them. > >> 3. Server side versus client side events - this is probably the hardest > >> concept to grasp for most beginning web app developers. > >> 4. Client side scripting - When it's done and said, all ASP.NET does > >> really > >> is render the page in HTML and handle the events using Javascript. You will > >> need to get your feet wet learning Javascript as well. Fortunately, the > >> syntax is based on C but variables and objects are not strongly-typed. > >> > >> --Eric > >> > >> -----Original Message----- > >> From: dba-vb-bounces at databaseadvisors.com > >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > >> Sent: Sunday, December 12, 2010 9:33 PM > >> To: VBA > >> Subject: [dba-VB] Browser based database > >> > >> I need to do two different browser based databases (I think). I know > >> nothing about this. Both > >> clients need to enter data and have multiple users hitting the database > >> from > >> home and office computers. > >> > >> Where do I start? I am getting pretty good with C# / SQL Server but those > >> are computer based > >> "applications". If I could do an internet download installation, I could > >> probably (maybe) go there. > >> Except what about admin rights etc. > >> > >> Is asp.net viable? Is it close to C#? If I keep the data entry screens > >> simple can I do it in C# > >> and then just "press a button" to turn it into ASP.net? Please don't make > >> rude noises here. > >> > >> ;) > >> > >> I just know nothing about internet facing application programming and I > >> feel > >> really inadequate on > >> this stuff. > >> > >> -- > >> John W. Colby > >> www.ColbyConsulting.com > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> _______________________________________________ > >> dba-VB mailing list > >> dba-VB at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/dba-vb > >> http://www.databaseadvisors.com > >> > >> > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Dec 13 10:35:04 2010 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 13 Dec 2010 08:35:04 -0800 Subject: [dba-VB] Web page manipulation In-Reply-To: <4D063CD8.4020303@colbyconsulting.com> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> Message-ID: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 13, 2010 7:34 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Web page manipulation The "clients" are tiny and completely non-technical. One is a non-profit that assists people with disabilities to find service providers and other assistance. They have about a half dozen people that work for them, meeting the people needing assistance, usually in that person's home. The database will be a dozen or so tables and is basically just for hours worked kind of stuff. The other "client" is a prison ministry which has lists of programs they provide in the prisons, volunteers, churches and pastors. Again, as hand full of volunteers that need to get at this information and maintain it, again working out of their homes. Both applications need to hit a database over the internet, and are pretty much simple data entry and some reporting. Both are sure to grow but I need to just get the basics up and running, hopefully fairly rapidly. I have no control over the web hosting. Very likely I will need to use MySQL since that is almost universal for web hosting sites, so if they have a web site already, that will almost certainly be available. Access just seems to be a bad fit for these, and I have zero knowledge even about how to set up the MySQL database, connect to it etc. I have a web site that provides me with these services, already paid for and which I could use initially at least to get set up and running, and up to speed knowledge wise. Eventually I will need to move the data out to their own web hosting if I can. John W. Colby www.ColbyConsulting.com On 12/13/2010 4:48 AM, Mark Breen wrote: > Hello John > > Another choice is to use Sillennium > > It is built for this task and will allow you to easily change your > library of routines when your website changes. > > Mark > > > > > On 10 December 2010 22:33, Drew Wutka wrote: > >> Now for a little more info for you. Yes, you can certainly do this. >> Technically, it's not much different than if someone handed you an >> .mde, and asked you to automate tasks in the mde (so you couldn't >> tweak the source code running the program itself, but you could open >> the mde with VBA, and use the objects within it just like you'd use >> the objects in your own application.) >> >> Trick #1: Just like with an .mde, you have to have a reference to >> the database itself, so with a browser, you need a reference to it. >> You can either programmatically open a browser window (so you'll both >> create the object, and have a reference to it), or you can ask the >> user which browser window they want you to use (so you can grab the >> browser window through code). >> >> Here's an example of how to grab an existing browser window: >> >> Function GetExistingBrowser(strKey As String) Dim SWs As New >> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >> InternetExplorer Dim Resp For Each IE In SWs >> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >> vbQuestion, "Select IE") >> If Resp = vbYes Then >> Set mdie = Nothing >> Set mdie = IE.Application >> NewSormDataEntry strKey, mdie >> Exit Function >> End If >> Next >> End Function >> >> The 'NewSormDataEntry' function is the function I am sending the mdie >> object too (the referenced browser window). In this function strKey >> is the primary key of a record that will be used in that >> NewSormDataEntry to submit data into a web site. >> >> Trick #2: Just like when the development world got a wedgie when >> Microsoft 'secured' Outlook from programs just using it to send >> email, web security can be a real pain in doing something like this. >> The security is put in place to impede (note, I didn't say prevent) a >> hacker from doing nasty stuff to the site. So the 'impeding' garbage >> designed to trip up hackers can get in the way of a legitimate >> developer trying to create a helpful tool. So before you COMMIT to >> being able to make the tool, you'll need to look at the site itself, >> to see what all will get in your way. >> >> Trick #3: There are two ways to 'find' the objects you will need >> your code to work with. The first is to just look at the HTML of the >> page(s) you are going to manipulate. This is where some of those 'impediments' >> come into play. Some sites prevent you from right clicking on a page >> and selecting 'View Source'. Ironically, this is just removing a >> 'shortcut' way to view the HTML source behind a page. It doesn't >> actually HIDE the source, because your browser is viewing the source, >> it has too, otherwise it will have nothing to display. So there are >> multiple ways to 'download' the HTML you can view yourself. Create >> your own browser, and dump the HTML to a file. You can also use API >> calls to just directly download the HTML, without a browser. If the >> page is derived from internal (on the website server) variables, >> you'll need to use your own browser to get there and download the >> source. The second way to 'find' the objects you need to deal with >> are with the object browser. Running your code in debug mode, you'll >> be able to see the browser object, and all of it's child elements. >> >> Trick #4: Events and properties. Setting the value of a textbox, or >> clicking a button, just requires that you know what the events and >> properties of those objects are. I use the MSDN that came with the >> developer edition of Office 2000. It's got a nice HTML guide with >> common HTML form elements, their properties, methods, and events. >> But all that information is also plastered all over the web. >> >> Trick #5: When a page loads, the browser object is there, but you >> may not be able to capture 'download complete' events. What I have >> done in these cases, where my code puts in data on a page, clicks a >> button to go to the next page, I put my code in a loop, that sits and >> waits for an object from the next page to exist. >> >> Of course, if there are applets, or flash media elements, required >> for interaction... can't help ya there, haven't tackled one of those. >> >> Drew >> >> -----Original Message----- >> From: dba-vb-bounces at databaseadvisors.com >> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, December 10, 2010 3:30 PM >> To: VBA >> Subject: [dba-VB] Web page manipulation >> >> My client has to go through a process where he clicks about 20 - 30 >> things to manage to get a file downloaded. It sounded totally >> convoluted but the question is (and I have asked this before without >> a usable response) can I programmatically manipulate web pages to >> cause specific pages to open, click buttons, input data into controls >> etc. >> >> -- >> 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 >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and >> destroy the material in its entirety, whether electronic or hard >> copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than >> the intended recipient is prohibited. >> >> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 13 10:57:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 13 Dec 2010 11:57:48 -0500 Subject: [dba-VB] Web page manipulation In-Reply-To: <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> References: <4D029BE3.1070407@colbyconsulting.com> <4D063CD8.4020303@colbyconsulting.com> <48DF9117FB9942F9B67549D76A075726@murphy3234aaf1> Message-ID: <4D06508C.6030004@colbyconsulting.com> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com > > On 12/13/2010 4:48 AM, Mark Breen wrote: >> Hello John >> >> Another choice is to use Sillennium >> >> It is built for this task and will allow you to easily change your >> library of routines when your website changes. >> >> Mark >> >> >> >> >> On 10 December 2010 22:33, Drew Wutka wrote: >> >>> Now for a little more info for you. Yes, you can certainly do this. >>> Technically, it's not much different than if someone handed you an >>> .mde, and asked you to automate tasks in the mde (so you couldn't >>> tweak the source code running the program itself, but you could open >>> the mde with VBA, and use the objects within it just like you'd use >>> the objects in your own application.) >>> >>> Trick #1: Just like with an .mde, you have to have a reference to >>> the database itself, so with a browser, you need a reference to it. >>> You can either programmatically open a browser window (so you'll both >>> create the object, and have a reference to it), or you can ask the >>> user which browser window they want you to use (so you can grab the >>> browser window through code). >>> >>> Here's an example of how to grab an existing browser window: >>> >>> Function GetExistingBrowser(strKey As String) Dim SWs As New >>> SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim mdie As >>> InternetExplorer Dim Resp For Each IE In SWs >>> Resp = MsgBox("Do you want to select: "& vbCrLf& vbCrLf& >>> IE.LocationName& vbCrLf& vbCrLf& IE.LocationURL, vbYesNo + >>> vbQuestion, "Select IE") >>> If Resp = vbYes Then >>> Set mdie = Nothing >>> Set mdie = IE.Application >>> NewSormDataEntry strKey, mdie >>> Exit Function >>> End If >>> Next >>> End Function >>> >>> The 'NewSormDataEntry' function is the function I am sending the mdie >>> object too (the referenced browser window). In this function strKey >>> is the primary key of a record that will be used in that >>> NewSormDataEntry to submit data into a web site. >>> >>> Trick #2: Just like when the development world got a wedgie when >>> Microsoft 'secured' Outlook from programs just using it to send >>> email, web security can be a real pain in doing something like this. >>> The security is put in place to impede (note, I didn't say prevent) a >>> hacker from doing nasty stuff to the site. So the 'impeding' garbage >>> designed to trip up hackers can get in the way of a legitimate >>> developer trying to create a helpful tool. So before you COMMIT to >>> being able to make the tool, you'll need to look at the site itself, >>> to see what all will get in your way. >>> >>> Trick #3: There are two ways to 'find' the objects you will need >>> your code to work with. The first is to just look at the HTML of the >>> page(s) you are going to manipulate. This is where some of those > 'impediments' >>> come into play. Some sites prevent you from right clicking on a page >>> and selecting 'View Source'. Ironically, this is just removing a >>> 'shortcut' way to view the HTML source behind a page. It doesn't >>> actually HIDE the source, because your browser is viewing the source, >>> it has too, otherwise it will have nothing to display. So there are >>> multiple ways to 'download' the HTML you can view yourself. Create >>> your own browser, and dump the HTML to a file. You can also use API >>> calls to just directly download the HTML, without a browser. If the >>> page is derived from internal (on the website server) variables, >>> you'll need to use your own browser to get there and download the >>> source. The second way to 'find' the objects you need to deal with >>> are with the object browser. Running your code in debug mode, you'll >>> be able to see the browser object, and all of it's child elements. >>> >>> Trick #4: Events and properties. Setting the value of a textbox, or >>> clicking a button, just requires that you know what the events and >>> properties of those objects are. I use the MSDN that came with the >>> developer edition of Office 2000. It's got a nice HTML guide with >>> common HTML form elements, their properties, methods, and events. >>> But all that information is also plastered all over the web. >>> >>> Trick #5: When a page loads, the browser object is there, but you >>> may not be able to capture 'download complete' events. What I have >>> done in these cases, where my code puts in data on a page, clicks a >>> button to go to the next page, I put my code in a loop, that sits and >>> waits for an object from the next page to exist. >>> >>> Of course, if there are applets, or flash media elements, required >>> for interaction... can't help ya there, haven't tackled one of those. >>> >>> Drew >>> >>> -----Original Message----- >>> From: dba-vb-bounces at databaseadvisors.com >>> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Friday, December 10, 2010 3:30 PM >>> To: VBA >>> Subject: [dba-VB] Web page manipulation >>> >>> My client has to go through a process where he clicks about 20 - 30 >>> things to manage to get a file downloaded. It sounded totally >>> convoluted but the question is (and I have asked this before without >>> a usable response) can I programmatically manipulate web pages to >>> cause specific pages to open, click buttons, input data into controls >>> etc. >>> >>> -- >>> 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 >>> >>> The information contained in this transmission is intended only for >>> the person or entity to which it is addressed and may contain II-VI >>> Proprietary and/or II-VI Business Sensitive material. If you are not >>> the intended recipient, please contact the sender immediately and >>> destroy the material in its entirety, whether electronic or hard >>> copy. >>> You are notified that any review, retransmission, copying, >>> disclosure, dissemination, or other use of, or taking of any action >>> in reliance upon this information by persons or entities other than >>> the intended recipient is prohibited. >>> >>> >>> _______________________________________________ >>> dba-VB mailing list >>> dba-VB at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-vb >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Dec 13 11:24:37 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 13 Dec 2010 18:24:37 +0100 Subject: [dba-VB] Web page manipulation Message-ID: Hi John How about LightSwitch: http://www.microsoft.com/visualstudio/en-us/lightswitch It is still in beta, I know, but given the modest requirements of these two apps ... /gustav >>> jwcolby at colbyconsulting.com 13-12-2010 17:57 >>> > If you use a hosting company that supports ASP.NET it is almost a given that they will provide SQL Server. Right. But if I do the Clickonce distribution of a normal C# app then I would not be using ASP.Net and I could just use any web host that provided MySQL, which is just about all of them. John W. Colby www.ColbyConsulting.com On 12/13/2010 11:35 AM, Doug Murphy wrote: > If you use a hosting company that supports ASP.NET it is almost a given that > they will provide SQL Server. > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 13, 2010 7:34 AM > To: Discussion concerning Visual Basic and related programming issues. > Subject: Re: [dba-VB] Web page manipulation > > The "clients" are tiny and completely non-technical. One is a non-profit > that assists people with disabilities to find service providers and other > assistance. They have about a half dozen people that work for them, meeting > the people needing assistance, usually in that person's home. The database > will be a dozen or so tables and is basically just for hours worked kind of > stuff. > > The other "client" is a prison ministry which has lists of programs they > provide in the prisons, volunteers, churches and pastors. Again, as hand > full of volunteers that need to get at this information and maintain it, > again working out of their homes. > > Both applications need to hit a database over the internet, and are pretty > much simple data entry and some reporting. > > Both are sure to grow but I need to just get the basics up and running, > hopefully fairly rapidly. I have no control over the web hosting. Very > likely I will need to use MySQL since that is almost universal for web > hosting sites, so if they have a web site already, that will almost > certainly be available. > > Access just seems to be a bad fit for these, and I have zero knowledge even > about how to set up the MySQL database, connect to it etc. > > I have a web site that provides me with these services, already paid for and > which I could use initially at least to get set up and running, and up to > speed knowledge wise. Eventually I will need to move the data out to their > own web hosting if I can. > > John W. Colby > www.ColbyConsulting.com From davidmcafee at gmail.com Mon Dec 13 18:50:49 2010 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 13 Dec 2010 16:50:49 -0800 Subject: [dba-VB] Browser based database In-Reply-To: References: <4D05AFF2.3070701@colbyconsulting.com> <013d01cb9a91$604a5250$20def6f0$@com> <4D0637A3.8020609@colbyconsulting.com> Message-ID: This time without the RTF Damn, keyboard. That was supposed to say "I use a click once app for our sales force" Here's a sub that calls a webservice and populates a table for a SSCE database: (but you could do what ever you want with your returned dataset) private void retrieveData(int intMode) { // This process will call a webservice passing a parameter which in turn executes a SQL stored procedure, returning a dataset try { // call webservice and populate dataset localhost.Service1 MyObj = new localhost.Service1(); DataSet ds; ds = MyObj.RetrieveSQLdata(intMode); // At this point, the dataset has already been filled by the web service SqlServerCe.SqlCeConnection CEconn; SqlServerCe.SqlCeCommand CEcmd; CEconn = new SqlServerCe.SqlCeConnection(("Data Source =" + (PathPC + FileName))); CEconn.Open(); CEcmd = new SqlServerCe.SqlCeCommand(); CEcmd.Connection = CEconn; // Delete the exisiting data from the iPAQ tables before populating it string TableName = ""; switch (intMode) { case 1: TableName = "PListHdr"; break; case 12: TableName = "PListItems"; break; } CEcmd.CommandText = ("DELETE " + TableName); CEcmd.ExecuteNonQuery(); this.lblStatus.Text = ("Retrieving " + (TableName + " data from SQL")); System.Windows.Forms.Application.DoEvents(); DataRow row; string mystr = ""; int RowCount = 0; foreach (row in ds.Tables[0].Rows) { mystr = ""; if ((intMode == 1)) { mystr = (mystr + "INSERT INTO PListHdr (PListID, PListDesc) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["PListDesc"].ToString + "\')"))); } else if ((intMode == 12)) { mystr = (mystr + "INSERT INTO PListItems (PListID, ItemNo, Price) "); mystr = (mystr + "values("); mystr = (mystr + ("\'" + (row["PListID"].ToString + "\', "))); mystr = (mystr + ("\'" + (row["ItemNo"].ToString + "\', "))); mystr = (mystr + (row["Price"].ToString + ")")); } CEcmd.CommandText = mystr; CEcmd.ExecuteNonQuery(); } this.lblStatus.Text = (TableName + " data retrieved from SQL"); System.Windows.Forms.Application.DoEvents(); CEcmd.Dispose(); CEconn.Close(); CEconn.Dispose(); } catch (Exception ex) { throw new Exception("updateCustMast() Failed"); } } This is how the sub is called from within my local/users' app: public void UpdatePListHdr() { if ((DoesTableExist("PListHdr") == true)) { if (this.chkRunInDebugMode.Checked) { MessageBox.Show("UpdatePListHdr()"); } this.lblStatus.Text = "Retrieving PListHdr data"; System.Windows.Forms.Application.DoEvents(); this.retrieveData(1); } } This is the web service call (you can replace the string mystr=(); line with your favorite dynamic SQL : [WebMethod()] public DataSet RetrieveSQLdata(int intMode) { SqlConnection conn; SqlDataAdapter da; DataSet ds; string mystr = ("EXEC stpRetrieveData \'" + (LoginUser + ("\', " + intMode))); conn = new SqlConnection(strConn); da = new SqlDataAdapter(mystr, conn); da.SelectCommand.Parameters.AddWithValue("@Mode", intMode); ds = new DataSet(); da.Fill(ds); return ds; conn.Close(); } so you can see, it is pretty simple if you are already making similar calls in C# From jwcolby at colbyconsulting.com Wed Dec 15 07:33:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 15 Dec 2010 08:33:48 -0500 Subject: [dba-VB] SSDS Message-ID: <4D08C3BC.7020900@colbyconsulting.com> I am trying to learn how to host data on my own servers, or on a web site that I contract for, and use a service to get that data. I thought that SSDS was the technology that allowed me to do that, but when I start viewing Microsoft's clinics, specifically clinic 6341, I am told I need to "register for, set up a user name" etc... IOW "We have a server in the cloud and sell you"... That is decidedly NOT what I want to do, simply because I have no budget for the "we sell you" part of that contract. Do we know whether SSDS allows me to host my own data and write services to access my own data hosted wherever I want to host that data? If so, where do I go to learn how to do this. I viewed a blog last night. specifically http://channel9.msdn.com/blogs/pdc2008/tl07 which was pretty cool. I have to say I am skeptical that it would work for high volume data transfers simply because of the overhead for each actual piece of data. However for working with databases in the traditional "fill in the tables and generate reports" it looks like a killer way to do business over the internet. I now have three different places (clients) where this would appear to solve my problems with remote users. Is anyone using this stuff to build applications that run on a client but add / edit / browse / report to a database "out there somewhere"? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 16 10:26:19 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 11:26:19 -0500 Subject: [dba-VB] Wrapper classes Message-ID: <4D0A3DAB.2030103@colbyconsulting.com> Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Thu Dec 16 12:28:09 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Dec 2010 21:28:09 +0300 Subject: [dba-VB] Wrapper classes In-Reply-To: <4D0A3DAB.2030103@colbyconsulting.com> References: <4D0A3DAB.2030103@colbyconsulting.com> Message-ID: <3976E26898A345C0AD1865DEB2146C8D@nant> Hi John -- You'd better keep your code within User Custom Control in a (User Custom Controls) class library. User Custom Controls can be nested or inherited - such a nesting/inheritance rarely gets deeper than three levels. And even more strong assertion is true - it never gets deeper than three levels in the projects of my customers, with one-two levels being the most common application cases. And in the case of two levels the upper level User Custom Control (dropped on WinForms) is usually used just as a container (nest) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 16 ??????? 2010 ?. 19:26 To: VBA Subject: [dba-VB] Wrapper classes Before I get too far down this road, I need to know whether a strategy I use is viable or there is a better way to do this. I have a strategy that I developed back in VBA where I wrap a set of controls required to do something along with the logic to do that something into a class. I sink any events for the controls in that class and raise events as required from that class. For example I just created a clsGetFile. In the constructor I pass in a button and a text box. The text box displays the folder that is selected and has a default "starting path". The button creates an OpenFileDialog and allows the user to navigate to and select a file. The class has properties pInitialPath and pFileSpec; I place this class in a ProjBaseObjects and reference that project from anywhere that I need to do a filefind. I have just started using this wrapper class paradigm in C# and just wanted to check with our more experienced .Net developers that this strategy is appropriate in .Net. Thanks, -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 16 15:47:41 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Dec 2010 16:47:41 -0500 Subject: [dba-VB] WCF Message-ID: <4D0A88FD.3080409@colbyconsulting.com> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Dec 17 05:43:46 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 12:43:46 +0100 Subject: [dba-VB] WCF Message-ID: Hi John Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. Microsoft has some intro stuff as well: http://msdn.microsoft.com/en-us/library/gg132851.aspx I haven't worked with WCF for any practical project but would love to follow the thread. /gustav >>> jwcolby at colbyconsulting.com 16-12-2010 22:47 >>> WCF looks like the ticket for my requirement to access data over the internet using a client .Net application. I have three different projects for three different clients all of which really need to interface to a database over the web. WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has done this and wants to start a discussion thread. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 08:20:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:20:17 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0B71A1.5040703@colbyconsulting.com> Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the internet using a client .Net > application. I have three different projects for three different clients all of which really need > to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many acronyms in a single (the first) > chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd see if anyone on the list has > done this and wants to start a discussion thread. > From jwcolby at colbyconsulting.com Fri Dec 17 08:25:52 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 09:25:52 -0500 Subject: [dba-VB] Why use a contract? Message-ID: <4D0B72F0.6010902@colbyconsulting.com> The WCF book I am reading discusses building interfaces / contracts. He uses the term interchangeably. Basically you set up a file that has just the variables and method signatures, and name it. Then you build an actual implementation class that implements the contract. I am the kind of person that likes to know the "why". I don't mind doing something but I find it useful to know the reasons for what I do. So what does the interface / contract do for us in the development process. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 09:13:53 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 10:13:53 -0500 Subject: [dba-VB] DAAB Message-ID: <4D0B7E31.1020902@colbyconsulting.com> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Dec 17 09:39:10 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 17 Dec 2010 10:39:10 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0B71A1.5040703@colbyconsulting.com> References: <4D0B71A1.5040703@colbyconsulting.com> Message-ID: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, December 17, 2010 9:20 AM To: Discussion concerning Visual Basic and related programming issues.; Access Developers discussion and problem solving Subject: Re: [dba-VB] WCF Gustav, If you would like you could work with me to set up a practical scenario, and actually run the client clear over the other side of the pond and see how it all works. Let me be clear, I am doing this and you can participate however you like, from actual code to just watching. To anyone else interested, I make the same offer. I have to build a small database, volunteers, organizations, locations, events etc. So far I have about 12 tables. The objective is to have this small database accessed from anywhere that has an internet connection. I will initially host the database on my in-house servers but eventually will move them off to a web hosting service, perhaps even my own. One specific user is going to populate the tables, and then several users are going to use the database to do occasional data entry, but more often do reporting. How many volunteers? Who worked on Event XYZ. How many volunteers attended event XYZ and how often did each work. We have event ABC in zip code 12345. List the top 30 volunteers closest to that location. That kind of thing. The database / application will be used to allow project managers to staff events with reliable volunteers, and discover which organizations are providing volunteers etc. I started reading Microsoft WCF step by step last night and that author immediately dived right in with example code that... worked with a database, reading and updating tables. I am putting AccessD on the To list for this email in case there are AccessD members not yet on the VB list who might be interested. John W. Colby www.ColbyConsulting.com On 12/17/2010 6:43 AM, Gustav Brock wrote: > Hi John > > Yes, WCF is huge. But you don't need to learn all about it to use it. I have attended some demo session and quite fast you can set up some test scenarios. > Microsoft has some intro stuff as well: > > http://msdn.microsoft.com/en-us/library/gg132851.aspx > > I haven't worked with WCF for any practical project but would love to follow the thread. > > /gustav > > >>>> jwcolby at colbyconsulting.com 16-12-2010 22:47>>> > WCF looks like the ticket for my requirement to access data over the > internet using a client .Net application. I have three different > projects for three different clients all of which really need to interface to a database over the web. > > WCF is... way over my head. I am reading a book - O'Reilly - Learning WCF by Michelle Bustamonte. > About all I can say is wow. Rarely have I encountered so many > acronyms in a single (the first) chapter. I have another book - Microsoft WCF Step By Step by John Sharp. > > I just started reading Learning WCF last night. Luckily I have the holidays to do some heavy reading. > > I think I will be able to eventually figure it out but I thought I'd > see if anyone on the list has done this and wants to start a discussion thread. > _______________________________________________ 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 17 10:07:23 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 17 Dec 2010 17:07:23 +0100 Subject: [dba-VB] DAAB Message-ID: Hi John It looks like that link is superseded by the Enterprise Library of which the newest version is found here: http://msdn.microsoft.com/en-us/library/ff632023.aspx I haven't used it. /gustav >>> jwcolby at colbyconsulting.com 17-12-2010 16:13 >>> Is anyone using this? http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en It is used in the WCF book I am studying and it is not on my computer so I went looking. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 17 10:23:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 17 Dec 2010 11:23:17 -0500 Subject: [dba-VB] WCF In-Reply-To: <506E7CE936E046469D3E00C46F9F8A9C@Gateway> References: <4D0B71A1.5040703@colbyconsulting.com> <506E7CE936E046469D3E00C46F9F8A9C@Gateway> Message-ID: <4D0B8E75.5060201@colbyconsulting.com> Michael, Glad to have you. I am using VS 2008 Standard edition. I will probably go with SQL Server Express in order to allow each client to use their own database hosted wherever they need. My intention is to develop a client application in C#, and a service application in C#. The service application will talk to a database layer and through to SQL Server or MySQL. I will use WCF and services to talk from the client through the internet to the service application. I am so new to this that I am just talking generalities here. From what I am reading, this is the big picture of how it is done. The first chapter of John Sharp's book dives right in and I will be diving right in following along exactly, using his tools / database etc. Once I am able to do so I will bring up a parallel track of the volunteer database. I want to go with the C# client because I just don't like browser based applications. I don't like using them when I am forced to out on the internet, they just always feel clumsy. At this time my clients all use Windows, are all at least at Windows XP, and so can easily host a windows based application. IOW I do not need to run my client app on Linux or other non windows OS so why do browser based apps. I use VisualSVN / Tortoise for source control internal to my business. IIRC Gustav, Shamil and Mark Breen used this same combination for Source control but had the repository on the web. If you remember those guys did a rewrite of Microsoft's Tradewind Access demo database into C#. Back then I was not up to speed in C#. While I hesitate to say I am up to speed now, I am at least minimally functional in C# now, though this WCF thing is going to be a stretch. I will ask them if that repository is still up and whether we can use it. Source control is critical for a community project in order to be able to share the source code and not step on toes. This volunteer database is a real application and a real (non-paying) client (Prison Ministries) and I am using this as a learning tool to get to this paradigm, to be comfortable with this for future development of distributed applications. I may very well start to design even my internal app to use the services paradigm, if for no other reason that to get good at it and stay there. Anyway, that is what I am up to. I have committed to delivering an Access database to Prison Ministries by the first of the year. I am so fast in Access that doing so (for something this small) is doable, however I cannot see how to publish that application over the web in a manner that will stay useful and current and easy to maintain for the future. Not to mention my faith in the future of Access is not very high right now. Ergo C# / WCF services / SQL Server / MySQL. That would seem to be the future. John W. Colby www.ColbyConsulting.com On 12/17/2010 10:39 AM, Michael Mattys wrote: > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called > HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 10:22:32 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 11:22:32 -0500 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: <4D0CDFC8.1010001@colbyconsulting.com> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:16:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:16:09 -0500 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: <4D0CFA69.1050706@colbyconsulting.com> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 12:24:04 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 19:24:04 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Could this be your case: http://forums.asp.net/t/1290251.aspx /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 17:22 >>> My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even be on my machine. Is this deprecated or something? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 18 12:24:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 13:24:15 -0500 Subject: [dba-VB] objectbuilder.dll is missing In-Reply-To: References: Message-ID: <4D0CFC4F.8070903@colbyconsulting.com> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? > From jwcolby at colbyconsulting.com Sat Dec 18 13:31:39 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 18 Dec 2010 14:31:39 -0500 Subject: [dba-VB] And the beat goes on... Message-ID: <4D0D0C1B.8030907@colbyconsulting.com> http://thessdreview.com/latest-buzz/sandforce-firmware-update-confirmed-great-news-for-new-ssd-buyers/ -- John W. Colby www.ColbyConsulting.com From gustav at cactus.dk Sat Dec 18 14:16:32 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:16:32 +0100 Subject: [dba-VB] What does this mean? And do you use it? Message-ID: Hi John Not me. Never had the need for such "factories". It looks like very clever stuff. Thanks for the link - I'll certainly study it. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:16 >>> http://tavaresstudios.com/Blog/post/Deconstructing-ObjectBuilder-What-Is-ObjectBuilder.aspx From gustav at cactus.dk Sat Dec 18 14:17:48 2010 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 18 Dec 2010 21:17:48 +0100 Subject: [dba-VB] objectbuilder.dll is missing Message-ID: Hi John Oh, but I haven't installed this myself, so I'm out of ideas. /gustav >>> jwcolby at colbyconsulting.com 18-12-2010 19:24 >>> I downloaded and installed the version that you provided a link to yesterday (5.0 I believe). John W. Colby www.ColbyConsulting.com On 12/18/2010 1:24 PM, Gustav Brock wrote: > Hi John > > Could this be your case: > > http://forums.asp.net/t/1290251.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 18-12-2010 17:22>>> > My book tells me to reference Microsoft.Practices.Objectbuilder.dll but it does not appear to even > be on my machine. Is this deprecated or something? From listmaster at databaseadvisors.com Sun Dec 19 13:08:22 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sun, 19 Dec 2010 14:08:22 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - Dec 2010 Message-ID: Good day everyone. I hope your Christmas preparations are going well. During the last few months the mail server has been having some problems. So over the Christmas holiday the mail server that all your favourite lists run on will be undergoing a complete upgrade right from the OS to the mail server to the mailing list software. This will mean that there will be some outages of the lists. This outage will most likely happen on Wednesday Dec 29, 2010 starting around 8am ET (1pm GMT). I will send out a notice approx. 30 minutes prior to the server going down. As well, once everything is back up and running, I will send out another notice. If you have any concerns, please let me know. I can be reached at listmaster at databaseadvisors.com or carbonnb at gmail.com. Thanks, Your humble list master Bryan -- Bryan Carbonnell - carbonnb at gmail.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From Gustav at cactus.dk Mon Dec 20 06:28:21 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 20 Dec 2010 13:28:21 +0100 Subject: [dba-VB] WCF Message-ID: Hi all The link for the book: http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 17-12-2010 16:39 >>> Hi John, We're interested also (me and my brother, Eric). I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. You right-click in the main viewing panel and select ant text zoom you want. I want to catch up with you ... Michael R Mattys Business Process Developers www.mattysconsulting.com From jwcolby at colbyconsulting.com Mon Dec 20 06:57:16 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 07:57:16 -0500 Subject: [dba-VB] WCF In-Reply-To: References: Message-ID: <4D0F52AC.3050008@colbyconsulting.com> Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-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 20 12:11:50 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Dec 2010 13:11:50 -0500 Subject: [dba-VB] Multiple instances of SQl Server express Message-ID: <4D0F9C66.6000300@colbyconsulting.com> I have a client using Access BEs which I would like to move to SQL Server Express. The biggest issue in my mind is near term expansion. One reason we need to move is simply that we have already split the BEs a couple of times to keep the size reasonable. We have a BE at 850 MB, 750MB and 500 MB. These are just too big for Access IMHO. OTOH merging them all back into a single SQL Server express BE would result in a pretty large database (by Express standards), although it appears that they did increase the SSE 2008 limitation to 10 gigs. Is anyone using SS Express to try to run a small business - under 50 employees, ~25 users in the db most of the day? Any insights, gotchas, words of wisdom? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 09:07:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 10:07:17 -0500 Subject: [dba-VB] CAL aware software Message-ID: <4D10C2A5.8060007@colbyconsulting.com> I am trying to understand the CAL requirements of Microsoft's Windows 2008 Server and SQL Server 2008. The way I understand it, you buy CALs for each simultaneous connection. Server software gets rather expensive once you buy the software itself and then 30 or more CALs for the OS as well as for SQL Server. Do any of you spend time worrying about how to minimize the effect of the database on CAL utilization? For example do linked tables count differently than ado disconnected recordsets? Linked tables are connected from the time the person opens access to the time they close it as opposed to disconnected recordsets where a connection is made just long enough to get the data. Would the user be legally "connected" even though the application used disconnected recordsets? Any thoughts on how all this applies to CAL requirements. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Tue Dec 21 15:52:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 21 Dec 2010 16:52:48 -0500 Subject: [dba-VB] Microsoft: Bringing Supercomputing To The Masses - Network Computing Message-ID: <4D1121B0.3020101@colbyconsulting.com> Need to model an atomic bomb? -- John W. Colby www.ColbyConsulting.com http://www.networkcomputing.com/cloud-computing/microsoft-bringing-supercomputing-to-the-masses.php From michael at mattysconsulting.com Tue Dec 21 22:27:19 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 21 Dec 2010 23:27:19 -0500 Subject: [dba-VB] WCF In-Reply-To: <4D0F52AC.3050008@colbyconsulting.com> References: <4D0F52AC.3050008@colbyconsulting.com> Message-ID: <923DD10436104846AC478F9A26AF2CC7@Gateway> I found that book needed correction and the following worked for me: My Service.svc contains: <%@ ServiceHost Language="C#" Debug="true" Service=" Products.ProductsServiceImpl" CodeBehind="~/App_Code/ProductsService.cs" %> My Web.config contains: Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 20, 2010 7:57 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] WCF Wow, isn't that cool! Thanks Gustav. John W. Colby www.ColbyConsulting.com On 12/20/2010 7:28 AM, Gustav Brock wrote: > Hi all > > The link for the book: > > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 17-12-2010 16:39>>> > Hi John, > > We're interested also (me and my brother, Eric). > I've downloaded the chm for the John Sharp book and something called HelpExplorer 3 to spare my eyes. > You right-click in the main viewing panel and select ant text zoom you want. > I want to catch up with you ... > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:07:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:07:08 -0500 Subject: [dba-VB] wcf reading Message-ID: <4D12060C.3010905@colbyconsulting.com> ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Wed Dec 22 08:35:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 22 Dec 2010 09:35:51 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <4D12060C.3010905@colbyconsulting.com> References: <4D12060C.3010905@colbyconsulting.com> Message-ID: <7450A227F8B74909A4C32DE228083400@Gateway> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. And boy is WCF dense! The nice thing is that it is pretty high abstraction level and the code is mostly written. Basically you are just configuring existing classes utilizing either XML config files or directly programmatically by setting properties. What this means is that you really can concentrate on your own classes - AFTER you learn what all of the WCF classes are and what their properties do. I learned long ago that I need to read something three times to "get it". So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF appears to be a really powerful paradigm. Chapter 2 intimated that my service class could directly create communications channels via HTTPS (no IIS required) and ended by creating a service that starts when windows starts and provides the service to the application (though using named pipes). Pretty cool! Miles to go before I sleep. And I am looking for a highly recommended (preferably by someone on this list?) book about WCF but written using VS 2008 or even 2010. -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 22 08:38:20 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 09:38:20 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D120D5C.1090409@colbyconsulting.com> Ahhh... time to order up I guess. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:13:40 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:13:40 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi Michael So this link is for an outdated version: Windows Communication Foundation Step By Step by John Sharp 2007 http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf /gustav >>> "Michael Mattys" 22-12-2010 15:35 >>> John, I am reading Windows Communication Foundation 4 Step By Step by John Sharp I thought that what was you were reading; it is for VS 2010. Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, December 22, 2010 9:07 AM To: Access Developers discussion and problem solving; VBA Subject: [dba-VB] wcf reading ATM my main book for studying the WCF is WCF Step By Step. I am having an issue with the fact that the book was written for VS 2005 and I am using VS 2008 and will likely move to 2010 soon. The biggest difference is the XML config tool is apparently different. In 2005 it was a tree which somewhat directly models the XML file itself. In 2008 it is a wizard which does not. Very different, completely disconnects the mind from the XML behind the scenes. From jwcolby at colbyconsulting.com Wed Dec 22 09:26:12 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:26:12 -0500 Subject: [dba-VB] wcf reading In-Reply-To: References: Message-ID: <4D121894.2040209@colbyconsulting.com> That is for the book that I am reading. I bought it used awhile back, and it definitely is outdated - assuming that you have moved on from VS 2005 - which I have. AFAICT the underlying discussions still work, but the VS user interface has changed and very likely there are enhancements to WCF in .Net 4. I have been needing a reason to move up to VS 2010. I guess this is it. ;) John W. Colby www.ColbyConsulting.com On 12/22/2010 10:13 AM, Gustav Brock wrote: > Hi Michael > > So this link is for an outdated version: > > Windows Communication Foundation Step By Step > by John Sharp 2007 > http://www.ca4nul.com/downloads/WCF_Step_by_Step_eBook.pdf > > /gustav > > >>>> "Michael Mattys" 22-12-2010 15:35>>> > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 From jwcolby at colbyconsulting.com Wed Dec 22 09:36:56 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 22 Dec 2010 10:36:56 -0500 Subject: [dba-VB] wcf reading In-Reply-To: <7450A227F8B74909A4C32DE228083400@Gateway> References: <4D12060C.3010905@colbyconsulting.com> <7450A227F8B74909A4C32DE228083400@Gateway> Message-ID: <4D121B18.80604@colbyconsulting.com> I just ordered the latest from Amazon and it will be here in time for some light Christmas reading. ;) Now to install VS 2010. I actually need to learn this stuff. Up to this point all of my clients were location centric and everything happened over an internal network which lessened the need to go here. But services over the internet is the future. The nice thing about WCF is that you can do WWW and TCP endpoints in the same class which makes it possible to use the same system (and possible even application) for internal or external client applications. It is fascinating stuff and may allow me to get around needing to have share rights and the likes for everything. I do a lot of stuff like "save a CSV file to a shared directory", then have a program import the stuff into SQL server etc. As I create servers and stuff, setting up rights to shares is a pita. A service could get around all of that. Maybe. It's a brave new world. John W. Colby www.ColbyConsulting.com On 12/22/2010 9:35 AM, Michael Mattys wrote: > John, > > I am reading Windows Communication Foundation 4 Step By Step by John Sharp > I thought that what was you were reading; it is for VS 2010. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > 585-300-0181 > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, December 22, 2010 9:07 AM > To: Access Developers discussion and problem solving; VBA > Subject: [dba-VB] wcf reading > > ATM my main book for studying the WCF is WCF Step By Step. I am having an > issue with the fact that the book was written for VS 2005 and I am using VS > 2008 and will likely move to 2010 soon. The biggest difference is the XML > config tool is apparently different. In 2005 it was a tree which somewhat > directly models the XML file itself. In 2008 it is a wizard which does not. > Very different, completely disconnects the mind from the XML behind the > scenes. > > And boy is WCF dense! The nice thing is that it is pretty high abstraction > level and the code is mostly written. Basically you are just configuring > existing classes utilizing either XML config files or directly > programmatically by setting properties. > > What this means is that you really can concentrate on your own classes - > AFTER you learn what all of the WCF classes are and what their properties > do. > > I learned long ago that I need to read something three times to "get it". > So I am facing 15 chapters X 3 to "get" WCF, but the up side is that WCF > appears to be a really powerful paradigm. > > Chapter 2 intimated that my service class could directly create > communications channels via HTTPS (no IIS required) and ended by creating a > service that starts when windows starts and provides the service to the > application (though using named pipes). Pretty cool! > > Miles to go before I sleep. > > And I am looking for a highly recommended (preferably by someone on this > list?) book about WCF but written using VS 2008 or even 2010. > > -- > 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 Wed Dec 22 09:53:26 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 22 Dec 2010 16:53:26 +0100 Subject: [dba-VB] wcf reading Message-ID: Hi all This seems right! A 700+ pages monster book. Should keep you busy for the Christmas holiday. /gustav >>> "Michael Mattys" 22-12-2010 15:57 >>> Try here: http://www.free-ebooks-download.org/free-ebook/dotnet/Framework/windows-communication-foundation-4-step-by-step.php From jwcolby at colbyconsulting.com Thu Dec 23 10:22:25 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 23 Dec 2010 11:22:25 -0500 Subject: [dba-VB] OCZ's RevoDrive Preview: An Affordable PCIe SSD - AnandTech :: Your Source for Hardware Analysis and News Message-ID: <4D137741.1020907@colbyconsulting.com> http://www.anandtech.com/show/3788/oczs-revodrive-pcie-ssd-preview-an-affordable-pcie-ssd/8 http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&N=100008120%2050001550%20600038468&IsNodeId=1&name=PCI-E -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Dec 24 11:11:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 24 Dec 2010 12:11:09 -0500 Subject: [dba-VB] VS 2010 user interface Message-ID: <4D14D42D.9000501@colbyconsulting.com> Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Fri Dec 24 11:21:21 2010 From: dbdoug at gmail.com (Doug Steele) Date: Fri, 24 Dec 2010 09:21:21 -0800 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: Well, John, once you've worked with Microsoft products for a couple of years, you'll get used to the idea that the interfaces change constantly. Always for the better, of course. They do test this stuff on thousands of users before releasing it. I think. Or not. Doug On Fri, Dec 24, 2010 at 9:11 AM, jwcolby wrote: > Note to self, never make abrupt and radical changes to the user experience. > > What a jarring experience opening VS 2010. Very likely the menus are > identical but the look and > feel of the opening screen is completely different. > > Why? > > Did the old start page not work? Is the new one miles ahead of / better > than the old? > > Or did we just need to be able to say we made it better? > > I don't know the answer but I know it is jarring. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Fri Dec 24 16:11:00 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 25 Dec 2010 01:11:00 +0300 Subject: [dba-VB] VS 2010 user interface In-Reply-To: <4D14D42D.9000501@colbyconsulting.com> References: <4D14D42D.9000501@colbyconsulting.com> Message-ID: <8FF9D8E62966431780E6EF07937BD2E4@nant> Hi John -- >>> I don't know the answer but I know it is jarring. <<< Yes, the same feeling here. And it was easy to switch VS2003->VS2005->VS2008... Although I'd note they (MS) have completely reworked VS2010 IDE - it's written using Windows Presentation Foundation AFAIHH with many new IDE features therefore the current trouble to adapt to the new IDE isn't worth to worry about :) Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 24 ??????? 2010 ?. 20:11 To: VBA Subject: [dba-VB] VS 2010 user interface Note to self, never make abrupt and radical changes to the user experience. What a jarring experience opening VS 2010. Very likely the menus are identical but the look and feel of the opening screen is completely different. Why? Did the old start page not work? Is the new one miles ahead of / better than the old? Or did we just need to be able to say we made it better? I don't know the answer but I know it is jarring. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Sat Dec 25 22:40:17 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 25 Dec 2010 23:40:17 -0500 Subject: [dba-VB] SQL Server Express version Message-ID: <4D16C731.4080203@colbyconsulting.com> I have SQL Server Express 10 on my laptop (dev machine). That appears to be 2005. I actually have the service there (not running) but I cannot seem to find it in the "programs and features". So how do I uninstall it in order to install the 2008 version? Or if I just do an install will it overwrite the old one? I suspect not. I just installed VS 2010 yesterday and kind of expected that it would install the latest express as part of its install but it does not seem to have done so. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Mon Dec 27 03:40:39 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 12:40:39 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: <5ADDFD61397040118F381468EF41A779@nant> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From gustav at cactus.dk Mon Dec 27 07:04:00 2010 From: gustav at cactus.dk (Gustav Brock) Date: Mon, 27 Dec 2010 14:04:00 +0100 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF object set? Message-ID: Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From shamil at smsconsulting.spb.ru Mon Dec 27 07:53:36 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 27 Dec 2010 16:53:36 +0300 Subject: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? In-Reply-To: References: Message-ID: <20053C1394F2453397A1D32185E51EF1@nant> Hi Gustav -- Sorry, that wasn't copy and paste part of code - original code compiled well. Anyway, I decided to not make it using dynamic approach because this approach creates additional layer of indirection/dynamics, which I should better avoid - it's not worth to introduce that indirection/complexity. 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: 27 ??????? 2010 ?. 16:04 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FW: What is generic way to create ADO.NET EF objectset? Hi Shamil Shouldn't it just read: string entityName = "Supplier"; /gustav >>> shamil at smsconsulting.spb.ru 27-12-2010 10:40 >>> Hi All - That code works: ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(); And I wanted to have something like that: string enitytName = "NorthwindNETEntities.Supplier"; ... ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities(); var dataSet = entities.CreateObjectSet(entityName); IOW to supply entity name as a string variable, but the above code currently returns the following error message: System.InvalidOperationException : Mapping and metadata information could not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'. Googling didn't give any prompt clues here... Thank you. -- Shamil From jwcolby at colbyconsulting.com Mon Dec 27 21:13:40 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:13:40 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? Message-ID: <4D1955E4.5070504@colbyconsulting.com> I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Dec 27 21:25:36 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 22:25:36 -0500 Subject: [dba-VB] You're gonna love this one Message-ID: <4D1958B0.2080602@colbyconsulting.com> http://www.johndcook.com/blog/2010/04/22/visual-studio-2010-is-a-pig/ 1.5 MILLION files? Hmm.... -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Mon Dec 27 21:40:51 2010 From: michael at mattysconsulting.com (Michael Mattys) Date: Mon, 27 Dec 2010 22:40:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <4D1955E4.5070504@colbyconsulting.com> References: <4D1955E4.5070504@colbyconsulting.com> Message-ID: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Dec 27 22:12:51 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 27 Dec 2010 23:12:51 -0500 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <4D1963C3.2@colbyconsulting.com> I will play with it more but VS 2008 worked fine for me, in fact I pretty much love it. I really only installed 2010 to do the WCF4 stuff. If I can run WCF 3.5 (or whatever) then I can afford to wait for MS to sort out the issues with VS 2010. I do real work with VS2008, and it works really well for what I am doing. My only complaints are that sometimes debug step is really slow. Sometimes not. Really strange. My Windows 2008 8 core machine is lightning fast for VS 2008 though, even debug stepping. Of course because it is X64 there is no edit and continue. Sigh. John W. Colby www.ColbyConsulting.com On 12/27/2010 10:40 PM, Michael Mattys wrote: > I have to agree with some of the comments there ... > the one that really puts a lump in my throat is "it will take decades to get > back to a 'Rapid Quality Application Development'" > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, December 27, 2010 10:14 PM > To: VBA > Subject: [dba-VB] Is VS 2010 extremely slow? > > I installed 2010 and it seems to be a dog! > > Anyone else with a similar experience? > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Dec 27 23:16:08 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 28 Dec 2010 00:16:08 -0500 Subject: [dba-VB] Adding an entity model Message-ID: <4D197298.9070806@colbyconsulting.com> The entity modeler does not like nullable FKs. IOW a location might / might not have an organization etc. Generates copious errors! Once I decided to go in and fix that, I had to delete the model and recreate in order to repair the "errors". Just telling it to go fetch the latest from the database did not fix the "errors". OTOH, deleting the entire model and rebuilding it did in fact get rid of all the errors. What a PITA. -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Dec 28 07:44:13 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 16:44:13 +0300 Subject: [dba-VB] Is VS 2010 extremely slow? In-Reply-To: <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> References: <4D1955E4.5070504@colbyconsulting.com> <85EF18D88D0949F7B9CDC410A4172FF2@Gateway> Message-ID: <3A19A89FC90248139C333B686AC14B69@nant> Hi All -- Yes, VS2010 looks slower than VS2008, and VS2010 is a "memory-hog" for sure but that's all I have found so far. Well, one other thing I have got VS2010 GPF-in while in design/IDE mode with "Out Of Memory" error message after about a day of working with it with about 10 projects in a solution. And I have had here on the same simple 2 core 2GB Win2003 PC three or four instances of VS2008 with many projects in every solution used without problems for days... Anyway I do suppose/hope MS should solve most of the issues in VS2010 because the issues AFAIU are mostly caused by the fact that MS developers have rewritten all/most of IDE using managed code (WPF), and solving memory leakage issues of managed code is a tough task but doable (memory leakage in managed code are mainly related to all kinds of "hooks"/delegates/event listeners and that ones can be "unhooked" after accurate code review - MS developers, I guess, simply didn't have enough time for that work because of VS2010 release schedule forced by MS marketing "army"...)... BTW, in that current context of VS2010 being "memory-hog" and slower than VS2008 it's a good time to start using Test Driven Development if you haven't yet started to use it.. Would be also great if MS will release VS2008 SP2 supporting C#4.0 and .NET Framework 4.0... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: 28 ??????? 2010 ?. 6:41 To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] Is VS 2010 extremely slow? I have to agree with some of the comments there ... the one that really puts a lump in my throat is "it will take decades to get back to a 'Rapid Quality Application Development'" Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, December 27, 2010 10:14 PM To: VBA Subject: [dba-VB] Is VS 2010 extremely slow? I installed 2010 and it seems to be a dog! Anyone else with a similar experience? -- 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 shamil at smsconsulting.spb.ru Tue Dec 28 09:44:10 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 18:44:10 +0300 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From Gustav at cactus.dk Tue Dec 28 10:02:17 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 28 Dec 2010 17:02:17 +0100 Subject: [dba-VB] VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Message-ID: Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Googling: http://www.google.ru/search?hl=ru&source=hp&biw=1920&bih=919&q=VS+2010+Could +not+load+file+or+assembly+%27Microsoft.ReportDesigner%2C+Version%3D9.0.0.0% 2C+Culture%3Dneutral%2C+PublicKeyToken%3Db03f5f7f11d50a3a%27+or+one+of+its+d ependencies.+The+located+assembly%27s+manifest+definition+does+not+match+the +assembly+reference.+%28Exception+from+HRESULT%3A+0x80131040%29+&aq=f&aqi=g1 0&aql=&oq=&gs_rfai= resulted in http://connect.microsoft.com/VisualStudio/feedback/details/516964/upgrade-wi zard-fails-to-upgrade-the-reportviewer-winforms-to-v10 where one of the advises coming from MS stated: "Thank you for your feedback. The issue that you have reported is because the v9.0.0.0 ReportViewer control does not ship with VS 2010 (it is replaced with the v10.0.0.0). In order for you to upgrade without the issue, you need to install the v9.0 viewer control first: http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e- bb5f-416d75a1b9ef&displaylang=en BTW, we have chosen not to auto-upgrade the users from 9.0->10.0 because of new API changes, Reporting Server dependency, Framework dependency changes introduced by the 10.0 viewer." But it didn't work here. I did install ReportViewer's Viewer Control as they advised (although I was wondering why should I have to install it if I have VS2008 installed here on the same PC ?-)). It didn't help. So I have finally changed project type as beeing .NET Framework 4.0 based as well as I have set references to Microsoft.ReportViewer.Common.dll v.10.0 Microsoft.ReportViewer.WinForms.dll v.10.0 that helped immediately. I do not care that much on "new API changes, and Framework dependency changes introduced by the 10.0 viewer." they (MS) mention. But I wonder what are "introduced Reporting Server dependency" - wouldn't they imply some setup issues on ASP.NET hosting sites? Do you know what they are/do you have a reference on an article describing this issue? BTW, Microsoft.ReportViewer.Common.dll v.10.0 and Microsoft.ReportViewer.WinForms.dll v.10.0 are dependent on Runtime Vesion v2.0.50727 IOW .NET Framework 2.0 - am I wrong? Thank you. -- Shamil From shamil at smsconsulting.spb.ru Tue Dec 28 13:03:25 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 28 Dec 2010 22:03:25 +0300 Subject: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... In-Reply-To: References: Message-ID: <272AD233109B49728A5A39D959CAF68E@nant> Hi Gustav -- Yes, and with ASP.NET it even (a bit more) nasty: just changing reference to the newer version of Report Viewer Control 10.0 doesn't help. Some manual work is needed. A bit cryptic. And it starts working finally. Hint make new ASP.NET 4.0 Web Reporting project then compare web.config and .aspx files - and make manual editing... I will try to write more on that issue in coming days in I will have time... 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: 28 ??????? 2010 ?. 19:02 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] VS 2010 Could not load file orassembly 'Microsoft.ReportDesigner, Version=9.0.0.0... Hi Shamil Ouch, this sounds nasty. I haven't run any reporting in VS2010 yet but I'll keep an open eye. /gustav >>> shamil at smsconsulting.spb.ru 28-12-2010 16:44 >>> Hi All -- I have got the following error message for VS2008 project converted to VS2010: VS 2010 Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) <<< snip >>> From listmaster at databaseadvisors.com Wed Dec 29 07:19:58 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Wed, 29 Dec 2010 08:19:58 -0500 Subject: [dba-VB] Administrivia - Server Upgrade Message-ID: Good morning folks, The server will be going down in half an hour, at approx 845 ET It will be down for approx 4-6 hours for a complete upgrade. I will send out another email, once we are all back up and running again. If you have any questions while the server is done, please get in touch with me at carbonnb at gmail.com -- Bryan Carbonnell - list master at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From listmaster at databaseadvisors.com Thu Dec 30 08:59:57 2010 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Thu, 30 Dec 2010 09:59:57 -0500 Subject: [dba-VB] Administrivia - Server Upgrade - UPDATE - Dec 30 @ 0955 Message-ID: Good Morning folks, I hope you didn't suffer too many withdrawals from not having your favourite lists yesterday and this morning. The Server upgrade was a challenge to say the least. A Royal PITA to say it closer to what it really was. There are still lots of things to work out, like putting the archives back online. Have no fear, your words of wisdom are being archived (for those lists that have archiving turned on), but the archives aren't available yet. The main goal was to get the lists back up and running, which it appears they are. If you encounter any abnormalities, please let me know ASAP so I can look into it. Things will slowly become normal again over the remainder of the week. Thanks for your patience. during the upgrade. -- Bryan Carbonnell - listmaster at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From shamil at smsconsulting.spb.ru Fri Dec 31 06:13:44 2010 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 31 Dec 2010 15:13:44 +0300 Subject: [dba-VB] Ded Moroz sends you links on sample projects... :) Message-ID: <88C8330964FC47F7A753561E66B42346@nant> Hi All -- New Year Eve is approaching here, and I wanted to send you some gifts from Ded Moroz - here they are: This is a set of projects I have got developed a few days ago during 40+ hours R&D coding marathon. The task was to finish all the work in about 40 hours. So a few bugs left in there as release deadline wasn't possible to move. They (the bugs) are described in readme. But in general all the sample apps work rather well as my tests here show. I'd be interested to hear any comments - in what direction that sample should be better developed. Please write them here, or on http://northwind.codeplex.com . Please do not "judge severely" as as I noted that was very intensive R&D work with little time to think through while coding :) But feel free to comment it as you like. *Do not try* to be politcorrect. Please. I wish all of your Very Happy and Prosperous New Year! Thank you. -- Shamil P.S. Short description of published projects (the sources get downloaded 19 times already and I have got informed privately a couple of days ago just three people): NorthwindNET_4_0_Sources.zip (~24MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192044 NorthwindNET_4_0_SampleApps_Setup.zip (~5MB) http://northwind.codeplex.com/releases/view/26600#DownloadId=192043 Northwind.NET.VS2010.sln ======================== 1. Northwind.NET.EDM.FE - WinForms Front-End (just start-up class and app.config); 2. Northwind.NET.EDM.WinForms.Controls - UI UserControls; 3. Northwind.NET.EDM.Reports - MS ReportViewer 10.0 Reports; 4. Northwind.NET.BLL - Business Layer Library (ADO.NET EDM LINQ Reports' data sources); 5. Northwind.NET.Model - ADO.NET EDM; 6. Northwind.NET.Settings - application settings (wrappers); 7. Northwind.NET.Resources - application resource file; 8. Northwind.NET.Utilities - utility class library; 9. Northwind.NET.Testing.Console - some test functions - it's not true TDD - just a rough approximation; Northwind.NET.MSAccess.sln ========================== I. WinForms FE with MS Access backend Northwind.NET.FE.1.1 - Northwind.NET FE with MS Access backend Northwind.NET.Utilities - Utilities project II. ASP.NET sample application with MS Access backend E:/Projects/SMS/Northwind/Northwind.ASP.NET.MSAccess.Reporting/ - ASP.NET project III. Just a test ASP.NET app - can be removed E:\Projects\SMS\Northwind\Northwind.ASP.NET.MSAccess.Reporting.RDLC.10.0.0.0 Northwind.NET.zzz_OLD.sln ========================= 1. Northwind.NET.FE - WinForms Front-End with MS SQL backend using "plain old" ADO.NET data sets - the project we did last year's April. 2. All the other projects from as in Northwind.NET.VS2010.sln ----------- From jwcolby at colbyconsulting.com Fri Dec 31 20:56:06 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 31 Dec 2010 21:56:06 -0500 Subject: [dba-VB] Happy new year Message-ID: <4D1E97C6.3060000@colbyconsulting.com> To all our members around the world, may the new year be a good one. I am about to go down stairs and watch a movie with my wife, and ring in the new year with a glass of sparkling cider. If you party, do so with restraint. This is a particularly dangerous night to be out on the roads. Happy new year. -- John W. Colby www.ColbyConsulting.com