Archives / 2004 / June
  • Sql Express connection

    So, you have downloaded sql express and installed it.  You want to do something with it but you have no idea where the database is.  Well, I was in that same situation earlier.  I had Sql2k on my system.  It seems that in my situation, SqlExpress is installed as a named instance.  I was able to create a database connection in vb/c# express and create a new database.I got the list of tables, views, sprocs, assemblies and such.  It all appears to be there.


  • Express Setup

    Ok, I got done with the install of VB and C# Express.  The first install, VB Express, took an hour and ten minutes from the time I started the setup program to the time everything was done.  This included the framework and msdn downloads.  The C# Express install took about 10 minutes.  The Sql Express install took about 10 minutes.

    I noticed that Sql Express installed MSXML6, which looks to be a new xml processor.


  • Express Setup

    If you are running XP SP2, you might need to turn off the firewall for the download to run properly.  This is according to Andy Smith and some setup notes he mentioned.

    Update:  Looks like this might not be an issue.  Andy later told me that doing this didn't change anything.


  • Express Question

    Will any of the Express products run on Win64 for AMD64 systems?  I have been running the May CTP 64 bit stuff and I am curious about the Express products.


    Update: No, the Express SKUs do not currently run on 64bit systems with Win64.

  • Setup thoughts / observations on the VB Express Product

    I won't bore you with the “Express products are here download them” theme of everyone else.  ;-)

    Once you download the executables, there are a couple of things that I have seen so far:

    • The setup program takes a long time to run from the time you click on it to the time you see something on screen.  On my 1.8 gigahertz P4 laptop, it took at least 90 seconds to come up.  I started the task manager to see if I had actually started it.  Be patient.
    • The executables that you download seem to be merely a loader program that goes out over the internet and downloads the rest of the stuff.  This includes the framework, msdn library, and sql express.

    I am currently running thru the install on my laptop with my cable modem, so I'll follow up with any thoughts in a little while.


  • Adware/Spyware freakin' sucks

    I was happily typing along doing development today, when bang, out of nowhere, this popup comes up asking if I want to install something from a webpage.  Since, I was happily typing along, the keyboard input for acceptance occurred before I knew what was going on.  Before I knew it, I had all kinds of junk Adware/Spyware crap on my system.  I download Spybot.  That took care of most of it, but not all of it.  The infamous “DSO Exploit” will not freakin' go away.  Since, I had just rebuilt this install of WindowsXP, I had not installed the anti-virus code, just made sure that all of the updates were installed. 

    As a side note, there are some new virus/worms running around that were discovered today.  These articles may be talking about the same things.,1759,1617046,00.asp

    What a happy freakin' birthday.


  • My Crystal is turning darker

    Thursday June 24th is my birthday.  I am 37 years old.  The interesting thing is that I am in better shape now than I was @ 17.
    Anybody get the reference in the subject line?

  • Async commands work with 64 bits

    I just did some async stuff in Whidbey to a Sql2k Server running on a remote machine.  The remote server is running Win2k with Sql2k (both 32 bit) on it.  It works!  Yippee! 

    Here is the code:

    using System.Data.SqlClient;

    private SqlCommand sqlCm = null;

    string strCn = "data source=.....favorite server.....;initial catalog=dbWhidbey;User Id=.....favorite user id......;Password=.....favorite value.....";
    string strSql = "insert into tblTest ( Setting, Value ) values ('Test1', '64 bits')";
    sqlCm = new SqlCommand();
    SqlConnection sqlCn = new SqlConnection();
    sqlCn.ConnectionString = strCn;
    sqlCm.Connection = sqlCn;
    sqlCm.CommandText = strSql;
    sqlCm.CommandType = CommandType.Text;


  • Browsers

    IE for x64 and IE for 32-bit x86 are definitely different browsers.  I figured that there would be some level of integration between the two, but they appear to be pretty much independent of each other.  IE for 32-bit x86 seems to be included so that all of those plug-ins and add-ons that are for IE will work.


  • Windows for x64 really does run existing applications

    I have run the May CTP Whidbey Visual Studio.NET, Mozilla 1.7, OpenOffice, MSN Messenger, and WinZip.  What a cool feeling this is.  Why am I not running MS Office?  Well, I just don't want to go thru the registration hassles.  There is a 32 bit of IE that runs along side the 64 bit version of IE.  All of this seems to run just fine within the Windows on Windows 64 bit (WOW64) layer.

    This is sooooo cool.  BTW, I am typing this message up in the 64 bit IE.

     I may try installing VS.NET 1.1 for some Winforms development that I am doing.  Hopefully, that will work also.


  • 64 bit May CTP bits

    I just got done installing the 64 bit May CTP bits.  VS.NET Whidbey seems to run just fine under the WOW layer.  I did a test connection thru to a Sql2k database on another system.  The named pipes provider did not run, but TCP/IP ran just fine to the other database.  I have to go do some real work now, but I promise that I will post some more stuff regarding how well things work as I get into this.  I'm really excited about this.  Now, where is Yukon for x64?!?


  • Win64 is up and running

    After a fight that started this morning and went off and on all day, I can finally say with a smile that my AMD64 bit system is up and running.  Here is a list of the trials and tribulations that I had to overcome to get things to work.

    1. I did not order a floppy because I haven't used one on my laptop for at least a year. 
      1. When you want to install third-party drivers that don't come with the Win2k3 Server for Extended Systems, you pretty much have to have one.  I went out and bought a USB floppy.
      2. Had to reset the BIOS to get the floppy working.
    2. Video drivers.  The system came with drivers for the NVidia video drivers.
    3. Chipset drivers.  NVidia has some Win64 drivers available on their web site.  These drivers are not listed on AMD's site.
    4. Network drivers.  Nothing seemed to work.  I went into the BIOS and found that my onboard network card was disabled.  I re-enabled it and bang, the network connection was up and working. 

    Great, so what do I do now?  It is WHIDBEY TIME, baby!!!!!!!!!!


  • ADO.NET features and functions

    If you could have someone else write your favorite ADO.NET book, what would you want to see in that book and why?  What features are coming up in Whidbey, Yukon, and beyond that you would want to know about and have real-world examples of?  What databases do you care about connecting to ADO.NET?


  • AMD64 system

    I have finally gotten back to Knoxville with my AMD64 system.  I will be installing Win64 for Extended Systems on it on Thursday.  This may be harder than I thought initially given the lack of device drivers for the platform, but shall see tomorrow.  The device that I am worried the most about is the Serial ATA hard drive.  If I can get that problem solved, then the next problem is going to be Whidbey for x64 systems.


  • Crystal Reports in .NET

    I have just started doing some reporting in .NET.  While I do a lot of complicated development, reporting has not been one of the items that I have done a lot with.  When ever I have done reporting, it has typically been a roll your own reporting with tabular results.  I have known that I needed to do more complicated stuff, but I have just never dived into Crystal Reports.  Well, this afternoon, I finally got into Crystal Reports on a Winform.  I laid out my report, just the way I wanted it.  I kept trying to figure out how to push my datatable into a report.  Finally, I found the command .SetDataSource() which is a method on the report document object.  Here is what my code looks like:

    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using System.Data;
    using System.Data.SqlClient;

    //Code in some method somewhere..........

    DataTable dtData = .....some value returned from an object method.......;
    ReportDocument rdDisplay = new ReportDocument();
    rdDisplay.Load(Environment.CurrentDirectory + @"\..\..\MPReport.rpt");
    rdDisplay.SetDataSource( dtData );
    crvReport.ReportSource = rdDisplay;

    After this, everything worked like I had expect.  I figure I will still find some more problems, but this has gotten me over the hump (and it isn't even Wednesday where I am at).


  • Simple Master Page Example

    I meant to revist my statement about finally getting Master Pages in Whidbey.  I am not going to go into all the details about Master Pages.  There are plenty of web sites and articles that describe that.  Here is a simple example.

    The master page I created looks like the following:

    <%@ Master Language="C#" CompileWith="MasterPage.master.cs" ClassName="MasterPage_master" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
    <html xmlns="" >
     <head runat="server">
      <title>Master Page Sample</title>
      <form id="form1" runat="server">
        <asp:contentplaceholder id="cpHolder" runat="server">
               </asp:contentplaceholder> <BR />
       <p align="center">Copyright 2004<br />
        Wallace B. McClure<br />
        Knoxville, TN 37922<BR />

    In this simple example, there is a new control that you see.  This is the Content Place Holder (cph) control.  The cph control is merely a place holder  that is used to define a place in the master control where content is going to go.  

    Now that we have the master page, how do you apply this to an aspx page?  Here is an example page.

    <%@ Page Language="C#" MasterPageFile="~/Include/Server/MasterPage.master" CompileWith="Results.aspx.cs" ClassName="Results_aspx" Title="Test Page" %>
    asp:Content runat=“server“ ContentPlaceHolderID="cpHolder" ID="ContentId">this is a test help me.........
    <asp:Button ID="Button1" Runat="server" Text="Button" />.............</asp:Content>

    That is all that the aspx page needs.  Note all the “stuff” that is not on this page.  There is not html page definition or anything that looks like a “regular” webform. There is the MasterPageFile item listed at the top of the page which tells the system to go grab the master page and put it together with this file when it is processed by ASP.NET.  There is a control on this page called the Content control.  This control is where you are going to put code that makes this page this page.  You can put controls within the Content control and the resulting page acts just like a regular aspx webform.  In this quicky example, the page acts and behaves just like one would expect.  To make the situation even better, the VS.NET IDE has full support for master pages. 

    So, there is my simple master page example.  I hope that you find this helpful.


  • Asynchronous commands in ADO.NET Whidbey

    It looks like there are currently three aynchronous methods in ADO.NET Whidbey that are based on the SqlCommand object.  These methods are:

    • BeginExecuteNonQuery();
    • BeginExecuteReader();
    • BeginExecuteXmlReader();

    Each has the associated EndExecute Command where you can process the command results if necessary.  I will post more info on each in the near future.


  • ThreadPool in Whidbey with an Example

    If you have used the ThreadPool in .NET 1.x, you know that the threadpool defaults to ( 25 * number of processors ) threads per process.  It can be changed, but it is kinda complicated to track down how to change this.  Well, MS has made changing the threadpool to make this easily changeable.  Here is some example code:

    ThreadPool.GetMaxThreads(out iMaxThrds, out iThrdCompletionPT);

    ThreadPool.SetMaxThreads(Environment.ProcessorCount * 50, iThrdCompletionPT);

    ThreadPool.GetMaxThreads(out iMaxThrds, out iThrdCompletionPT);

    The first time that ThreadPool.GetMaxThreads is called, the value I recieved is 25, which is what I would expect from a system with 1 cpu.  I then call back to SetMaxThreads with the value of 50 times the number of cpus.  when I make the second call into ThreadPool.GetMaxThreads(), i get back the value of 50.  So, if you have exhausted your threadpoll threads, this is a way to get more threads into your threadpool.  One thing that I wanted to mention, this will not change the number of threads that are used by the threadpool.  If the threadpool still thinks that you don't need any more threads, then you won't really get anything by increasing the number of threads in the threadpool.  This is only going to be useful if you have depleted the number of threads in your threadpool.  For example, you have a web application, that makes a web services request, well that will use two threads, one to service the request and another to make the web service request.  Get a bunch of responses, and you might run out of threads in your threadpool.



  • Asynchronous Commands in ADO.NET Whidbey Example #1

    Here is some example code I put together to using the BeginExecuteNonQuery() command.

    using System.Data.SqlClient; //I updated this after the initial post so that I would follow one of my own new rules.

    SqlCommand sqlCm = null;

    public Form1()




    private void btnAsync_Click(object sender, EventArgs e)


    string strCn = "Data Source=localhost;database=......;User Id=......;PassWord=.......;Async=true;"; //Aync=true is very important.

    string strSql = "insert into tblSystemSettings (Value, Setting) values ('Async Test', 'True')";

    SqlConnection sqlCn = new SqlConnection(strCn);

    sqlCm = new SqlCommand(strSql, sqlCn);

    sqlCm.CommandType = CommandType.Text;


    sqlCm.BeginExecuteNonQuery(new AsyncCallback(asyncCallback ), null );


    public void asyncCallback(IAsyncResult result)



    // Optionally do some work based on results.


  • Asynchronous commands in ADO.NET Whidbey

    If you are playing with ADO.NET in Whidbey, this little piece of information is for you.  If you want to use the asynchronous commands and you are running your code on the same system and your Sql Server database, you will want to use the TCP/IP protocol to communicate with your database.  This means that you could specify the data source as an IP Address or localhost, but don't specify the database as (local) or machine name.  Opening a connection will generate an error with the message: Shared Memory Provider:Asynchronous operations not supported.  This took forever for me to figure out.  I was finally able to figure it out from the semi-private Whidbey newsgroups.


  • Going to try AMD

    I just ordered some AMD 64 bit hardware.  I have been hearing to much good about AMD64 and to much bad Intel recently to not take notice.  I decided I would try one and see what what happens.  I have already gotten ahold of WindowsXP for x86 and Windows 2003 Server for x64.  I think I was partially wrong in my previous analysis of Intel vs. AMD.  AMD seems to be driving the AMD64 technology into the volume space.  Intel doesn't seem to be interested in doing that, which I think could potentially be a mistake on their part.  If only AMD had a few more billion dollars in sales for this quarter...........................


  • Development thoughts for the day.

    I am often amazed at how development is similar to other things in our world.  For example, I love golf and working out at the gym.  Developing software is very similar to each of these other items. 

    I have often said that with golf, it is not a question of how good are your good shots, its a question of how bad are your bad shots.  In golf, consistency is very important.  Developing code is very similar.  You can do a bunch of really good development full of good ideas, but you can screw all that up by implmenting a bad algorithm in the wrong spot.  For example, implementing a bubble-sort is ok, but you should know how many records are going to be passed into that bubble sort before you start.  If you are going to sort 10 records, a bubble-sort is fine.  If you need to sort a million records, a bubble-sort is not the algorithm to use.

    With working out, it is important to keep trying.  I have heard the term “sticktoativeness” used in the gym.  Keep at it and good things tend to happen.  The same thing is true with development.  Keep working on your algorithms and coding and good things tend to happen.

    One place where the similarities don't hold up is in real estate development.  My father is in real estate development.  He is always asking why can't we provide a set price for any work.  Well, we can, but it is hard to figure out what the customer wants in anything beyond general terms because even the customer doesn't know what they want.  One example is doors.  In typical residencial development, doors are either 7 feet or 8 feet in height.  In my world, I have found that the customer typically wants one part of the door to be 7 feet and one part to be 8 feet.  Sometimes there is a straight line between the two.  Sometimes there is a step function half way between.  Now, how should you price that one out?