Tuesday, November 17, 2015
Statement is not valid inside a method/multiline lambda.
The code causing the problem looked this this:
Public Function GetSupplyList() As IEnumerable(Of SupplyItemDto)
It took us a minute to realize that in Visual Basic.NET the Implements on a function has to be on the same line as the function. You can also use a line continuation character ("_") to fix the issue.
Of course, this is the exact opposite of Implements on a class where the Implements keyword has to be on the next line or you'll get "End of statement expected".
Friday, January 9, 2015
For a while, my MacBook Pro had been running really slow. Programs would take a long time to start up and I couldn’t figure out why. Googling around I found people saying to check the memory, CPU usage and hard drive space. I had plenty of hard drive space available and Activity Monitor (Mac’s version of the Task Manager) indicated no problems with memory pressure or CPU cycles.
Finally one day l was Googling the problem again and someone said to check the disk permissions. So I went into the Disk Utility, selected my hard drive and clicked on Verify Disk Permissions. After running for a while (~20 minutes) the system showed several permission errors. I ran the Repair Disk Permissions option. Then I rebooted and now my Macbook Pro is running much faster. So if you’re having problems with your Mac and you know your have plenty of memory, hard drive space and no CPU problems, check your disk permissions.
Wednesday, May 8, 2013
The UPPERCASE MENUS in Visual Studio 2012 don't really bother me like they seem to bother everyone else. What gets to me is the lack of color. Every time I try to click the Save icon I end up clicking the Open File icon. Without color, they just look too much alike:
Tuesday, March 12, 2013
Alternating Row Colors
Thursday, April 19, 2012
Single Quoted Strings
If you do any work with SQL statements in SQL Server Management Studio (SSMS), you'll find that SQL Server only accepts strings if they are surrounded by single quotes. You can use double quotes in the PowerBuilder painters and they'll get translated properly on their way to SQL Server. But you may want to just go ahead and use single quotes everywhere, especially if you are trying to track down a problem by copying SQL from PowerBuilder and pasting it into SSMS.
One of my tables had its primary key set in SQL Server to autoincrement. In my datawindow I would insert a row and then do an update. I was expecting the value SQL Server assigned to the primary key column to appear in my datawindow. However, this didn't happen -- at least not reliably -- until I changed my connection string. I had to add Identity='@@IDENTITY':
I had one of my fields defined in SQL Server as a bit. If you looked at the data in SSMS you would see this represented as 1s and 0s. However, when accessing this data from PowerBuilder, every 1 was being converted to a -1. Since I was in control of the schema, I changed the field to tinyint to solve the problem. Of course, if you don't have control of the database layout, I'm not sure how you would handle that.
On your client machines, in addition to the PB runtimes (including PBSNC120.dll, which is for SQL Server), you also need to install the SQL Server Native Client runtime. These come as an msi installer package from Microsoft. When you install the SQL Server client, you'll need to do so as an administrator. Otherwise you'll get a cryptic error message along the lines of "0: -1".
There's a 32-bit and a 64-bit version of the runtime. The 64-bit version won't run on a 32-bit version of Windows and vice versa.
Footnote: My project used PowerBuilder Classic version 12.1 and SQL Server 2008