Google NoteBook

Posted by Joggee | Google | Wednesday 28 May 2008 8:30 am

Once again Google shock me with new idea. You can access your favorites links anywhere in the world and they are just on one click , no more complication.

Clip information with a single click.
Quickly add clippings of web content (images, text and links) straight to your notebook by highlighting the content you want and clicking the “Clip” button in the mini Google Notebook

Google NoteBook

Take a tour
http://www.google.com/googlenotebook/tour1.html


Recall or Recover Deleted Items from MailBox, Outlook

Posted by Joggee | OutLook | Wednesday 28 May 2008 7:04 am

RECALL MESSAGES FROM MAILBOX

There are times when we send an e-mail and immediately realize that it contains an error or is missing important information. You wish you could go back in time and fix it, but it’s too late; the message has been sent. Fortunately, Outlook includes a recall feature that allows for a “do over” in the real world.

1. To recall a sent message, begin by locating the message in your sent items folder. 4. Open the e-mail message.
2. From the “Actions” dropdown list in the main menu, select “Recall This Message…”
3. Once selected, the Recall This Message dialog box will appear. It contains three options.

I. Delete unread copies of this message – This option will delete all sent copies of the message that have not been opened.
II. Delete unread copies and replace with a new message – In cases where only an error needs to be corrected, or slight information added, this option will first delete the original sent message, and then it will send a replacement message.
III. Tell me if recall succeeds or fails for each recipient – If checked, the user will receive e-mail confirmation if each individual message was successfully recalled or not.

Note: A read message cannot be recalled.

4. Press “OK” to initiate the recall.

Recall
 

RECOVER DELETED ITEMS FROM MAILBOX

How many times have we deleted an e-mail message and then wished we hadn’t or needed it later? Now it’s okay, because deleted items aren’t really gone forever; they can be recovered.

1. To recover deleted items, begin with the Deleted Items folder open.
2. With the folder open, select “Tools” from the main menu and then “Recover Deleted Items…”
3. A new dialog box will appear.
4. Use the tool buttons in the upper left to perform actions:

“Select All” – This button selects all of the deleted items in the list.

“Recover Selected Items” – To Recover Selected Items press this button.

The delete button will Purge Selected Items, meaning that they will be deleted permanently and will not be recoverable.

Recover Deleted

Hint : Use Ctrl+Left-Click to select multiple items that are not next to each other.


How To Use Medium Trust in ASP.NET 2.0

Posted by Joggee | ASP.NET Tips, ASp.NET 2005, Ajax, DataReader | Monday 26 May 2008 6:10 am

Its hard to explain why this is happening to every 2nd developer and he is complaining about medium trust level problem with hosting company.

Microsoft explain step by step but still this problem doenst resolve WHY?

These steps are enough for developer. Why they are still complaining.

SOLUTION:

DONT USE DATAREADER WHEN YOU ARE BINDING YOUR DATA WITH DATAGRID, GRIDVIEW OR ANY CONTROL.

USE DATASET

NO need to follow below steps
NO need to do settings locally for your Application for Medium Trust Level.
Once you will deployed at hosted server, it will automatically inherit as medium trust level.

Microsoft said :

Summary of Steps
To use medium trust in your ASP.NET applications:

Step 1. Configure medium trust.
Step 2. Lock the trust level.
Step 3. Optionally create a custom policy based on medium trust.
Step 1. Configure Medium Trust
To configure an application to run with medium trust, add the following element to either the application’s specific Web.config file in the application’s virtual root directory or to the machine-level Web.config file.

 Copy Code
<trust level=”Medium” originUrl=”" />
  Note   If present, the originUrl attribute can be used by some permissions, such as WebPermission, to restrict connectivity to a defined set of addresses.
To configure all Web applications on a server to run with medium trust, add this element to the machine-level Web.config file located in the following folder: %windir%\Microsoft.NET\Framework\{version}\CONFIG.

By default, Web applications are configured to run with full trust as shown in the following default configuration from the machine-level Web.config file.

 Copy Code
<location allowOverride=”true”>
 <system.web>
   <securityPolicy>
     <trustLevel name=”Full” policyFile=”internal” />
     <trustLevel name=”High” policyFile=”web_hightrust.config” />
     <trustLevel name=”Medium”
                 policyFile=”web_mediumtrust.config” />
     <trustLevel name=”Low”  policyFile=”web_lowtrust.config” />
     <trustLevel name=”Minimal”
                 policyFile=”web_minimaltrust.config” />�
   </securityPolicy>
   <trust level=”Full” originUrl=”" />
 </system.web>
</location>
  To review the full set of permissions available to medium trust applications, view the Web_mediumtrust.config file.

Step 2. Lock the Trust Level
Application service providers or anyone responsible for running multiple Web applications on the same server should apply the medium trust policy setting in the machine-level Web.config file and then lock the trust level for all Web applications.

To do this, set the allowOverride attribute to false in the machine-level Web.config file, as shown in the following code example.

 Copy Code
<location allowOverride=”false”>
 <system.web>
   <securityPolicy>
     <trustLevel name=”Full” policyFile=”internal” />
     <trustLevel name=”High” policyFile=”web_hightrust.config” />
     <trustLevel name=”Medium”
                 policyFile=”web_mediumtrust.config” />
     <trustLevel name=”Low”�
                 policyFile=”web_lowtrust.config” />
     <trustLevel name=”Minimal”
                 policyFile=”web_minimaltrust.config” />�
   </securityPolicy>
   <trust level=”Medium” originUrl=”" />
 </system.web>
</location>
  By setting allowOverride=”false”, an individual developer is unable to override the medium trust policy setting in their application’s Web.config file.

Yours comments are valuable for me

Joggee

Google’s latest ideas

Posted by Joggee | Google, Latest Hi-Tech Updates | Tuesday 20 May 2008 6:57 am

Google is always experimenting with new features aimed at improving the search experience.

I dont know what to say its a latest or copied from YAHOO. But I one good thing is, Google take this idea and make it more freindly and give statistic,Keyword suggestions,Keyboard shortcuts,Alternate views for search results. I would say GOOGLE ALWAYS A HEAD than any search engine.

for more information http://www.google.com/experimental/index.html

what you say ?

SQL Server Incremental Years Value

Posted by Joggee | SQL Server 2005, SQL Tips and Tricks | Friday 16 May 2008 10:36 am

I am unable to find something good and fast where without involving master database years value in the sql server. I found below query but I dont wanted to involve master database.

SELECT TOP 11000 –equates to more than 30 years of dates
        IDENTITY(INT,1,1) AS N
   INTO dbo.Tally
   FROM Master.dbo.SysColumns sc1,
        Master.dbo.SysColumns sc2

Here is something i made simple and fast.

DECLARE @TILL INT — define your end year value I am taking till 2008 + 2 = 2010

SET @TILL = YEAR(GETDATE())+2

DECLARE @FIRSTVALUE INT

SET @FIRSTVALUE=2001 – declaring first value

CREATE TABLE #TEMP
(
YEARID INT
)

WHILE  @FIRSTVALUE<=@TILL
BEGIN
INSERT INTO #TEMP SELECT @FIRSTVALUE
SET @FIRSTVALUE=@FIRSTVALUE+1
END

SELECT * FROM #TEMP

DROP TABLE #TEMP

RESULT:

Year

 kick it on DotNetKicks.com

ASP.NET Accordion control with SQL Server Connectivity

Posted by Joggee | ASp.NET 2005, Ajax, Database Programming | Wednesday 14 May 2008 9:33 am

The Accordion is a web control that allows you to provide multiple panes and display them one at a time. It is like having several CollapsiblePanels where only one can be expanded at a time.

How to populate data from the SQL SERVER database and integrate with Accordion Control

 

I tried from the internet but hardly found something good which is so friendly.


I decided to make a code for this.
 

First create tables in the database 


CREATE
TABLE [dbo].[Category](

      [CategoryId] [int] IDENTITY(1,1) NOT NULL,

      [CatName] [nvarchar](50) NULL,

      [CatDesc] [nvarchar](255) NULL

)

 

CREATE TABLE [dbo].[SubCategory](

      [SubCategoryID] [int] IDENTITY(1,1) NOT NULL,

      [CategoryID] [int] NOT NULL,

      [SubCategoryName] [varchar](30) NULL

)

Inserting values for Main Category Table

 

Insert Into Category (CatName,CatDesc) Values (‘Hospital’,‘Hospital’)

Go

Insert Into Category (CatName,CatDesc) Values (‘School’,‘School’)

Go

Insert Into Category (CatName,CatDesc) Values (‘Hotel’,‘Hotel’)

 

Select * from Category

 

Result: 

 Category

 

Some values for Sub Category Table

 

Insert Into SubCategory (CategoryID,SubCategoryName) Values (1,‘Hospital 1′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (1,‘Hospital 2′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (1,‘Hospital 3′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (2,‘School 1′)

Go

Insert Into SubCategory (CategoryID,SubCategoryName) Values (2,‘School 2′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 1′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 2′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 3′)

Go
Insert Into SubCategory (CategoryID,SubCategoryName) Values (3,‘Hotel 4′)

Go

Select * from SubCategory

 

Result:

Sub Cateogry

 

Now we have two tables, let’s create a stored procedure.

 

CREATE PROCEDURE [dbo].[PROC_CATEGORY_GETALL]    

AS      

BEGIN 

 SELECT      

     DISTINCT CATEGORY.CATEGORYID,

     ISNULL(CATEGORY.CATNAME,) AS CATNAME     

 FROM

    CATEGORY

      

 SELECT      

      CATEGORY.CATEGORYID,
     
ISNULL(CATEGORY.CATNAME,) AS CATNAME,     

      ISNULL(SUBCATEGORY.SUBCATEGORYNAME,) AS SUBNAME

 FROM

      CATEGORY INNER JOIN SUBCATEGORY

      ON CATEGORY.CategoryID=SubCategory.CategoryID     

 ORDER BY CATEGORY.CATNAME ASC     

END 

 

GO

 

In the above stored procedure I am returning two tables, Main and Sub Category both, So I don’t need to go and touch database for each Category.

I don’t want for each Category it will go back and forth toward server.

 

Create any Webpage in your AJAX Enabled web application

 

In a Webpage ASPX write below code

 

<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”98%”>

  <tr>

      <td>

       <cc1:Accordion ID=”MyAccordion” runat=”Server” SelectedIndex=”0″ HeaderCssClass=”accordionHeader”HeaderSelectedCssClass=”accordionHeaderSelected” ContentCssClass=”accordionContent”AutoSize=”None” FadeTransitions=”true” TransitionDuration=”250″ FramesPerSecond=”40″ 

RequireOpenedPane=”false” SuppressHeaderPostbacks=”true”>

            </cc1:Accordion>

          </td>

        </tr>

 </table>

 

Now CODE Behind.


Private
Sub PopulateGrid()


   Dim sqlConn As New SqlConnection

   Dim sqlCmd As New SqlCommand(“PROC_CATEGORY_GETALL”, sqlConn)

 

   Dim DA As New SqlDataAdapter

   Dim ds As New DataSet

 

   Dim intRow As Integer

   Dim intRowPenal As Integer

 

   Dim acpPane As AjaxControlToolkit.AccordionPane

   Dim lblHeader As Label

 

   sqlConn = “Opened Connection”e.g.”openConnection()returns me a connection object”

   sqlCmd.Connection = sqlConn

   sqlCmd.CommandType = CommandType.StoredProcedure

   DA.SelectCommand = sqlCmd

   DA.Fill(ds)


  For intRow = 0 To ds.Tables(0).Rows.Count – 1

       lblHeader = New Label

       lblHeader.Text = ds.Tables(0).Rows(intRow)(“CatName”)

 

       acpPane = New AjaxControlToolkit.AccordionPane

       acpPane.HeaderContainer.Controls.Add(lblHeader)


      
Dim dv As DataView = ds.Tables(1).DefaultView
      
dv.RowFilter = “CATEGORYID=’” + ds.Tables(0).Rows(intRow)(“CATEGORYID”).ToString + “‘”

       Dim lblContent As New Label

       For intRowPenal = 0 To dv.Count – 1

            lblContent.Text = lblContent.Text & “<div style=’padding-top: 5px; padding-left: 10px;’><a href=’” & ResolveUrl(dv.Item(intRowPenal)(“SUBCATEGORYNAME”)) & “‘>” + dv.Item(intRowPenal)(“SUBNAME”) + “</a>” & “</div>”

      Next

      acpPane.ContentContainer.Controls.Add(lblContent)

      MyAccordion.Panes.Add(acpPane)

    Next

 

    DA.Dispose()

    DA = Nothing

    sqlCmd.Dispose()

    sqlCmd.Connection.Close()

    sqlCmd = Nothing

    sqlConn.Close()

    sqlConn = Nothing


  End Sub

 

Note : Change Sub Category Hyperlink as per your wish.

Leave your message if it solve your problem.

Joggee

kick it on DotNetKicks.com

Microsoft Tech·Ed North America 2008 Developers: Conference Registration

Posted by Joggee | Conference, Conferences | Thursday 8 May 2008 8:40 am

Guys, Microsoft helping once again and give more exposure to the developers Below is something is which is going to happen shortly.

June 3-6, 2008

Don’t miss your opportunity to attend the Bill Gates keynote. Register now to learn about Gates’ vision for the future of the IT industry.

Last chance discount: Save $200.
Register by Friday, May 2, 2008, to receive the discounted rate of just US$1,795—that’s US$200 off the regular rate of US$1,995!

Attendee registration
In addition to registering for the conference, you must make hotel reservations during the registration process in order to receive special discounted conference room rates from select hotels. View the list of conference hotels for room rates, and check out the hotel location map.

for more detail visit here: http://www.microsoft.com/events/teched2008/developer/registration/regprocess.mspx

ResolveURL Method Part 2

Posted by Joggee | ASP.NET Tips | Wednesday 7 May 2008 1:56 pm

How to access ResolveURL Method at code behind or any independent class. for example
CommonFunction.vb

Include Namespace “Imports System.Web”

Where you wanted to call this funcation in your code.

Dim instance As New Control
Dim returnValue As String
returnValue = instance.ResolveUrl(“~/Joggee/Default.aspx“)
 

 

“<a href=”  & returnValue & “ title=”Joggee”>” & Joggee & “</a>”

SQL SERVER (T-SQL)- PATINDEX

Posted by Joggee | SQL Server 2005, SQL Tips and Tricks | Tuesday 6 May 2008 12:48 pm

In Sql Server PatIndex is really useful method works like SPLIT funcation in .net, It returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.

Sometimes you received data in a concated form and you need to seperated on the fly.
I will not go in more detail, here is the example will compelety describe how important PatIndex is.

Create table #temp
(
ZipCode Varchar(255),
Region Varchar(255))

Insert into #Temp values(’00000-00399′,’9′)
Insert into #Temp values(’00400-00599′,’8′)
Insert into #Temp values(’00600-00999′,’1′)

Select  * from #Temp
Select  Left(ZipCode,patindex(‘%-%’,ZipCode)-1) as ZipCodeFrom ,
   Right(ZipCode,patindex(‘%-%’,ZipCode)-1) as ZipCodeTo,
   Region
From
     #Temp 

 PatIndex

Visual Studio 2005 , Web Project Deployment, Website DLL

Posted by Joggee | ASP.NET Tips, ASp.NET 2005, Visual Studio ASP.NET | Saturday 3 May 2008 12:13 pm

In Visual Studio 2005, they make it so simple to deploy a web site at hosting or any server.
In Visuaa Studio 2003, You need to create your different project and then take .DLL and .ASPX files CSS except code behind files. Look tiring work.
Microsoft work wonderful and make a executable file and in few steps you can deploy your website.

Here is the link to download
http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx

1.Download it and Install.
2.Open your visual studio if it is open already just restart it.
3.Right click on your web project solution.
4.Choose “Add Web Development Project”
5.Specify name and location for your web project.
6.It will be automatically added to your project.
7.Right click on it and choose property pages and do your required configuration if required otherwise default also work.
8.Choose Release from debug mode.
9.Right click on the webproject again and Build.
10.You are done. Your project is done and ready to deply. It will automatically add .aspx, css and all required files and folder for the project EXCEPT CODE “BEHIND SOURCE CODE”.