RSSComputers / Programming / Mobiles (73)

11-08-2016 Write arabic script shortcut, presentation in MsOffice and HTML
21-06-2014 Meet the Pakistani who is reinventing the Internet. Well kind of...
19-02-2014 Collection of e-Books and Articles on Microsoft Technologies
26-03-2013 Restore SharePoint backup from earlier to later version - Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version
21-12-2012 Air bags for electronics devices
08-11-2012 Recursive Query Parent Child Concatenation
25-04-2012 Change or remove filter / filter content from Sharepoint list / library view columns
23-02-2012 Pakistani IT experts win international cyber drill
26-12-2011 Installing XP on computer with SATA hard drive
20-04-2011 Sigin as different user in asp.net using Windows authentication
26-01-2011 Powershell CmdLets
30-05-2010 Update Statistics - Query to find tables and index number of statistics being old
15-04-2010 Detail Error Message for ASP.NET at Web Hosting / Production server
15-03-2010 Passing encrypted data between JavaScript and C#
12-02-2010 Sharepoint - SPWeb.Groups Vs SPWeb.SiteGroups
28-01-2010 Accessing JD Edwards Data on iSeries or AS/400 from a ASP.NET / SQL Encoding / Error problem
28-01-2010 Controls not functional after Export to Excel or Export to PDF of Telerik in Sharepoint Application page
05-10-2009 ASP.NET Cannot open log for source {0}. You may not have write access. - Access is denied
03-09-2009 Turn off Reading pane / Auto Preview for all folders in Outlook
28-08-2009 CRM - The SELECT permission was denied on the object 'BuildVersion', database 'MicrosoftCRM_MSCRM', schema 'dbo'
25-08-2009 CRM - No authority could be contacted for authentication (Report Server)
22-08-2009 CRM - Retrieve Cultures information from CRM into your Custom Web Application
21-08-2009 CRM - Globalization / Localization in Custom Web Application
19-08-2009 CRM - Do you want to save this file? Blank.aspx?
18-08-2009 CRM Exception - Microsoft.Crm.Application.Platform.Report. InternalCreate(String xml)
18-08-2009 CRM Exception - Microsoft.Crm.Reporting.SRSReport.convertDataSource()
03-08-2009 Locale ID (LCID) Chart
24-06-2009 Oracle SQL Developer - Unable to create an instance of the Java Virtual Machine
17-06-2009 Busy at work
17-06-2009 Boss Menu
10-04-2009 Facebook Privacy Setting - Applications
18-03-2009 For a Software House
27-01-2009 Clock ticking on worm attack code
27-01-2009 Detecting Idle time or Inactivity in Windows Forms
27-01-2009 Values of Windows API
23-01-2009 PasswordChar and Set focus on page load for ToolStripTextBox
21-01-2009 Capture Form Close Event
21-01-2009 Richtextbox or multiline textbox and AcceptButton to handle Enter or Tab key press
21-01-2009 Key Combination shortcuts in C# Windows Form
01-01-2009 Application Architecture Guide 2 patterns and practices
01-01-2009 Convert string to hexadecimal and hexadecimal to string
31-12-2008 Implementing Transaction in Stored Procedure
31-12-2008 Implementing Transaction in .NET
25-12-2008 Linux environment in Windows
11-12-2008 Facebook Privacy Setting
27-11-2008 Pakistani group hacks Indian websites - Cyber Attack
26-10-2008 Designations...funny!
16-10-2008 Securing Your ASP.NET Web Applications
15-10-2008 Software blocks car phone users
07-10-2008 Too much in technology!
14-09-2008 Logo Evolution
13-09-2008 Difference between .NET 2.0/3.0/3.5
03-09-2008 Google launches internet browser
27-08-2008 Excel Shortcuts
16-07-2008 Quantum information technology - Enigma variations
04-07-2008 Dead Lock - Boss and Secratory
04-07-2008 Web Service Security using SOAP Extension
24-06-2008 General Web Security Consideration
24-06-2008 ASP.NET Forms Authentication
20-06-2008 Find rowcount, columncount, table size in Sql Server Database
20-06-2008 Developers
19-06-2008 Windows Shortcuts
18-06-2008 Number of Microsoft Certified Professionals Worldwide
16-06-2008 Types of developers
22-05-2008 documentary on Google
12-05-2008 Moonlight (Silverlight for Linux)
24-04-2008 Take Advantage of ASP.NET Built-in Features to Fend Off Web Attacks
01-04-2008 Health, Calculator , Units Conversion All in One. Very useful to all
28-02-2008 General Motors vs. Bill Gates
16-02-2008 Stealth Deployment
14-02-2008 Resignation letter of a Software Employee
12-02-2008 Development
05-05-2007 Knowledge
Fri 23 Jan 2009

In first sight you will not see  PasswordChar property in ToolStripTextBox.
If you want Password char in ToolStripTextBox and To allow ToolStripTextBox to act as Password textbox like * do following

ToolStripTextBox1.TextBox.PasswordChar = '*';


===========================


Usually ToolStripTextBox.Focus() doesn't focus to ToolStripTextBox when opening form or on form load.
To set focus on ToolStripTextBox when opening form or form load, do following

In FOrm1_Activated event

        private void Form1_Activated(object sender, EventArgs e)
        {
            ToolStripTextBox1.Focus();
        }

Or

on Form1_Load event

this.ActiveControl = ToolStripTextBox1.Control;

 

Tags: ,
E-mail this post to someone or Comments here
Wed 21 Jan 2009

In windows form, if you don't want user to close the form by pressing Alt+F4 or Cross (x) button accidently and without saving existing form status, you may need to capture the form close event.

In the FormClosing event of form, FormClosingEventArg has a property called CloseReason. This is very usefull because if you want the Form to stop closing if the closing reason was CloseReason.UserClosing or some thing else.

You can do e.Cancel = true to prevent form being closed, then do something in your code and finally close the form programatically.

e.g.


        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
                e.Cancel = true;

                //Check the status of form, Save form status if required or other logic

                this.Close();
        }

 

 

Tags: ,
E-mail this post to someone or Comments here
Wed 21 Jan 2009

In windows form, if you have richtextbox or multiline textbox then usually enter key use to enter a new line.

But if AcceptButton property of Form is set for some action/button press, then pressing enter key in richtextbox or multiline textbox doesn't enter a new line rather AcceptButton calls.

To supress this set the property AcceptsTab to true in richtexbox. In case of multiline textbox / control set AcceptsReturn and AcceptTab property to true.

 

Tags: ,
E-mail this post to someone or Comments (3)
Wed 21 Jan 2009

Tonight in windows form, using C# language I required to use key combination like we use Ctrl+S to save form, CTRL+F to find etc.

In windows form, its quite easy. Just enable KeyPreview property to true. This property makes the form get the key events before the controls, so you can set the KeyPress event on the form.

Form1.KeyPreview = true;

After that, set the form event for the keypress/key down

this.KeyDown += new KeyEventHandler(this.Form1_KeyDown);

Now shortcut part comes here, follow like this

private void Form1_KeyDown(object sender, KeyEventArgs e)
{
 if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.S)
 {  
  //SaveData();
 }
 else if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.F)
 {  
  //Find();
 }
}

Hope it helps some one.

 

Tags: ,
E-mail this post to someone or Comments (1)
Thu 1 Jan 2009

 Microsoft Application Architecture Guide 2.0‏.  Nice stuff for those who are interested in Application architecture at http://www.codeplex.com/AppArchGuide

Summary :

Parts

Part I, Fundamentals
Part II, Design
Part III, Layers
Part IV, Archetypes

Forewords

*   Foreword by S. Somasegar

*   Foreword by Scott Guthrie

Chapters

*   Introduction

*   Architecture and Design Solutions At a Glance

*   Fast Track

Part I, Fundamentals

*   Chapter 1 - Fundamentals of Application Architecture

*   Chapter 2 - .NET Platform Overview

*   Chapter 3 - Architecture and Design Guidelines

Part II, Design

*   Chapter 4 - Designing Your Architecture

*   Chapter 5 - Deployment Patterns

*   Chapter 6 - Architectural Styles

*   Chapter 7 - Quality Attributes

*   Chapter 8 - Communication Guidelines

Part III, Layers

*   Chapter 9 - Layers and Tiers

*   Chapter 10 - Presentation Layer Guidelines

*   Chapter 11 - Business Layer Guidelines

*   Chapter 12 - Data Access Layer Guidelines

*   Chapter 13 - Service Layer Guidelines

Part IV, Archetypes

*   Chapter 14 - Application Archetypes

*   Chapter 15 - Web Applications

*   Chapter 16 - Rich Internet Applications (RIA)

*   Chapter 17 - Rich Client Applications

*   Chapter 18 - Services

*   Chapter 19 - Mobile Applications

*   Chapter 20 - Office Business Applications (OBA)

*   Chapter 21 - SharePoint Line-Of-Business (LOB) Applications

Appendix

*   Cheat Sheet - patterns & practices Pattern Catalog

*   Cheat Sheet - Presentation Technology Matrix

*   Cheat Sheet - Data Access Technology Matrix

*   Cheat Sheet - Workflow Technology Matrix

*   Cheat Sheet - Integration Technology Matrix

Errata Page

*   Errata Page

Team

*   Core Dev Team: J.D. Meier , Alex Homer, David Hill, Jason Taylor , Prashant Bansode , Lonnie Wall, Rob Boucher Jr, Akshay Bogawat

*   Test Team - Rohit Sharma, Praveen Rangarajan, Kashinath TR, Vijaya Jankiraman

*   Edit Team - Dennis Rea.

*   External Contributors/Reviewers - Adwait Ullal; Andy Eunson; Brian Sletten; Christian Weyer; David Guimbellot; David Ing; David Weller; Derek Greer; Eduardo Jezierski; Evan Hoff; Gajapathi Kannan; Jeremy D. Miller; John Kordyback; Keith Pleas; Kent Corley; Mark Baker; Paul Ballard; Peter Oehlert; Norman Headlam; Ryan Plant; Sam Gentile; Sidney G Pinney; Ted Neward; Udi Dahan

*   Microsoft Contributors / Reviewers - Ade Miller; Amit Chopra; Anna Liu; Anoop Gupta; Bob Brumfield; Brad Abrams; Brian Cawelti; Bhushan Nene; Burley Kawasaki; Carl Perry; Chris Keyser; Chris Tavares; Clint Edmonson; Dan Reagan; David Hill; Denny Dayton; Diego Dagum; Dmitri Martynov; Dmitri Ossipov; Don Smith; Dragos Manolescu; Elisa Flasko; Eric Fleck; Erwin van der Valk; Faisal Mohamood; Francis Cheung; Gary Lewis; Glenn Block; Gregory Leake; Ian Ellison-Taylor; Ilia Fortunov; J.R. Arredondo; John deVadoss; Joseph Hofstader; Koby Avital; Loke Uei Tan; Luke Nyswonger; Manish Prabhu; Meghan Perez; Mehran Nikoo; Michael Puleio; Mike Francis; Mike Walker; Mubarak Elamin; Nick Malik; Nobuyuki Akama; Ofer Ashkenazi; Pablo Castro; Pat Helland; Phil Haack; Reed Robison; Rob Tiffany; Ryno Rijnsburger; Scott Hanselman; Seema Ramchandani; Serena Yeoh; Simon Calvert; Srinath Vasireddy; Tom Hollander; Wojtek Kozaczynski

 

To download go to following link.

http://www.codeplex.com/AppArchGuide

 

 

 

E-mail this post to someone or Comments here
Thu 1 Jan 2009

Today I need to convert between string and hexadecimal in C#...

         public string StrToHex(string plainText)
        {
            char[] charArray = plainText.ToCharArray();

            StringBuilder sb = new StringBuilder();
            int num;
            string hex;
            for (int i = 0; i < charArray.Length; i++)

            {
                if (i > 0)
                {
                    sb.Append("-");
                }
                num = Convert.ToInt32(charArray[i]);

                hex = num.ToString("x");
                sb.Append(hex);
            }

             return sb.ToString();
        }

 ===========

         public string HexToStr(string hexaText)
        {
           string[] strArray = hexaText.Split(new char[] { '-' });
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < strArray.Length; ++i)
            {
                sb.Append((char)Convert.ToInt32(strArray[i], 16));
            }
            return sb.ToString();
        }

 ============ 

Implementation as

string str = "TestString";
string hexStr = StrToHex(str);   // => 54-65-73-74-53-74-72-69-6e-67
str = HexToStr(hexStr); // => TestString

 

  

Tags: ,
E-mail this post to someone or Comments here
Wed 31 Dec 2008

Sample Code Oracle stored procedure - In this simple implementation, call commit at the end of work done, and Rollback if any exception occur.

 

PROCEDURE SAVE_TWO_THINGS(
IN_THING_ONE IN VARCHAR2,
IN_THING_TWO IN VARCHAR2)
IS

BEGIN

INSERT INTO TABLEONE
(ACTIVE, THING_DESC)
VALUES
('Y', IN_THING_ONE);


INSERT INTO TABLETWO
(ACTIVE, THING_DESC)
VALUES
('N', IN_THING_TWO);

COMMIT;

EXCEPTION WHEN OTHERS THEN 
ROLLBACK;
END;

E-mail this post to someone or Comments here