 |
|
 |
|
|
|
|
Retrieving DB2 Index Info |
|
Andy's Blog
|
By Andy Beaulieu on
10/20/2004 9:09 AM
|
|
|
|
The Visual Studio.NET add-in for DB2, which is part of the “Stinger“ release, offers a much better implementation of the Server Explorer for DB2 users. But I recently found myself needing Index information from a DB2 database without any good schema exploration tool...
SELECT SYSCOLUMNS.TBNAME, SYSCOLUMNS.TBCREATOR, SYSKEYS.IXNAME, SYSKEYS.COLNAME, SYSKEYS.COLSEQ, SYSCOLUMNS.NAME, SYSCOLUMNS.TBNAME, SYSCOLUMNS.TBCREATOR, SYSCOLUMNS.COLNO, SYSCOLUMNS.COLTYPE, SYSCOLUMNS.LENGTH,SYSCOLUMNS.SCALE, SYSCOLUMNS.NULLS FROM SYSIBM.SYSKEYS SYSKEYS ,SYSIBM.SYSCOLUMNS SYSCOLUMNS INNER JOIN SYSIBM.SYSINDEXES SYSINDEXES ON SYSINDEXES.NAME = SYSKEYS.IXNAME WHERE SYSKEYS.IXCREATOR = SYSCOLUMNS.TBCREATOR AND SYSKEYS.COLNAME = SYSCOLUMNS.NAME AND SYSKEYS.COLNO = SYSCOLUMNS.COLNO AND SYSKEYS.IXCREATOR = '<CREATOR>' AND SYSINDEXES.TBNAME ='<TABLENAME>' AND SYSCOLUMNS.TBNAME = SYSINDEXES.TBNAME AND SYSINDEXES.CREATOR = '<CREATOR>' ORDER BY TBNAME,IXNAME,COLSEQ
|
 |
|
Comments (0)
|
|
|
|
Remoting DataSets |
|
Andy's Blog
|
By Andy Beaulieu on
10/15/2004 1:44 PM
|
|
|
|
I think this is an inside joke with the folks who coded DataSet Serialization and Remoting at Microsoft ;-)
Q: Why did the DataSet cross the Remoting Channel in Binary Format?
A: To get serialized as XML!
(crowd laughs)... When you serialize a DataSet, say through remoting, the DataSet gets serialized as XML. So if you're trying to eek out some performance by using Binary Formatting under Remoting, and you pass a DataSet, (here's the punchline), it gets passed as bloated XML.
Luckily, there are a couple of work-arounds presented in these articles ---
http://support.microsoft.com/?id=829740
http://msdn.microsoft.com/msdnmag/issues/02/12/cuttingedge/
|
 |
|
Comments (0)
|
|
|
|
Finding the CPU Hog |
|
Andy's Blog
|
By Andy Beaulieu on
10/13/2004 1:38 PM
|
|
|
|
This is really a fun game. You have a bunch of services running on a box, and users are reporting sluggish response during off hours. You have a hunch that one of the services is hogging the CPU, but how do you figure out which one is the hog?
Here is a quick step-by-step on finding the CPU hog using performance monitor (XP or W2k):
(1) Goto Control Panel/Administrative Tools/Performance
(2) Select Performance Logs and Alerts, then Counter Logs.
(3) Right-click Counter Logs and select “New Log Settings...” and give the Log a name.
(4) Select Thread from Performance Object, then % Processor Time.
(5) Select the All Instances radio button, then click the Add button, then Close.
(6) For the Log File Type DropDown, you probably want to select CSV so you can toy with the data in Excel afterwards ;-)
|
 |
|
Comments (0)
|
|
|
|
|
|
|
WindowsForms instead of ASP.NET? |
|
Andy's Blog
|
By Andy Beaulieu on
9/26/2004 8:39 PM
|
|
|
|
Don't get me wrong, ASP.NET applications rock. But there are still many applications that don't fit well in an HTML and HTTP world because of complex state management and user interface requirements. Additionally, many enterprises don't have the skilled developers to quickly complete a web project.
But what if you could create a WindowsForms project, make it easily deployable, and not have to worry about configuring .NET security on the client to get your users to run?
Well, if you can guarantee that your users will have the .NET Framework version 1.1 or better, then you can accomplish your goals of easy deployment using WindowsForms, Internet Explorer, and Web Services. Note that by default there are severe security restrictions on WindowsForms applications executed within Internet Explorer using this method. But it is acceptable for an embedded WindowsForms application to call web services on the same server that the assembly was downloaded from. So as long as you can wrap your business classes in a web service, you can proceed....
Here's a quick step-by-step to get a WindowsForms app deployed through your web server, and embedded into IE:
1. Create your WindowsForms Interface You will need to create a User Control to contain your WindowsForms User Interface.
2. Create your Web Site Create a new ASP.NET Web Application and add an ASPX page to host your User Control created in Step 1. Also add a new Web Service (.asmx) file and implement any server side (business logic) classes. Copy the assembly containing your User Control (from Step 1) to your web directory. Don't put it in the bin directory as this will likely cause security problems when the client attempts to download.
Now you can add a tag in your ASPX page to embed the user control. It follows a syntax like so: <OBJECT id=MyControl height=640 width=480 classid=“http:MyUserControlAssembly.dll#MyUserControlNamespace.MyUserControlClassName“></OBJECT>
Note that the “http:” prefix will cause the assembly to be download from the same web directory that the ASPX page exists in.
3. Backtrack and call the web service Now that you created a web service in Step 2, you can go back to your WindowsForms User Control and add a reference to it. Since the release of the .NET Framework 1.1, any user can call a web service from a downloaded WindowsForms assembly. But note that this did not work in version 1.0 of the framework.
|
 |
|
Comments (1)
|
|
|
|
|
|
 |
|
 |
|
|