Private: MY Note


Solve Error : ASP.NET runtime error: Could not load file or assembly ‘AjaxControlToolkit, Version=1.0.10920.32880

Posted in .NET 2.0, ASP.NET, ASP.NET 3.0 by dev1 on the December 21, 2007

Add following XML to the eScrum web.conifg file after the </configSections> close tag.  Afterward, update the newVersion attribute to the version of the control toolkit that you are using.
<runtime>
 <assemblyBinding xmlns=”urnTongue Tiedchemas-microsoft-com:asm.v1″>
  <dependentAssembly>
   <assemblyIdentity name=”AjaxControlToolkit”
    publicKeyToken=”28f01b0e84b6d53e”
    culture=”neutral”/>
   <bindingRedirect oldVersion=”1.0.10301.0″ newVersion=”1.0.xxxxx.0″/>
  </dependentAssembly>
 </assemblyBinding>
</runtime>

 ref: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1913881&SiteID=1

Comparing two objects ( == instead of .equals)

Posted in .NET, .NET 2.0 by dev1 on the December 17, 2007

Here’s the correct way to compare two strings.

String abc = “abc”; String def = “def”;

// Bad way
if ( (abc + def) == “abcdef” )
{
    ……
}
// Good way
if ( (abc + def).equals(”abcdef”) )
{
   …..
}

VS2005 Take (Keyboard) Shortcuts

Posted in .NET 2.0, ASP.NET 3.0, Visual Studio by dev1 on the December 6, 2007

Using keyboard shortcuts is the best way to get things done faster in Visual Studio (and most other computer applications for that matter).

Below are my favorite Visual Studio keyboard shortcuts (I am leaving out the really obvious ones like F5).

  • CTRL+ALT+L: View Solution Explorer. I use Auto Hide for all of my tool windows to maximize screen real estate. Whenever I need to open the Solution Explorer, it’s just a shortcut away. Related shortcuts: CTRL+ALT+X (Toolbox), F4 (Properties), CTRL+ALT+O (Output), CTRL+\, E (Error List), CTRL+\, T (Task List).
  • F12: Go to definition of a variable, object, or function.
  • SHIFT+F12: Find all references of a function or variable.
  • F7: Toggle between Designer and Source views.
  • CTRL+PgDn: Toggle between Design and Source View in HTML editor.
  • F10: Debug - step over. Related debugging shortcuts: F5 (debug - start), F11 (debug - step into), SHIFT-F11 (debug - step out), CTRL-F10 (debug - run to cursor). F9 (toggle breakpoint).
  • CTRL+D or CTRL+/: Find combo (see section on Find Combo below).
  • CTRL+M, O: Collapse to Definitions. This is usually the first thing I do when opening up a new class.
  • CTRL+K, CTRL+C: Comment block. CTRL+K, CTRL-U (uncomment selected block).
  • CTRL+-: Go back to the previous location in the navigation history.
  • ALT+B, B: Build Solution. Related shortcuts: ALT+B, U (build selected Project), ALT+B, R (rebuild Solution).
  • CTRL+ALT+Down Arrow: Show dropdown of currently open files. Type the first few letters of the file you want to select.
  • CTRL+K, CTRL+D: Format code.
  • CTRL+L: Delete entire line.
  • CTRL+G: Go to line number. This is useful when you are looking at an exception stack trace and want to go to the offending line number.
  • SHIFT+ALT+Enter: Toggle full screen mode. This is especially useful if you have a small monitor. Since I upgraded to dual 17″ monitors, I no longer needed to use full screen mode.
  • CTRL+K, X: Insert “surrounds with” code snippet. See Snippets tip below.
  • CTRL+B, T: Toggle bookmark. Related: CTRL+B, N (next bookmark), CTRL+B, P (prev bookmark).

The complete list of default shortcuts is available from VS 2005 Documentation. You can also download/print reference posters from Microsoft: C# Keyboard Reference Poster, VB.NET Keyboard Reference Poster.

cool tutor (n-tier)

Posted in .NET 2.0, ASP.NET by dev1 on the December 1, 2007

http://www.covertcoder.com/Tutorial.aspx?TopicAreaID=AfmUsz/RcY/aN0GtV+UaCsl1p3mJCHjdzkYCC7PvVpIA

Asynchronous Callbacks and Ajax based UI Experience in Web Applications

Posted in .NET 2.0, AJAX by dev1 on the December 1, 2007

Web applications work on the underlying Http protocol and Http is stateless by nature. It uses the Request - Response pattern between the client and the server, to process the logic at the server and present the information in HTML to the client browser. In the case of long running applications, it would be helpful to the end user to see some status on the browser when the application is processing some complex logic on the server. This article shows a convenient way of showing status information in such cases. The sample demos show how to achieve this in .NET 2.0 using the CallBack infrastructure provided in the framework and also a means to achieve the same effect using the .NET 1.1 framework.

ref: http://www.c-sharpcorner.com/UploadFile/deepakvraghavan/AjaxProgressBars09082006171908PM/AjaxProgressBars.aspx

Notepad++ Cool Editor for Coding

Posted in .NET 2.0, ASP.NET by dev1 on the November 27, 2007

Sorting with DataView

Posted in .NET 2.0, ASP.NET by dev1 on the November 26, 2007

DataView dv = SapNewdt.DefaultView;

string sortExpr = ” Sent_SAP_Date ASC”;

//TableManager.HRTxnSAPSummary.SENT_SAP_DATE + ” , ” + TableManager.HRTxnSAPSummary.PROC_NAME + ” ASC”;

dv.Sort = sortExpr;

SapNewdt = dv.ToTable();

DataSet SapDs = new DataSet();SapDs.Tables.Add(SapNewdt);

return SapDs;

optimize data from calling webservice

Posted in .NET, .NET 2.0, ASP.NET by dev1 on the November 26, 2007

                DataTable HrDt = mHRTxnSAPData.ListDetail_OF_SentDocToSAP(comp_code, module, start_sap_date, end_sap_date
                                   , start_doc_date, end_doc_date, crem_type, Process_name, success, type);
                             
                foreach (DataRow dr in HrDt.Rows)
                {
                    //save to arrayList
                    strPin = dr[TableManager.WFCremation.PIN].ToString();
                    if (mList.IndexOf(strPin) == -1)
                    {
                        mList.Add(strPin);

                        if (type == “CR”)
                        {
                            strPin = dr[TableManager.WFCremation.HR_PIN].ToString();
                            if (mList.IndexOf(strPin) == -1)
                                mList.Add(strPin);
                        }
                    }

                    //save to hash(org info) –
                    strOrgInfo = dr[TableManager.WFCremation.NEAR_ORG_ID].ToString();
                    if (strOrgInfo != string.Empty)
                    {
                        if (!hashOrgInfo.ContainsKey(strOrgInfo))
                        {
                            OrgDs = mOMEHRService.GetOrgInfobyOrgCode(strOrgInfo);
                            if (OrgDs.Tables[0].Rows.Count > 0)
                                hashOrgInfo[strOrgInfo] = OrgDs.Tables[0].Rows[0][TableManager.Employee.ORG_DESC].ToString();
                        }
                    }

                }

                for (int a = 0; a < mList.Count; a++)
                {
                    if (strPin != string.Empty)
                        strPin = strPin + “,”;

                    strPin = strPin + mList[a].ToString();
                }

                //call ws for employee profile –
                dsProfile = mOMEHRService.ListEmployeeProfileByPIN(strPin);

———- calling  ——————

DataRow[] drProfile;

drProfile = dsProfile.Tables[0].Select(” PIN=’” + HrDr[TableManager.WFCremation.PIN].ToString() + “‘”);if (drProfile.Length != 0){

Pin_name = drProfile[0]["THFIRSTNAME"].ToString() + ” “ + drProfile[0]["THLASTNAME"].ToString();Position = drProfile[0][

TableManager.Employee.POSI_DESC].ToString();}

Display Hierarchical Data with TreeView in ASP.NET 2.0

Posted in .NET 2.0, ASP.NET by dev1 on the November 25, 2007

asp.net repeater

Posted in .NET 2.0, ASP.NET by dev1 on the November 21, 2007
 <asp:Repeater id=”Repeater1″ runat=”server”>    <HeaderTemplate>       <table border=”1″>          <tr bgcolor=”#ffcc99″>             <th>ID</th>             <th>First Name</th>             <th>Last Name</th>             <th>Address</th>          </tr>    </HeaderTemplate>    <ItemTemplate>       <tr bgcolor=”#ffcccc”>         <td><%# DataBinder.Eval(Container.DataItem, “au_id”) %></td>         <td><%# DataBinder.Eval(Container.DataItem, “au_fname”) %></td>         <td><%# DataBinder.Eval(Container.DataItem, “au_lname”) %></td>         <td><%# DataBinder.Eval(Container.DataItem, “address”) %></td>       </tr>    </ItemTemplate>    <AlternatingItemTemplate>       <tr bgcolor=”#ccff99″>         <td><%# DataBinder.Eval(Container.DataItem, “au_id”) %></td>         <td><%# DataBinder.Eval(Container.DataItem, “au_fname”) %></td>         <td><%# DataBinder.Eval(Container.DataItem, “au_lname”) %></td>         <td><%# DataBinder.Eval(Container.DataItem, “address”) %></td>       </tr>    </AlternatingItemTemplate>    <FooterTemplate> 	   </table>    </FooterTemplate> </asp:Repeater> 
Next Page »