28 March, 2011

Microsoft's IE9 officially out

Been trying out the use of the IE9 browser while it was in beta, and I say that some times, I like it, and at other times, I don't. A lot of factors, one will immediately say.

Tell it to users!

As a programmer, I know what it is being both a user and a developer, complaining about the work of others when they aren't satisfactory, and quickly defending (and absolving) mine when questioned.

Anyway, IE9 experience while it was in beta is varied and mixed. Will that change now that it is officially released?
-----

By Rachel Kelly | Posted: 14 March 2011

SINGAPORE: Microsoft has officially launched the much-anticipated Windows Internet Explorer 9.

A Web browser that allows you to unlock a PC's processing power -- almost 90 percent of which previously went untapped.

That's what Microsoft is striving to do with its latest Internet Explorer.

The idea is to allow the browser to make optimal use of your PC's processing power without the use of plug-ins such as the Adobe Flash Player.

Microsoft says that the beta version of the product is already Microsoft's more-downloaded beta browser of all time.

And the product is free for consumers.

Microsoft's chief marketing officer for consumer and online division (Asia Pacific), Haresh Khoobchandani, said: "Currently, Internet Explorer's overall (market) share is about 72.7% across Asia....we believe this will continue to grow through IE9.

"Windows 7 will be a big driver of that as we start to see more and more people deploy and upgrade to Windows 7, and as more and more Asians go online and ask for a more secure browser and one that is fast, simple, intuitive and immersive. We do expect IE9 will grow on that for all our consumers."

Some digital marketing agencies welcome the move and say it will help to boost speeds and experience.

"It's great for us and Web agencies and people working in the online area because we can create much more immersive experiences that are better for the end customers. At the end of the day, one of the problems is that Web isn't close to real life experience," said Christer Eriksson, regional strategy director at The Upper Storey.

Analysts welcome IE9's launch, saying it is a more competitive response to newer market entrants such as Firefox.

"This is more of a competitive response to some heavy users of the Internet preferring browsers like Firefox more than IE. The multi-threading capability will definitely improve performance. HTML5 will improve video access (and this is important) since video is close to 65% of Internet traffic...," said Jayesh Easwaramony, director of ICT practice at Frost and Sullivan.

Going forward, experts say competition in the browser market is healthy since the user experience is evolving due to the proliferation of tablets and video content over the internet.

- CNA/ir


Taken from ChannelnewsAsia.com; source article is below:
Microsoft's Windows IE 9 officially launched



Enhanced by Zemanta

24 March, 2011

Force termination of Apps; unable to load installer (.vdproj) file in .NET IDE

Image representing Microsoft Silverlight as de...Image via CrunchBaseI encountered some problems with my applications today, and searched the web for help.

> I saw one article (I quickly closed, so I am unable to reference it here) that instructed the single-line code:

Application.Exit()
Environment.Exit(0)

Application.Exit() is used when you are running a WinForms app.
Environment.Exit() is used when you are running a Console app.

If you need the values to be supplied with the method call, these are below, by standard:

0 - Success
1 - InvalidLogin
2 - InvalidFilename
10 - UnknownError


-----

The other problem I encountered on one development machine, not just today, but a few days back, and also today, is the problem of the .NET IDE not loading the installer project. And this only happens in one machine. All the rest are okay.

What came up in my web search are a couple of suggestions, solutions by users having the same problem:

> Run a registry cleaner, like CCleaner. And this is especially if you have done uninstallation of softwares, especially similar products recently.
> The steps below, taken from a forum's article, :

1. Make sure that Visual Studio user project/item templates location is right. (Menu: Tools > Options > Projects and Solutions)
Default path for VS2005 for projects is: %UserProfile%\My Documents\Visual Studio 2005\Templates\ProjectTemplates
Default path for VS2005 for items is: %UserProfile%\My Documents\Visual Studio 2005\Templates\ItemTemplates
*%UserProfile% refers to C:\Documents and Settings\

2. Run devenv.exe /ResetSkipPkgs (Clears all options to skip loading added to VSPackages by users wishing to avoid loading problem VSPackages, then starts Visual Studio.)

3. Use devenv.exe /setup to restore the VS settings to their original state. If you have, for instance, packages that failed to load and you clicked the button to disable them from loading in the future, you can get them back again with the /setup switch. The original problem that caused the package to fail to load may or may not have been corrected so you may need to correct that before all packages load correctly.
This is similar to /ResetSkipPkgs, but also gets newly installed packages resource info completely registered.

4. Run devenv.exe /ResetSettings to isolate the settings problem

5. Visual Studio uses a cache on disk of all the installed project/item templates, to rebuild the cache, please run devenv.exe /InstallVSTemplates (in Start > Run or "Visual Studio 2005 Command Prompt")



-----

I have applied the single-line code to my affected application, and to the others that are okay, in case they do. I have cleaned the registry using CCleaner. It didn't work.

I have also followed all the steps above, from 1 to 5, and the problem persists.

I have now performed reinstallation of VS2005.


> After some time, I find that this has not been how I expected to be fixing this problem. I thought it was easy. My VS2005 reinstallation encountered some error. I remember manually uninstallating a lot of those MS softwares, like Silverlight, RIA toolkits, Expression Blend, etc., etc. I may have removed some critical softwares...

I am reinstalling those MS softwares that I know are critical, and I'm keeping my fingers crossed...

Till then!



Enhanced by Zemanta

14 March, 2011

Oracleclient handling multiple row result set in C#

Image representing Oracle Corporation as depic...Image via CrunchBaseAfter so many days of searching and experimenting on how to use stored procedures in my applications, and specifically, to use Oracleclient, I was getting tired and frustrated. None of my searches in the web is returning the exact article that I need. Until about today.

It was a search, some kind of a last recourse, a button click with my dying enthusiasm... the last blast.

And it somehow paid off!



When I saw the article in this page, I knew that the connection string is defined differently.

I kept on doing search and review and testing.

I should mention that I saw some useful articles in MSDN, where I also learned that when handling result sets that are multiple rows and/or multiple columns, the ordinary query or stored procedure will not work. The use of REF CURSOR is now a mandate.

Professional ADO.NET 2: Programming with SQL Server 2005, Oracle, and MySQLOne such useful reference can be found here. This is where I patterned my stored procedure, made up of a stored procedure in a package.

Then finally, today, I could say that as a last recourse, I typed on "Data Reader on Oracle stored procedure in C#", "using Oracle client to fetch multiple rows", and to the likes of that search strings, and I found one coming from The Code Project, where I am subscribed to.

I found one, which, I am not able to understand immediately. But the connection string is once again stressed out to be different.

I tried a few more times, and then finally, with one last try before I would ditch my attempts forever, it worked!

That page from The Code Project team is here.

I needed the Oracleclient dll file (.NET Managed Provider for Oracle), and as directed by the Code Project article, i downloaded the installer from a Microsoft Download page. Well, find that page here also.


So why did I pursue this item?


Pro .NET Oracle ProgrammingSpeed and efficiency. Not to mention maintainability.

Stored procedures are many times more efficient that inline queries. The comparison I did was to run an inline query and the stored procedure. The timing I put in front and behind is to measure the time the small code would take to complete.

One query. Short one. Simple one.

The inline query took about 1 min and 30 secs.
The stored procedure took about 11 secs to complete.

That is approximately a speed of 6x faster or slower!

And if you need to change anything in the query, you can do it outside without ever disturbing your application - if you are using stored procedures.

And as always said, stored procedures already IN THE Database system are already optimized by the machine, rather that when it is first submitted and run by the machine.


And with all that has been done and tested, I am happy to present my simple code, for my own reference, and for everybody else who would find this useful.

Till then!

-----


Points to note:
  1. Inline query is the same as the stored procedure, modified accordingly.
  2. The parameters (input, output) should have the same names as declared in the stored procedure/package.

-----

using System;
using System.Data;
using System.Data.OleDb;
using System.Data.OracleClient;
using System.Text;
using System.Windows.Forms;

namespace Get_Data_by_OracleClient
{
  public partial class Form1 : Form
  {
    public Form1()
    { InitializeComponent(); }

    private void Form1_Load(object sender, EventArgs e)
    {
      TBox1.Clear();
      TBox2.Clear();
      TBox3.Clear();
      TBox4.Clear();
    }

    private void Btn_Click(object sender, EventArgs e)
    {
      this.Get_Data_by_InlineQ(TBox1.Text, TBox4);
      this.Get_Data_by_StoredP(TBox1.Text, TBox4);
    }

    private void Get_Data_by_InlineQ(String thisITMSDevice, TextBox thisTBox)
    {
      thisTBox.Text = "";
      //
      StringBuilder myQuery = new StringBuilder();
      string dbProvider = "Provider=MSDAORA.1;";
      string dbUser = "User ID=myUserName;";
      string dbPwd = "Password=MyPassword;";
      string dbName = "myOracleDBName";
      string dbODS = dbProvider + dbUser + dbPwd + "Data Source=" + dbName;
      OleDbConnection dbConn = new OleDbConnection(dbODS);
      StringBuilder myResult = new StringBuilder();
      myResult.Append(DateTime.Now.ToLongTimeString()).AppendLine();
      //
      myQuery.Append(" type in your inline query here ");
      //
      OleDbCommand dbCmd = new OleDbCommand(myQuery.ToString(), dbConn);
      //
      try
      {
        dbConn.Open();
        OleDbDataReader dr = dbCmd.ExecuteReader();
        myResult.Append(dr.FieldCount.ToString()).AppendLine();
        while (dr.Read())
        { myResult.Append(dr[0].ToString()).AppendLine(); }
        dr.Close();
        dbConn.Close();
        thisTBox.Text += myResult.ToString();
        thisTBox.Text += DateTime.Now.ToLongTimeString() + "\n";
      }

      catch (Exception ex)
      { MessageBox.Show(ex.ToString()); }
    }

    private void Get_Data_by_StoredP(String thisITMSDevice, TextBox thisTBox)
    {
      thisTBox.Text = "";
      //
      string dbUser = "User ID=myUserName;";
      string dbPwd = "Password=MyPassword;";
      string dbName = "Data Source=myOracleDBName;";
      string dbODS = dbName + "Persist Security Info=True;" + dbUser + dbPwd + "Unicode=True;";
      StringBuilder myResult = new StringBuilder();
      myResult.Append(DateTime.Now.ToLongTimeString()).AppendLine();
      //
      OracleConnection dbConn = new OracleConnection(dbODS);
      OracleCommand dbCmd = new OracleCommand();
      dbCmd.Connection = dbConn;
      dbCmd.CommandText = "GetData_by_Ora.GetData_by_StoredP";
      dbCmd.CommandType = CommandType.StoredProcedure;
      //
      OracleParameter myITMSDev = dbCmd.Parameters.Add("InputVar", OracleType.VarChar, 32);
      myITMSDev.Direction = ParameterDirection.Input;
      OracleParameter myPrcdName = dbCmd.Parameters.Add("ResVar1", OracleType.Cursor);
      myPrcdName.Direction = ParameterDirection.Output;
      //
      myITMSDev.Value = thisITMSDevice.ToString().Trim().ToUpper();
      //
      dbConn.Open();
      OracleDataReader rdr = dbCmd.ExecuteReader();
      myResult.Append(rdr.FieldCount.ToString()).AppendLine();
      while (rdr.Read())
      { myResult.Append(rdr[0].ToString()).AppendLine(); }
      rdr.Close();
      dbConn.Close();
      thisTBox.Text += myResult.ToString();
      thisTBox.Text += DateTime.Now.ToLongTimeString() + "\n";
    }
  }
}
Enhanced by Zemanta