Blog Home  Home Feed your aggregator (RSS 2.0)  
Software Code Help - Wednesday, November 11, 2009
Blog
 
# Wednesday, November 11, 2009

STA (Single Threaded Apartment) is basically the concept that only one thread will interact with your code at a time. Calls into your apartment are marshaled via windows messages (using a non-visible) window. This allows calls to be queued and wait for operations to complete.

MTA (Multi Threaded Apartment) is where many threads can all operate at the same time and the onus is on you as the developer to handle the thread security.

Wednesday, November 11, 2009 4:34:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Tuesday, October 20, 2009

The .NET Framework uses role-based security and code-based security mechanisms for protecting resources and code from unauthorized use. Click each security mechanism to learn more:

Role Based Security
--------------------
A role-based security model uses authenticated identity information about the user to determine which computing resources the user is authorized to use. The authenticated identity information typically consists of the user’s logon and the roles that are associated with the user. Role-based security in the .NET Framework also allows developers to use Microsoft Windows® user and group information, or to perform custom authentication and authorization by using generic principals and identities.

A role defines a group of related users of an application. For example, a banking application may impose limits on the withdrawal amounts that can be transacted, based on role. In this scenario, tellers may be authorized to process withdrawals that are less than a specified amount, whereas managers may be allowed to process withdrawals above the amount specified. Role-based security in the .NET Framework extensively uses two concepts: identities and principals.

An identity encapsulates the user’s logon name.
A principal encapsulates the membership information of the user’s role.
The runtime provides functionality to perform authorization checks by using identity and principal-related objects directly, or by using imperative or declarative permission checks. .NET Framework role-based security supports authorization by making information about the user, which is constructed from an associated identity, available to the current thread. The identity can be based on a Windows account, or it can be a custom identity unrelated to a Windows account.

Code based Security
-------------------
Code access security is a mechanism provided by the CLR to examine and enforce permissions granted by security policy. To prevent unintended code paths from exposing a security vulnerability, all callers on the call stack must be granted the necessary permissions.

Every application that targets the CLR must interact with its security system. When an application runs, it is automatically evaluated and given a set of permissions by the CLR. Depending on the permissions that the application receives, it either runs properly or generates a security exception. The local security settings on a particular computer ultimately decide which permissions the code receives.

 

Tuesday, October 20, 2009 7:37:22 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question .Net  | 

Process-per-client Architecture.
Multithreaded Architecture.
Hybrid Architecture.

Tuesday, October 20, 2009 7:10:59 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL | SQL Server  | 
# Wednesday, October 07, 2009

A shallow copy creates a new instance of the same type as the original object, and then copies the non-static fields of the original object. If the field is a value type, a bit-by-bit copy of the field is performed. If the field is a reference type, the reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object.

A deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object

Wednesday, October 07, 2009 7:19:22 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1]   C# | Interview Question .Net  | 
# Sunday, October 04, 2009

First Download IE Web Control from this location.

http://www.asp.net/downloads/archived/ie-web-controls/IEWebControls.exe
 
To build the IE Web Controls:

1.  Make sure you have installed the .NET Framework SDK v1.0 or v1.1
2.  Run Build.bat, which will create a build folder in this directory. 
    The build folder contains Microsoft.Web.UI.WebControls.dll and a
    Runtime directory of supporting files.

To run the IE Web Controls:

1.  Copy the contents of the Runtime directory to the webctrl_client\1_0
    directory under your top-level site directory.  For example, if your
    site root is c:\Inetpub\wwwroot, type this at the command prompt:

    IE Installable Path>xcopy /s /i .\build\Runtime c:\Inetpub\wwwroot\webctrl_client\1_0 /y

    This will create the following directory structure under the site:

      /webctrl_client/1_0
        MultiPage.htc
        TabStrip.htc
        toolbar.htc
        treeview.htc
        webservice.htc
        webserviced.htc
        [images]
        [treeimages]

2.  Create a new web application in IIS and copy the contents of the
    samples directory to this application directory.  For example:

    xcopy /s /i .\samples c:\Inetpub\wwwroot\sampleapp /y

3.  Create a /bin subdirectory for the application and copy the file
    Microsoft.Web.UI.WebControls.dll to this directory.

    The contents of the application will be as follows:

      /sampleapp
        multipage.aspx
        state_city.xml
        tabstrip.aspx
        toolbar.aspx
        treeview.aspx
        treeview_bound.aspx
        /bin
          Microsoft.Web.UI.WebControls.dll

4.  Request the sample pages from your Internet Explorer web browser, for
    example: http://localhost/sampleapp/multipage.aspx
   
For additional documentation and samples visit:
http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/webcontrols_entry.asp

Sunday, October 04, 2009 7:36:15 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 
# Tuesday, September 29, 2009

For Example:

Number Value.....
1          AD
2          GD
2          DE
3          IF
4          OG
4          JD

The output I would like is:-

1         AD
2         GD,DE
3         IF
4         OG,JD

You can also resolve this problem using function.

Create Function Concat( @iNumber int )
RETURNS varchar(500)
AS
BEGIN
 
   DECLARE @List varchar(500)
   SET @List = ''
   Select @List = @List + strValue + ',' from Testing
   Where Number = @iNumber
   RETURN LEFT(@List,LEN(@List)-1)
End

And use this function in SQL Query.

select Number, dbo.Concat(Number) from Testing Group By Number

Tuesday, September 29, 2009 3:46:35 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1]   SQL Server  | 
# Tuesday, August 11, 2009
In case, when you are facing colspan problem in datagarid paging section, then use this code to correcting colspan problem.
 
protected void dGrid_PreRender(object sender, EventArgs e)
        {
            try
            {
                DataGrid dgSidDetails = (DataGrid)sender;
                //Fix for numbering being in a left aligned column
                //For some reason, the ColumnSpan property is ignored andnot rendered
                    //unless set using the Attributes
                    if (dgSidDetails.AllowPaging == true && dgSidDetails.AutoGenerateColumns ==    false)
                    {
                        //Get the Table
                        System.Web.UI.WebControls.Table tab =
                            (System.Web.UI.WebControls.Table)dgSidDetails.Controls[0];
                        //Change the Top Pager
                        if (dgSidDetails.PagerStyle.Position == PagerPosition.Bottom ||
                            dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
                        {
                            tab.Rows[tab.Rows.Count -
                                1].Cells[0].Attributes.Add("colspan",
                                tab.Rows[1].Cells.Count.ToString());
                        }
                        //Change the Bottom Pager
                        if (dgSidDetails.PagerStyle.Position == PagerPosition.Top ||
                            dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
                        {
                            tab.Rows[0].Cells[0].Attributes.Add("colspan",
                                tab.Rows[1].Cells.Count.ToString());
                        }
                    }
            }
            catch (Exception ex)
            {

            }
        }
Tuesday, August 11, 2009 12:29:41 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Friday, August 07, 2009
SELECT COUNT(*) AS Total FROM syscolumns WHERE (name = 'clientID')
Friday, August 07, 2009 12:34:54 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
# Thursday, August 06, 2009

'Count': Counts the number of non-null values.


'Count (*)': Counts the number of rows in the table, including null values and duplicates.

Thursday, August 06, 2009 12:33:31 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
You can create local and global temporary tables. Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions. Prefix local temporary table names with single number sign (# table_name), and prefix global temporary table names with a double number sign (##table_name).
Thursday, August 06, 2009 12:32:53 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
Copyright © 2010 SoftwareCodeHelp. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: