Thursday, October 6, 2011

Execution of the ASP page caused the Response Buffer to exceed its configured limit

If you are getting this error.

Response object error 'ASP 0251 : 80004005'  Response Buffer Limit Exceeded
Execution of the ASP page caused the Response Buffer to exceed its configured limit. 

The reason this is happening is because the IIS 6 cannot handle the large response.

To solve this problem:

  1. Edit the metabase.xml to increase the AspBufferingLimit value that usually is 4194304 (bytes, that means 4Mb)
    1. Before you edit the file on ISS right click the server and check the box "Enable Direct Metabase Edit"
    2. The file is located %SYSTEMROOT%\system32\inetsrv
  2. Use Response.Flush in your code to send blocks of data to the browser
  3. At the top of the page response.buffer = true in your asp code

Thursday, July 28, 2011

SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures'

SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface Area Configuration" in SQL Server Books Online. [SQLSTATE 42000] (Error 15281).  The step failed.

To see the the current setting of OLE Automation procedures:
--

EXEC sp_configure 'Ole Automation Procedures';
GO

--

To give access to the 'Ole Automation Procedures' use this code:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO

sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO

Tuesday, June 28, 2011

Flash movie not showing on Firefox and Chrome

When the flash movie is showing only on IE and is not working on other browsers looks like you are only using the OBJECT tag to show the movie:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" height="180" width="630">             <param name="movie" value="movie.swf">
            <param name="quality" value="high">
            <param name="play" value="true">
            <param name="LOOP" value="false">
        </object>




This tag only works on IE, so we need to add the EMBED tag in order to show the movie in other browsers:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
                codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0"
                width="630" height="180" >
            <param name="movie" value="movie.swf">
            <param name="quality" value="high">
            <param name="play" value="true">
            <param name="LOOP" value="false">
            <embed src="movie.swf" 
                    width="630" height="180" play="true" loop="false" 
                    quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" 
                    type="application/x-shockwave-flash">
            </embed>
        </object>


Tuesday, June 14, 2011

When deleting links getting "No New Data Found to Register" on step 2

When Correcting Link Quantities on Items that are Published in the step 2 we need to get the message:
Successfully Registered Data.

If you get the message:
No New Data Found to Register

Looks like in the Excel tool kit, tab Link, column Transaction type you don't have selected the "DELETE" option, correct it and submitted again.

Thursday, June 9, 2011

In Excel 2007 how do you change column headers from numbers to letters

If you want to change the header letters in Excel to numbers or from numbers to letters do this:

  • Click the office button (Large round button top left)

  • Click on the Excel options

  • Go to Formulas
  • Check or uncheck the R1C1 reference style


Thursday, May 19, 2011

SQL Database is compressed but does not reside in a read-only database or filegroup

If you get the next error when trying to access your database:

The file "C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\mastlog.ldf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.





The problem is that the database file is compressed, to uncompress the database file:

  • Right click on it
  • Select properties
  • Click on the Advance button
  • Be sure the Compress contents to save disk space, is not checked 



Friday, April 22, 2011

Link not open in Internet explorer 8 and 9

If you are facing a problem with IE9 or IE8, that when you open any site in internet explorer, it opens but if you click on any link of any site window opens but with blank, is because IE8 and IE9 on Vista and Windows 7 has a new security restriction that is turned on by default for ALL zones on the security tab.

To solve the problem:

  • Go to Internet Options - Security Tab - Internet - click on the "Custom" button
  • Scroll down to the Miscellaneous section
  • Enable the option "Allow script-initiated windows without size or position constraints"
  • Enable the option "Allow websites to open windows without address or status bar"


There is another possibility, maybe you have DCOM settings, to solve this problem, follow the next steps:
  • Run command
  • Open "DCOMCNFG" to open up the Component services
  • Expand "Component services and computers" 
  • Right hand click on "properties"
  • Click on "Default Properties"
  • Ensure that Default Authentication Level is "Connect"
  • Ensure that Default Impersonation Level is "Identify"


If the options mentioned did not solve your problem there is another possible cause, the (Default) value setting in one or more of registry keys points to an incorrect location for the Urlmon.dll file.
To solve the problem follow the next steps:

  • Click Start, and then click Run
  • Type regsvr32 urlmon.dll, and then click OK
  • When you receive the "DllRegisterServer in urlmon.dll succeeded" message, click OK
  • Repeat the process for the next files:
    • Shdocvw.dll
      Actxprxy.dll
      Oleaut32.dll
      Mshtml.dll
      Browseui.dll
      Shell32.dll
  • Now all you have to do is restart your machine



Wednesday, April 20, 2011

How to show in word Heading4 in the table of contents

By default, Word includes only the top three levels in a table of contents.

To see more headings, you can manually edit the TOC field code.

  1. Press Alt+F9 to display field codes. You should see something similar to this: { TOC \o "1-3" \h } on the table of contents
  2. Type 4 instead of 3 
  3. Press Alt+F9 to hide the field codes 
  4. Press F9 to update the TOC

Tuesday, March 29, 2011

How to get nested tags using Linq To XML query

Let's say we have the next XML:


This is a link example


  
    
      
        Text...
        Text...
        text...
        Text...
        Text...
      
      
        Text
        Text
        Text
      
      
        Info
        Info
        Info
        Info
      
    
  


And you want to get the tags inside on the chapter number two.
You can use this code:
// Load the document
XDocument loadedData = XDocument.Load("kjv.xml");

// Get the testament
IEnumerable<xelement> xmlTestament = loadedData.Descendants("testament").Where(c => ((string)c.Attribute("name")).Equals("New"));

// Get the book
IEnumerable<xelement> xmlBook      = xmlTestament.Descendants("book").Where(c => ((string)c.Attribute("name")).Equals("Matthew"));

// Get the chapter
IEnumerable<xelement> xmlChapter = xmlBook.Descendants("chapter").Where(c => ((string)c.Attribute("number")).Equals("2"));

foreach (string s in xmlChapter.Descendants("verse"))
{
  listBox1.Items.Add(s);
}

// -----------------------------------------------------------------------------------------


This is another way to get the info needed
//
// Load the document
XDocument loadedData = XDocument.Load("kjv.xml");

// Get the info
IEnumerable<XElement> data1 = from query in loadedData.Descendants("testament")
                                             where (string)query.Attribute("name").Value == "New"
                                        from book in loadedData.Descendants("book")
                                             where (string)book.Attribute("name").Value == "Matthew"
                                        from chap in loadedData.Descendants("chapter")
                                             where (string)chap.Attribute("number").Value == "2"
                                        select chap;

foreach (string s in data1.Descendants("verse"))
{
   listBox1.Items.Add(s);
}


//-----------------------------------------------------------------------------------


Offline command hangs when I try to take database offline

Before you take a database offline be sure there are no users / cnnections / or even SQL managment studio connected because you cannot take a database offline until there are no outstanding connections.

You can use the next command before setting it offline:
alter database DB_NAME  set restricted_user with rollback immediate

This will terminiate user connections and rollback their transactions and only allow priviledged users to connect.

Friday, March 11, 2011

VS debugger comes up, may stop on a break, but quickly stop

If the debugger sometimes comes up, may stop on a break, but quickly stops, and the asp.net web page continues running, but the IDE is returned from a debug state to an edit state, the problem is that if script debugging is enabled on IE, your debug state will stop when a popup window is opened. Turning this option off inside internet explorer advanced options makes everything work again.

To Disable Script Debugging in Internet Explorer
1.In Internet Explorer, choose Internet Options from the Tools menu.
2.In the Internet Options dialog box, click the Advanced tab.
3.On the Advanced tab, under Browsing, clear Disable Script Debugging.
4.Click OK.

Monday, March 7, 2011

How to make an image map in Expression Web

If you want to create an image map in Microsoft Expression Web follow the next steps:

  • Show the Picture tool bar on Expression Web
    • Click on View >> Toolbars >> Pictures

  • Mark the hot spot area
    • Display the image in Design mode
    • Select the image that is going to be used as a map
    • On the picture tool bar select rectangle or circle hot spot 
    • Draw the hot spot on the image
    • Type the url needed for that hot sopt


Create dynamic web template in Expression Web

If you want to create a DWT (dynamic web templates) in Microsoft Expression Web, follow the next steps:

  • Create a new document, File >> New >> Page
  • Made the modifications needed to make it look the way you need it
  • Save it as a DWT
    • Click on the main menu File >> Save As...
    • On the Save as type drop down select Dynamic Web Template
    • Click Save
  • Attach this template to an existing page
    • Click on Format >> Dynamic Web Template >> Attach Dynamic Web Template


Thursday, February 24, 2011

Error in Silverlight Application Code: 2104 Category: InitializeError Message

If you are trying to display your Silverlight project on a browser and you get the next error:

The error maybe due to MIME types. You will have to add the following MIME types:
.xaml    application/xaml+xml
.xap    application/x-silverlight-app
.xbap    application/x-ms-xbap
 

To do so:
  • Open your web site on IIS
  • Right click on it and select properties

  • Select the HTTP Headers
  • Click on MIME Types

  • Click the New button

  • Add all the MIME types
  • Click OK
  • Click Apply


Monday, February 21, 2011

Error code 2869 in windows 7

If you are trying to install an application in Windows 7 or Vista, and you get  the error:


The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869

Follow the next steps to solve the problem:

  • Right click the .exe file
  • From the menu select run as administrator
  • Follow the instructions to install your program

Friday, February 18, 2011

Sterling Commerce - Missing GTIN Information when GTIN is already there

If you get the next error when submitting your toolkit:


Description:
If a GTIN is found either on the Global, Target Market or Data Recipient, it must be listed on all three tabs along with any applicable extension tab (Hardlines / Lowe's / AVP). 
Steps to Rectify:
Missing GTIN needs to be added to the Target Market and/or Data Recipient tab. 
Item Number
GTIN
Retailer
Market
Invalid Data
00019374967420 
Target Market Data Missing for GTIN = 00019374967420 

The problem is that there is a blank space at the end of the GTIN, just remove it thenresubmit the Toolkit.

Sterling Commerce - Invalid quantities

If you get the next error or something alike, when submitting a toolkit:



Description:
Quantity entered on the Link Tab does not agree with the quantity supplied on the Global field - Total Quantity of Next Lower Level Trade Item
Steps to Rectify:
Review value entered on the Global tab for Total Quantity of Next Lower Level Trade Item. If this value is correct update the quantity for this Trade Item on the Link tab to reflect the same value. If the value originally entered on the Global tab is incorrect update accordingly and verify that the same value is supplied on the Link tab.
Item Number
GTIN
Retailer
Market
Invalid Data
70000000000001
Total Quantity of Next Lower Level Trade Item = 12, Total Quantities from Item Link = 24


The problem most likely is because your I2 of 5 was previously registered with a different UPC child element. Search your I2 of 5 and UPC and verify if it was used before.


Thursday, February 17, 2011

How to convert Footnotes to Endnotes and vice versa

If you want to How to convert Footnotes to Endnotes and vice versa follow the next steps:

  1. Launch the Footnote and Endnote menu
  2. Select the button Convert in the Location section
  3. The Convert Notes window will be showed
  4. Select the option Convert all footnotes to end notes (or Endnotes to Footnotes)
  5. Click Ok

How to reuse a Footnote in word

If you want to reuse a footnote in a word document, follow the next steps:

  1. Put the cursor where you are going to use the footnote
  2. Go to References >> Cross-reference, a dialog box will open
  3. From the Reference type select the option Footnote
  4. Select the Footnote you want to reuse
  5. Check the box Insert as hyperlink if you want to make reference to the original one
  6.  Click the Insert button

Tuesday, February 8, 2011

How To Remove Add-in Icons From the 2007 Excel Ribbon

In order to remove Add-in icons from the 2007 Excel ribbon you need to delete or rename the xlb file


  1. Got to C:\Users\%UserProfile%\AppData\Roaming in Windows 7 or to  C:\Documents and Settings\%UserProfile%\Application Data in Windows XP
  2. Locate the file Excel12.xlb and rename it
  3. By deleting or renaming this file Excel will create a new one
  4. Run again Excel and the options should be there
Deleting the file or renaming will do no harm to your system
Excel will create a new file for you. (You lost only your customization)
If you make your own toolbars or add buttons to the others this file is important (backup it so you can restore it)

Unable to delete rows on Excel, option is grey out

If you are unable to delete rows or change the format because the option is disabled, looks like one macro or one update changed the configuration profile file of the Excel.
To fix this problem follow the next steps:

  1. Got to C:\Users\%UserProfile%\AppData\Roaming in Windows 7 or to  C:\Documents and Settings\%UserProfile%\Application Data in Windows XP
  2. Locate the file Excel12.xlb and rename it
  3. By deleting or renaming this file Excel will create a new one
  4. Run again Excel and the options should be there

Junction Points in Windows

A Junction Point is a physical location on a local hard disk that points to another location on that disk or another storage device. It is essentially a shortcut.
For the most part, you can ignore Junction Points for everyday use of Windows Vista. The Junction Points are in Vista for backward compatibility of pre-Vista applications. Pre-Vista applications (applications written for XP and 2000) look for folders that are no longer used in Vista. Folders with the “My” prefix such as My Documents, My Pictures, and so on.

Junction points can be identified as follows :
They have the FILE_ATTRIBUTE_REPARSE_POINT, FILE_ATTRIBUTE_HIDDEN, and FILE_ATTRIBUTE_SYSTEM file attributes set.
They also have their access control lists (ACLs) set to deny read access to everyone.

User Profiles in Windows Vista
In Windows XP, 2000, 2003, user profiles are stored under c:\Documents and Settings. In Windows Vista (and the soon to be Windows Server 2008 – Longhorn), profiles are now stored under c:\Users. You will see a c:\Documents and Settings folder in Windows Explorer in Vista, but you will also notice the shortcut icon on this folder, and you will not be able to access this folder. c:\Documents and Settings is now a Junction Point. You can use the dir /aL command to see where c:\Documents and Settings points to or use the table below.
The following table lists the old profile path and the corresponding new path under Windows Vista/Longhorn Server.


Old PathNew Path
\Documents and Settings\Users
\Documents and Settings\Default User or
%LOGONSERVER%\NETLOGON\Default User
\Users\Default or
%LOGONSERVER%\NETLOGON\Default
\Documents and Settings\\My Documents\Users\\Documents
\Documents and Settings\\My Documents\My Pictures\Users\\Pictures
\Documents and Settings\\My Documents\My Music\Users\\Music
\Documents and Settings\\Favorites\Users\\Favorites
N/A\Users\\Contacts
N/A\Users\\Downloads
N/A\Users\\SavedGames
\Documents and Settings\\Application Data\Users\\AppData\Roaming
\Documents and Settings\\Local Settings\Application Data\Users\\AppData\Local
\Documents and Settings\\Start Menu\Users\\AppData\Roaming\Microsoft\Windows\ Start Menu
\Documents and Settings\All Users\Users\Public
\Documents and Settings\All Users\Start Menu\ProgramData\Microsoft\Windows\Start Menu
\Documents and Settings\All Users\Desktop\Users\Public\Desktop


Folders to take note of here are the folders in the All Users path. Many older applications that use out of date methods to resolve system folders, will resolve paths under C:\ProgramData when looking for common locations. For example, the common desktop may be resolved as C:\ProgramData\Desktop, however; this is actually a junction point for C:\ProgramData\Users\Public\Desktop. A dir /aL listing in the C:\ProgramData folder reveals the following Junction Points:

PathPoints To
\ProgramData\Application Data\ProgramData
\ProgramData\Desktop\Users\Public\Desktop
\ProgramData\Documents\Users\Public\Documents
\ProgramData\Favorites\Users\Public\Favorites
\ProgramData\Start Menu\ProgramData\Microsoft\Windows\Start Menu
\ProgramData\Templates\ProgramData\Microsoft\Windows\Templates



Environmental Variables
There are also differences in environment variables between Windows Vista and the older versions of Windows. Windows Server 2003 and below define the following variables relating to profiles:

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\bjohnson\Application Data
HOMEPATH=\Documents and Settings\bjohnson
TEMP=C:\DOCUME~1\bjohnson\LOCALS~1\Temp
TMP=C:\DOCUME~1\bjohnson\LOCALS~1\Temp
USERPROFILE=C:\Documents and Settings\bjohnson

Windows Vista and Longhorn Server define the same variables while adding a couple more.

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\bjohnson\AppData\Roaming
HOMEPATH=\Users\bjohnson
LOCALAPPDATA=C:\Users\bjohnson\AppData\Local
ProgramData=C:\ProgramData
PUBLIC=C:\Users\Public
TEMP=C:\Users\bjohnson\AppData\Local\Temp
TMP=C:\Users\bjohnson\AppData\Local\Temp
USERPROFILE=C:\Users\bjohnson


Source:
http://www.svrops.com/svrops/articles/jpoints.htm

Application Data Folder

The Application Data Folder is part of your user profile. It is customedized controls for the programs that have been installed for the user. Programs such as Outlook and Outliook express can store their mail databases there. It is not a good idea to remove anything from there.
In this folder applications store their files your settings and much more.

On Windows XP you can find this folder on the path:
C:\Documents and Settings\%UserProfile%\Application Data



On Windows 7 the Application Data is not an actual folder, it is a Junction which is only there for backward compatibility. A Junction is a shortcut that redirects files and programs to a different location. You can find the Application Data junction in the next path:
C:\Users\%UserProfile%\AppData\Roaming





Tuesday, February 1, 2011

Linked Server Error: Server 'MyServer' is not configured for RPC

If when you are trying to connect to a 2000 SQL server from 2005 you get the error:

Msg 7411, Level 16, State 1, Line 100
Server 'MyServer' is not configured for RPC.

You need to configure the RCP for your linked server, run the next command to be sure the RCP is not part of your server configuration:

-- Shows all your servers and the configurations 
exec sp_helpserver
------------------------------------------------



If the RCP is not there run the next commands to enable it:

-- Enables the RCP options
exec sp_serveroption @server='MyServer', @optname='rpc', @optvalue='true'
exec sp_serveroption @server='MyServer', @optname='rpc out', @optvalue='true'
------------------------------------------------------------------------------



You can also enable this option from the SQL Server Managment Studio:

  • Righ click on your linked server
  • Select properties
  • On the "Select a page" option click on "Server Options"
  • Be sure Rcp and Rcp Out are True



Monday, January 31, 2011

Calculating Date Difference in C#

In this example we show two ways to calculate the difference between two dates:

            System.DateTime dt1 = new System.DateTime(2011, 1, 31, 12, 0, 0);

            System.DateTime dt2 = new System.DateTime(2011, 2, 30, 12, 0, 0);

            // Option One
            System.TimeSpan diff = dt1  - dt2;

            // Option two
            System.TimeSpan diff = dt1.Subtract(dt2);

            Console.WriteLine("Diff in days " + diff.Days);

            Console.WriteLine("Diff in total days " + diff.TotalDays);

            Console.WriteLine("Diff in hours " + diff.Hours);

            Console.WriteLine("Diff in minutes " + diff.Minutes);

            Console.WriteLine("Diff in seconds" + diff.Seconds);

Wednesday, January 26, 2011

Search option starts double click a folder or drive

This usually happens after adding/modifying the File Folder or Drive entries via the Folder Options File Types dialog, as an attempt to add additional context menu items such as Command Prompt here, Print Directory for folders or drives. To fix it you have two options.

Using the command window:
  1. Click start
  2. Click Run
  3. Type on the command window:     regsvr32 / i shell32.dll

Using the registry:
  1. Open the registry editor
  2. Navigate to: 
    1. HKEY_CLASSES_ROOT \ Directory \ shell       
    2. HKEY_CLASSES_ROOT \ Drive \ shell
  3. On the right pane click the default value
  4. Click modify in the Edit menu
  5. Type in the value data box    none
  6. Click OK
Source: 
http://windowsxp.mvps.org/searchwindow.htm

Friday, January 21, 2011

How to get combined columns NOT IN another table

Lets say we have two tables:

  1. TableA
    1. item_no
    2. upc
  2. TableB
    1. item_no
    2. upc
One item_no can have one or more upcs
On the TableA we have 150 records, on the TableB we have 100 records.
We want to know which items with its upc doesn't exist on the TableB.
The easiest way to solve the problem is join the two columns to manipulate them as one:
   -- Example to find rows not in other table

   SELECT TableA.item_no + '@' + TableA.upc 
       FROM TableA
       WHERE TableA.item_no + '@' + TableA.upc NOT IN (
                select TableB.item_no + '@' + TableB.upc FROM TableB
              )


Friday, January 14, 2011

Controls for windows mobile 6.x

This is a list of some available controls for windows mobile 6.x

Fluid – Windows Mobile 6.x Touch Controls
Fluid is a .NET 2.0 control library for Windows Mobile 6.0/6.1 with touch controls.
Price
Free, open source.
Image

Code example
private void Form1_Load(object sender, EventArgs e)
{
    //Main Panel
    FluidPanel mainPanel = new FluidPanel();
    mainPanel.Bounds = new Rectangle(0, 0, 240, 300);
    mainPanel.BackColor = Color.Red;
    mainPanel.GradientFill = true;
    mainPanel.GradientFillOffset = 30;
    mainPanel.ForeColor = Color.White;
    mainPanel.ShowMaximized();
    fluidHost1.Add(mainPanel);

    //Label
    FluidLabel h1 = new FluidLabel("Fluid サンプル", 0, 0, 240, 40);
    h1.ShadowColor = Color.Black;
    h1.ForeColor = Color.White;
    h1.Alignment = StringAlignment.Center;
    h1.LineAlignment = StringAlignment.Center;
    h1.Font = new Font(FontFamily.GenericSansSerif, 12f, FontStyle.Bold);
    h1.Anchor = FluidControl.AnchorTLR;
    fluidHost1.Add(h1);

    //
    FluidButton okBtn = new FluidButton("OK", 70, 200 - 40, 100, 32);
    okBtn.BackColor = Color.Black;
    //okBtn.Click += new EventHandler(okBtn_Click);
    okBtn.ForeColor = Color.White;
    okBtn.Anchor = FluidControl.AnchorBL;
    fluidHost1.Add(okBtn);
}


Home site
http://fluid.codeplex.com/


Windows Mobile Password Safe
Password Safe is a .NET 2.0 Mobile application that allows you to keep your passwords in your mobile secured with the top secure AES encryption. It provides a nice touch surface with gestures, and can be completely used without a stylus, except when you're writing or editing new passwords.
Price
Free, open source
Image

Code example
void delPasswordButton_Click(object sender, EventArgs e)
{
    passwordToRemove = passwordsListBox.SelectedPassword;
    if (passwordToRemove != null)
    {
        MessageDialog dialog = new MessageDialog();
        dialog.Message = "Delete Password?";
        dialog.Result += new EventHandler(dialog_Result);
        dialog.ShowModal(ShowTransition.FromBottom); 
    }
} 

void dialog_Result(object sender, Fluid.Classes.DialogEventArgs e)
{
    switch (e.Result)
    {
        case System.Windows.Forms.DialogResult.OK:
            ListBuilder.Instance.DeletePassword(passwordToRemove);
            UpdatePasswords();
            this.GoBack();
            break;
    }
} 

Home site
http://www.codeproject.com/KB/windows/MobilePasswordSafe.aspx


Touch Controls Suite 2
Touch Controls Suite 2 is the leading touch UI component suite that allows software developers to create graphically stunning, highly intuitive touch screen user interfaces for Windows Mobile Smartphone applications that are based on the Microsoft .NET Compact Framework (.NETCF).
Price
$99.00
Image
Source example
private void loadList(AnimationDirection ad, AnimationType at)
        {
            //XmlNodeList lName = root.GetElementsByTagName("name");
            //XmlNodeList lDesc = root.GetElementsByTagName("desc");
            //TreeNode RootNode = new TreeNode();

            touchListBox1.PrepareAnimation();
            touchListBox1.Items.Clear();
            touchListBox1.BackColor = System.Drawing.SystemColors.InactiveCaption; //System.Drawing.SystemColors.ControlDark;

            //for (int i = 0; i < lName.Count; i++)
            for (int i = 0; i < root.ChildNodes.Count; i++ )
            {
                TouchListDefaultItem di = getItemList(root.ChildNodes[i]["name"].InnerText, root.ChildNodes[i]["desc"].InnerText, i);
                touchListBox1.Items.Add(di);

                TouchListHeaderItem hi = getItemSpacer();
                touchListBox1.Items.Add(hi);
            }

            //animationType = AnimationType.atSlide;

            //touchListBox1.Refresh();
            touchListBox1.UpdateList();  // (AnimationDirection.adLeft);  //(false); //(ad, at, false);
        }
Home site
http://www.mirabyte.com/en/products/touch-controls-suite/

Smart Device Framework
The Smart Device Framework is aimed at developers wanting to simplify and reduce the cost of their development experience using the .NET Compact Framework. By providing useful extensions the core .NET Compact Framework class libraries, the Smart Device Framework enables developers to concentrate on building core application functionality.
Price
Free / $50 / $500
Image
Home site
http://opennetcf.com/CompactFramework/Products/SmartDeviceFramework/tabid/65/Default.aspx

Programatically make xml tags look aligned

The next code is useful for making your XML tags a little more readable by aligning the tags.

public static String xmlAligned(String Xml)
        {
            String Result = Xml;
            if (Xml.Length != 0)
            {
                try
                {
                    // Load the XmlDocument with the XML variable
                    XmlDocument D = new XmlDocument();
                    D.LoadXml(Xml);
                    MemoryStream MS = new MemoryStream();
                    XmlTextWriter W = new XmlTextWriter(MS, System.Text.Encoding.Unicode);

                    // Format the XML document
                    W.Formatting = Formatting.Indented;

                    // Write the Xml into a formatting XmlTextWriter
                    D.WriteContentTo(W);
                    W.Flush();
                    MS.Flush();

                    // Rewind the MemoryStream in order to read its contents.
                    MS.Position = 0;

                    // Read MemoryStream contents
                    StreamReader SR = new StreamReader(MS);

                    // Get the text
                    String FormattedXml = SR.ReadToEnd();

                    // Get the results
                    Result = FormattedXml;

                    try
                    {
                        // Close all the resources used
                        MS.Close();
                        MS = null;
                        W.Close();
                        W = null;
                    }
                    catch { }
                }
                catch { }
            }

            // Return the aligned XML
            return Result;
        }



XML Programatically make xml tags look aligned

The next code is useful for making your XML tags a little more readable by aligning the tags.



public static String xmlAligned(String Xml)
        {
            String Result = Xml;
            if (Xml.Length != 0)
            {
                try
                {
                    // Load the XmlDocument with the XML variable
                    XmlDocument D = new XmlDocument();
                    D.LoadXml(Xml);
                    MemoryStream MS = new MemoryStream();
                    XmlTextWriter W = new XmlTextWriter(MS, System.Text.Encoding.Unicode);

                    // Format the XML document
                    W.Formatting = Formatting.Indented;

                    // Write the Xml into a formatting XmlTextWriter
                    D.WriteContentTo(W);
                    W.Flush();
                    MS.Flush();

                    // Rewind the MemoryStream in order to read its contents.
                    MS.Position = 0;

                    // Read MemoryStream contents
                    StreamReader SR = new StreamReader(MS);

                    // Get the text
                    String FormattedXml = SR.ReadToEnd();

                    // Get the results
                    Result = FormattedXml;

                    try
                    {
                        // Close all the resources used
                        MS.Close();
                        MS = null;
                        W.Close();
                        W = null;
                    }
                    catch { }
                }
                catch { }
            }

            // Return the aligned XML
            return Result;
        }



Thursday, January 13, 2011

XML reserved characters


Reserved characters in XML

XML reserves certain characters, including less-than (<), greater than (>), and ampersand (&).
To express these characters in your document data, use the equivalent character entity:

less-than (<) &lt;
greater than (>) &gt;
ampersand (&) &amp;

Here is an XML document fragment that uses character entities:


<equation> x &lt; 2 </equation>
      <rhyme> Jack &amp; Jill </rhyme>




Alternatively, data can be protected from the XML parser in a CDATA section.
Use a CDATA section to escape text that would otherwise be recognized as markup.

<comedians>
  <comedian>
    <![CDATA[Abbott & Costello]]>
  </comedian>
 
  <comedian>
    <![CDATA[Laurel & Hardy]]>
  </comedian>
 
  <comedian>
    <![CDATA[Amos & Andy]]>
  </comedian>
</comedians>



Source:
https://studio.tellme.com/general/xmlprimer.html

GridView.RowDataBound the last opportunity to access the data item

Before the GridView control can be rendered, each row in the control must be bound to a record in the data source. The RowDataBound event is raised when a data row (represented by a GridViewRow object) is bound to data in the GridView control. This enables you to provide an event-handling method that performs a custom routine, such as modifying the values of the data bound to the row, whenever this event occurs.

A GridViewRowEventArgs object is passed to the event-handling method, which enables you to access the properties of the row being bound. To access a specific cell in the row, use the Cells property of the GridViewRow object contained in the Row property of the GridViewRowEventArgs object. You can determine which row type (header row, data row, and so on) is being bound by using the RowType property.

void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e)
  {

    if(e.Row.RowType == DataControlRowType.DataRow)
    {
      // Display the company name in italics.
      e.Row.Cells[1].Text = "" + e.Row.Cells[1].Text + "";

    }

  }

GridView.RowDataBound the last opportunity to access the data item

Before the GridView control can be rendered, each row in the control must be bound to a record in the data source. The RowDataBound event is raised when a data row (represented by a GridViewRow object) is bound to data in the GridView control. This enables you to provide an event-handling method that performs a custom routine, such as modifying the values of the data bound to the row, whenever this event occurs.

A GridViewRowEventArgs object is passed to the event-handling method, which enables you to access the properties of the row being bound. To access a specific cell in the row, use the Cells property of the GridViewRow object contained in the Row property of the GridViewRowEventArgs object. You can determine which row type (header row, data row, and so on) is being bound by using the RowType property.

void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e)
  {

    if(e.Row.RowType == DataControlRowType.DataRow)
    {
      // Display the company name in italics.
      e.Row.Cells[1].Text = "" + e.Row.Cells[1].Text + "";

    }

  }

Source:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx

Wednesday, January 12, 2011

HTC Tilt 2 (Touch Pro 2)



If you multitask at all hours and in all places, the HTC Tilt™ 2 is for you. This phone is a power tool. It works as hard as you do.
  • Start a crystal-clear conference call from anywhere. Choose who you want on the call, get them all on the line, and then flip the phone over to turn on your speakerphone. 
  • Wherever you go, there they are. Catch up with every message from any one person—their calls, SMS, emails, Facebook® status updates, everything—all in one place. 
  • Slide, tilt, and get comfortable. A slide-out keyboard and a tilting 3.6-inch screen let you read, watch, and type anywhere, in a desk chair, on a bar stool, or even from an aisle seat. 
  • Mix business with pleasure. Get everything you need for work and play, from Microsoft® Office Mobile to third-party apps to a 3.2 MP video camera. 
Useful links

Tuesday, January 11, 2011

TreeView.ImageIndex is not keeping the image

Problem:
I want to keep the original image when a node is selected on the TreeView, but whenever a node is selected, it's image changes.

Solution:
You should set a node's ImageIndex so it will stay there. TreeView::SelectedImageIndex is a specific image that is used when a node is the selected node. For example, maybe you have a folder icon for all unselected nodes, but when you have a node selected you want that folder to look like an "open" folder. That is where you can use the SelectedImageIndex.

Monday, January 10, 2011

HTC Tilt 2 hard reset

A Hard Reset restores the device to its default settings — the way it was when you first purchased it and turned it on. Any programs you installed, data you entered, and settings you customized on the device will be lost. Only Windows Mobile software and other pre-installed programs will remain.

With software:
To perform a hard reset
1.- Access the Settings Tab>All Settings>System>Clear Storage
2.- Enter  1234 and tap Yes


With the hardware of the phone:
1.- Press and hold the buttons: ON, ANSWER and HANG UP, until you see a warning message on the screen
2.- Release the buttons
3.- Press the VOLUME UP to performance the hard reset or other button to cancel

Mobile - How to just use wifi and totally disable media net

There are several options to disable medianet, you have to do it specially if you don't have a data plan.

Delete the MediaNet connection
Start > Settings > Connections > Connections > Advanced > Select Networks > MEdia Net
Then click on:
Edit > Click and hold on the item next to radio button (MEdia Net).. when the popup screen (similar to windows right click) comes up click on delete. Then do the following. >> General Tab > Click the button "Delete Settings".
NOTE - You cannot delete settings for My ISP & Work Network. Which is fine.
If you ever need the settings back again.. run the Connection Setup Wizard again

Modaco Nodata
The MoDaCo No Data Utility allows you easily turn off your data connection so you don’t accidently use (especially while roaming!)
Get the application here

HD Tweak

These tools allow you to tweak your jewel very easily, to customize it and optimize it as you want.

It includes many tweaks with descriptions. Choose your tweak, check option, and simply apply it!
Get the application here


Mobile - HD Tweak

Description:
These tools allow you to tweak your jewel very easily, to customize it and optimize it as you want.
It includes many tweaks with descriptions. Choose your tweak, check option, and simply apply it!

Install HD Tweak:
- According to your device, download the appropriate version on your PC.
- Plug your device on your PC via USB (Active Sync should be enabled).
- Copy the __.cab file from your PC to your device.
- Click on the cab file on your device to install it wherever you want (Main Memory or Internal Storage or Storage Card).

Use HD Tweak:
- Go to Programs folder and launch HD Tweak by clicking on the icon.
- Choose the options you want to apply on your device.
- Note: Since many options need a soft reset, you will have to restart your device to completely apply them.

Download the application here


Source http://tilt2.blownfuze.org/

Mobile - Advanced Configuration Tool

This program opens the door to your Windows Mobile device, it let’s you enable or disable many features, for example animations, menus, system cache, touch flo 3d, startups etc.
To use this program you need .NET Compact Framework 3.5
Download Advanced Configuration Tool here



  • User Interface
    • Animate windows
    • Window animations frames
    • Window animations delay
    • Animate menus
    • Vertical scrollbar width
    • Vertical scroll arrow height
    • Horizontal scrollbar height
    • Horizontal scroll arrow width
    • Horizontal icon spacing
    • Vertical icon spacing
    • Icon title font size
    • Menu bar font size
    • Popup menu font size
    • Use long delay for gestures
  • Today
    • Single line Date plug-in
    • Show clock/battery on title bar
    • Show Power icon
    • Show Wireless Manager icon
  • Performances
    • File system cache
    • File system cache size
    • File system filter cache
    • PNP unload delay
    • PNP wait I/O delay
    • Glyph cache
  • Power Management
    • SD Memory power management
    • MMC Memory power management
    • NAND Memory power management
    • SIM Memory power management
    • AsyncMAC power management
    • IrSIR power management
    • PPTP power management
    • L2TP power management
    • USB charging
    • Show moving charge bar
    • AC resuming from suspend timeout
    • Battery resuming from suspend timeout
  • Screen
    • Show Orientation settings
    • Landscape mode
    • Landscape fixed
    • Auto device lock
    • Auto device lock timeout
    • Dim backlight in unlock screen
    • Backlight lock level
  • Input
    • Keyboard layout
    • Slide wake up
    • Keyboard backlight timeout
    • Suggested words
  • Network
    • Device friendly name
    • Max TCP Connect Retransmissions
    • Max TCP Data Retransmissions
    • TCP window size
    • DHCP
    • Validate server certificate
    • WPA authentication
    • Wi-Fi scan interval
    • Wi-Fi delay after boot
    • Turn off Wi-Fi if no activity
    • Wi-Fi auto off timeout
  • Phone
    • Phone skin
    • Enable video calls
    • Answer using any key
    • Face down mute ring
    • Phone sleep during call
    • Fast sleep during call
    • End call delay
    • Call progress idle timeout
    • Call ID match
    • Shows all call history in dialer
    • Max entries in call history
    • Call history clean period
    • Show SIM contacts
    • Purge SIM contacts when no SIM
    • DTMF support
    • Show Battery icon
    • Show Band page
    • Show PIN2 page
    • Show NITZ page
    • Show TTY page
    • Show ALS page
    • Use EONS
    • CPHS override
    • 3G prefix in operator name
    • 3G prefix text
  • Bluetooth
    • Bluetooth device name
    • OBEX
    • Use Joint Stereo
    • Bitpool
    • Maximum supported bitpool
    • Minimum supported bitpool
    • Sample rate
    • Audio gateway service
    • Audio gateway power save
  • GPS
    • Assisted GPS
    • Log file
    • Old log file
    • Max. log file size
  • Data Connections
    • GPRS auto attach
    • GPRS disconnect
    • EDGE icon
    • HSDPA icon
    • Legacy GPRS notification
    • HSUPA support
    • Private interface for Internet Sharing
  • Internet Explorer
    • User Agent custom base
    • 4-way navigation
    • ClearType
    • Delay image load
    • Block static ActiveX
    • Play background sounds
    • Show script errors
    • URL Prefix
    • URL suffix
    • Links to keep
    • Search page
    • Maximum connections per server
    • Proxy Auto Detection
  • Messaging
    • Threaded SMS
    • SMS sent notification
    • SMS delivery notification
    • Wake up on new SMS
    • SMS Unicode support
    • SMS recipients limit
    • Max deleted SMS
    • Sync Sent Items
    • SMS callback number
    • SMS priority
    • Show roam warning
  • Calendar
    • Show lunar calendar
    • Show events text in Week view
    • Holiday category
    • Today Item
  • Camera
    • Save location
    • Burst mode
    • Theme Photo mode
    • Sport mode
    • Video Share mode
    • GPS Photo mode
    • Max size in Burst mode
    • Max size in Sport mode
    • Encode photos in portrait mode
    • Capture Key Delay
    • Key Delay
    • Capture Key Delay Time
  • Locations
    • Program Files folder
    • My Documents folder
    • Application Data folder
    • Desktop folder
    • Programs folder
    • StartUp folder
    • Recent folder
    • Favorites folder
    • Fonts folder
    • Default storage location for image files
    • Default storage location for audio files
    • Default storage location for video files
    • Default storage location for downloads
    • Internet Explorer cache location
    • Internet Explorer cookies location
    • Internet Explorer history location
  • Task Manager
    • Refresh interval
    • CPU usage refresh interval
  • Voice Command
    • Respect key lock
    • Default TTS rate
  • Windows Live
    • Live Search URL
  • Splash screen
    • MS splash screen on startup
    • MS splash screen on shutdown
    • Carrier splash screen on startup
    • Carrier splash screen on shutdown
    • MS timeout on startup
    • MS timeout on shutdown
    • Carrier timeout on startup
    • Carrier timeout on shutdown
  • HTC Animation
    • Animation
    • Volume
    • GIF file
    • WAV file
    • Startup GIF file
    • Startup WAV file
    • Shutdown GIF file
    • Shutdown WAV file
    • GIF animation speed
    • Play shutdown animation
  • HTC TouchFLO
    • Scrolling
    • Cube
    • Sound
    • Pressure threshold
    • Finger Pressure
    • High scrolling speed
    • Low scrolling speed
  • HTC TouchFLO 3D
    • Show logo
  • HTC Home
    • Lock position
    • Always open E-mail folder
    • Weather location
    • Weather location code
  • HTC Audio Manager
    • Music player volume
  • HTC Music plug-in
    • Default music player
  • HTC Audio Booster
    • Bass Level
    • Treble Level
    • 3D Sound Level
  • HTC Camera Album
    • OK button
    • Show Camera icon
  • HTC AT Debug Log
    • HTC Debug Log
    • Log mode
    • RAM size
    • File index
    • File size
  • G-sensor
    • G-sensor polling interval
  • Light sensor
    • Light sensor polling
    • Light sensor polling interval
    • Light sensor threshold
    • Light sensor threshold to turn screen off
  • Miscellaneous
    • Security warning
    • Delete CAB file after install
    • Automatic daylight savings switch-over
    • Show daylight saving time notifications

Soft reset to HTC Tilt 2

A soft reset basically resets the memory structure in the handheld. This recovers the device from memory conflicts, corrupted system service chains (mainly due to attempting hacks), memory leaks, and system lockups due to the "Fatal Exception" program errors. Removing the battery from the device while it is still powered on is NOT a soft reset and can actually damage the device.

A Soft Reset is performed by:
Remove the battery cover and the stylus from the device.


Insert the tip of the stylus into the reset hole located on the left side of the device (with the back of the device facing you) .

The device will reboot.

Friday, January 7, 2011

How to pair a Motorola HS850 bluetooth headset

How to place a Motorola HS 850 bluetooth headset into paring mode:
  1. Close the boom to turn the unit off.
  2. Hold down the call button until the blue light comes on.
  3. While holding down the call button, swing the boom open.
  4. (Now you can let go of the call button.)
The headset is now in pairing mode, and you can search for it using your phone. When it asks for a PIN, use 0000.

Wednesday, January 5, 2011

How to give permissions to write to the App_Data folder

If you get an error when trying to write programatically to the App_Data folder, that means the web application doesn't have the rights to write on it.
To resolve the issue, you should grant Full Control permission to ASPNET, NETWORK SERVICE and Internet Guest Account system accounts over App_Data folder:

1. In Windows Explorer, go to the folder, right-click on App_Data folder and choose Properties:


2. In General tab, make sure "Read-only" option is not set:


3. In Security tab, gran "Full Control" permission to ASPNET, NETWORK SERVICE and Internet Guest Account accounts:


4. Click OK. Now, ASP.NET should have enough permissions to read/write files and folders in the App_Data folder.

How to register ASP.NET on IIS after installing the .NET Framework

If you install the .NET Framework on a system that has IIS already installed, IIS is automatically configured to handle requests to ASP.NET pages.
If for some reason is not installed, there is a tool that can do the job for you.
The utility is aspnet_regiis.exe, it is located under %WindowsDir%\Microsoft.NET\Framework\vx.y.zzzz\ and you should call it with the -i parameter in the command window, as showed below:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i





Scroll bars in a asp .net datagrid control

There is a way to add scroll bars to a datadrig without using DIV tags, the solution is very simple, all you have to do is to put your grid inside of a panel control and set the ScrollBars attributes to "Both", see the code below:

<asp:Panel ID="pn_orders" runat="server" ScrollBars="Both" Height="350" Width="500">
                    <asp:GridView ID="dgOrders" runat="server">
                    </asp:GridView>
                </asp:Panel>


If you rather to use DIV tags, there is a great web site where you can find a simple example:
http://www.dnzone.com

How to get directory of App_Data in ASP .NET

To get the full path of the App_Data directory of your application use the next code:

 string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"App_data");