Friday, December 15, 2006

Mantis : Free Web-Based BugTracking System

Mantis is a free popular web-based bugtracking system (feature list). It is written in the PHP scripting language and works with MySQL, MS SQL, and PostgreSQL databases and a webserver. Mantis has been installed on Windows, Linux, Mac OS, OS/2, and others. Almost any web browser should be able to function as a client. It is released under the terms of the GNU General Public License (GPL).

http://www.mantisbugtracker.com/

Tuesday, December 12, 2006

Messenger

While browsing i come across a very good messenger log listner, this would be of interest to many of programmers who want to implement their own messenger.

Check it out for more.
http://www.codeproject.com/csharp/MsnMessengerLogListener.asp

Sunday, December 10, 2006

DataBinder.Eval() Method

DataBinder.Eval() Method

DataBinder.Eval() method saves you from writing complex expressions.

For example, make your datagrid column to template field.

Now, lets understand it various use with different example.


Example1: Concat two datagrid column into one.

In .ASPX File
asp:TemplateColumn HeaderText="Address"
ItemTemplate
asp:Label id="Label1" runat="server" Text='%#

ConcatColumns(DataBinder.Eval(Container.DataItem,"City"),DataBinder.Eval(Container.DataItem,

"Country")) %'lblAddress/asp:Label
/ItemTemplate
/asp:TemplateColumn

In .CS File
public static string ConcatColumns(object objText1, object objText2)
{
return objText1.ToString() + " " + objText2.ToString();
}



Example2: Opening a default Email Program on clicking datagrid column.

In .ASPX File
asp:TemplateColumn HeaderText="ContactName"
ItemTemplate
asp:Label id="Label2" runat="server" Text='%#

GetEmailLink(DataBinder.Eval(Container.DataItem,"ContactName"),DataBinder.Eval(Container.Dat

aItem,"Email")) %'lblCompanyName/asp:Label
/ItemTemplate
/asp:TemplateColumn

In .CS File
public static string GetEmailLink(object DisplayText,object EmailAddress)
{
return "a href='mailto:" + EmailAddress.ToString() + "'" + DisplayText.ToString() +

"/a";
}





Example3: Opening a Pop-up Link on clicking datagrid column.

In .ASPX File
asp:TemplateColumn HeaderText="Contact"
ItemTemplate
asp:Label id="Label2" runat="server" Text='%#

OpenPopupLink(DataBinder.Eval(Container.DataItem,"ContactName"),DataBinder.Eval(Container.Da

taItem,"CustomerId")) %'lblContactName/asp:Label
/ItemTemplate
/asp:TemplateColumn

In .CS File
public static string OpenPopupLink(object displayText,object displayId)
{
return "a href='http:Webform2.aspx?NameField=" + displayId.ToString() + "'" +

displayText.ToString() + "/a";
}





Example4: Displaying no. of characters to be displayed for a particular datagrid column.
Here displaying 5 characters.

In .ASPX File
asp:TemplateColumn HeaderText="Address"
ItemTemplate
asp:Label id="Label1" runat="server" Text='%#

GetFormatedText(ConcatColumns(DataBinder.Eval(Container.DataItem,"City"),DataBinder.Eval(Con

tainer.DataItem,"Country")),5) %'lblCompanyName/asp:Label
/ItemTemplate
/asp:TemplateColumn

In .CS File
public static string GetFormatedText(object objText, object objChars)
{
if (objText.ToString().Length int.Parse(objChars.ToString()))
return objText.ToString().Substring(0, int.Parse(objChars.ToString()));
else
return objText.ToString();
}



Example5: Displaying Calculation, Calculating UnitPrice into Quantity and displaying Total

In .ASPX File
asp:TemplateField HeaderText="Total"
EditItemTemplate
asp:TextBox ID="TextBox1" runat="server"/asp:TextBox
/EditItemTemplate
ItemTemplate
asp:Label ID="Label1" runat="server" Text='%#

CalculateTotal(DataBinder.Eval(Container.DataItem,"UnitPrice"),DataBinder.Eval(Container.Dat

aItem,"Quantity")) %'/asp:Label
/ItemTemplate
/asp:TemplateField

In .CS File
public static string CalculateTotal(object UnitPrice, object Quantity)
{
double Total = double.Parse(UnitPrice.ToString()) * long.Parse(Quantity.ToString());
return Total.ToString();
}





Example6: Applying conditional formatting to datagrid cell, assigning different colors to cell depends on its InputValue.

In .ASPX File
asp:TemplateField HeaderText="Total"
EditItemTemplate
asp:TextBox ID="TextBox1" runat="server"/asp:TextBox
/EditItemTemplate
ItemTemplate
asp:Label ID="Label1" runat="server" Text='%#

CalculateTotal(DataBinder.Eval(Container.DataItem,"UnitPrice"),DataBinder.Eval(Container.Dat

aItem,"Quantity")) %' ForeColor='%#

ConditionalFormating(CalculateTotal(DataBinder.Eval(Container.DataItem,"UnitPrice"),DataBind

er.Eval(Container.DataItem,"Quantity"))) %'/asp:Label
/ItemTemplate
/asp:TemplateField

In .CS File
public static Color ConditionalFormating(object Amount)
{
double dAmount = double.Parse(Amount.ToString());
if (dAmount 1000)
{
return Color.Red;
}
else if (dAmount 500)
{
return Color.Blue;
}
else
{
return Color.Green;
}
}



However, using this method does impose a performance penalty on your code because all the work it does is late-bound.

Tuesday, December 05, 2006

The Advantages of Microsoft AJAX

From Joe's Blog

One of the PUMs (Product Unit Manager) in my team, Shanku Niyogi, is an AJAX guru and recently wrote this internally to describe the advantages of Microsoft AJAX.

I thought it was a great write up and I’m reprinting it here with his permission.

There are a wide variety of good AJAX libraries available for ASP.NET today. This shows the demand for AJAX capabilities for the ASP.NET platform.

With ASP.NET AJAX, Microsoft is delivering a high-quality AJAX framework that will be fully integrated into ASP.NET and Visual Studio. We believe that delivering integrated support for AJAX in our platform will have several benefits for ASP.NET developers:

- ASP.NET AJAX will be a completely free release, and will be integrated into the free .NET Framework release in future versions.

- The release version of ASP.NET AJAX, due out around the end of the year, will be fully supported through Microsoft Product Support for the standard (7+3) period. This means that if you have any issues with this product in development or deployment, you can call up Microsoft to get help at anytime. It also means that we will issue hotfixes and service packs.

- ASP.NET AJAX includes integrated authoring support in Visual Studio 2005, and will include even better support in the next version of Visual Studio.

ASP.NET AJAX is also more than just a basic library for incremental rendering. ASP.NET AJAX also provides a rich end-to-end AJAX library that includes a full networking and web services stack, a component model with support for rich interactive behaviors, support for localization and globalization, and other capabilities required for rich web client programming. The client script library for ASP.NET AJAX is available in full source form (debug and release versions), and can be freely modified.

On top of the core package, you can use the ASP.NET AJAX Control Toolkit, which adds a rich library of controls for AJAX development. The Control Toolkit is free and available with a source license that allows full modification and redistribution.

From a pure performance perspective, there are several issues with the assessment that are either inaccurate or that we have improved in the Beta.

1. As Bertrand has mentioned in this comments, doing a pure measurement of script size on a small sample is misleading. The scripts are loaded only once, and then cached on the client. This means that over any real world web site, the cost of downloading the scripts are amortized over the entire site.

2. As Christophe mentioned, the Atlas tests Daniel ran were on the debug version of scripts. In CTP versions of Atlas, this was the default. In the ASP.NET AJAX Beta, scripts are release mode (smaller) and compressed by default. The compressed results are around 14K, which is around the size of an image on the page.

3. We have also done some significant work in reducing packet size for UpdatePanel. In the attached version of the project (which implements the same sample in Daniel’s blog), the packet size of the update is 485 bytes. The UpdatePanel architecture includes features like triggers and conditional updates that allow you to finely customize the update characteristics of your page.

4. ASP.NET AJAX also includes a very rich client-side framework, so that you can build client-centric applications. This goes well beyond basic direct AJAX, with access to server-based web services, a rich client component model, support for localization, and many other features. The client-centric framework requires an approximately 9K subset of the ASP.NET AJAX scripts. A version of the sample written with client-centric techniques (also in the attached project) uses a packet size of approximately 20-30 bytes (depending on the length of the date string).

Some other points in the study that are inaccurate or outdated:

1. In terms of browser support, ASP.NET AJAX supports IE, Firefox/Mozilla, and Safari today, and will support Opera by release. It will also support the next version of IE Mobile.

2. In addition to ASP.NET, ASP.NET AJAX supports other servers such as PHP – so if you have a mixed deployment, you can take advantage of ASP.NET AJAX with these servers as well.

3. The ASP.NET UpdatePanel can automatically detect downlevel browsers that are not AJAX capable, and turns off incremental rendering for the page. This allows you to easily build AJAX-enabled pages that still work on non-AJAX browsers.

Microsoft Expression


Expression Web helps Web developers build sites in compliance with various industry standards, including XHTML and CSS, and for compatibility with specific browsers. Integration with Microsoft's Visual Studio 2005 and ASP.Net 2.0 enable Microsoft-centric development shops to incorporate more advanced functionality.

Monday, December 04, 2006

Monthly Winner @ DotNetSpider.com

Won a Monthly Rap Tier Software @ DotNetSpider.com

Check out my profile @ DotNetSpider.com
http://www.dotnetspider.com/profiles/ViewProfile.aspx?userId=CodeGuruDotNet

Friday, December 01, 2006

Won a 4th Prize Prize @ Community-Credit

Hello Friends,

Again Won a Prize @ Community-Credit

check out url and select "November 2006" from drop-down

I have won 4th Prize : iFish

Sunday, November 26, 2006

.Net Layered Design (Automated) with LLBL Gen. Pro.

Exploring LLBL Gen. Pro.

Want to know what is LLBL Gen. Pro. ??? than click here.

Using LLBL Gen. Pro. tool is divided into Three parts
Part 1: Discuss All about Generating Files from LLBL Tool.
Part 2: Execute StoredProcedure in Database.
Part 3: Discussion about using files generated from LLBL Tool.

Part1
Step1: Enter DB Server., user-id and password.


Step2: Select Table.


Step3: Select Language option and namespace. Select DBNull value support and property option rather than web.config file option.


Step4: Select the field names


Step5: Start Generation : It will generate three files clsCustomer.cs, clsDBInteractionBase.cs and Northwind_LLBL_StoredProcedures.txt

clsCustomer.cs - It consist of functions for SelectOne, SelectAll, Update, Delete, Insert, Update.

clsDBInteractionBase.cs - It is a abstract class which needs to be included once for all the tables, it consist of functions such as BeginTransaction, CommitTransaction, RollbackTransaction, and so on which are require for DBInteraction.

Northwind_LLBL_StoredProcedures.txt - It consist of stored procedure to be executed on database.


Part2
Step1: Open QueryAnalyzer, and select the database. (here choose Northwind).

Step2: Copy all the content from "Northwind_LLBL_StoredProcedures" file and execute it in query analyser.


Part3
Step1: Create New Web Project (you can use it with window project, but for this example i am going to explain with Web Project).

Step2: Add New Class Library project. (you can make individual class library project outside main project and add its .dll file as reference)




Step3: Add Files to Class Library Project.
Files to be add as existing items are:
- clsCustomer.cs and
- clsDBInteractionBase.cs (Note: clsDBInteractionBase class needs to be added only 1 time for N no. of classes (associated with tables))

After Files are added.


Step4: Make changes in clsDBInteractionBase.cs file.
In InitClass() method, change m_ScoMainConnection.ConnectionString = ConfigurationSettings.AppSettings["connStr"].ToString();
where "connStr" is a key for connection string define in web.config file.
This change will help you to use connection string from web.config file.

Also, if required, In clsCustomer.cs file replace Int32 with SqlInt32.

Step5: Add the reference of class project within your web project to use its functionality. Right click on web project and click on add reference and add choose project tab., add the Northwind Class.

Step6: For testing the functionality take a datagrid on form.

Step7: Switch to Code view and add namespace of generated file.
eg: using NorthwindLLBL;

Step8: Add code to display all the data of customer in datagrid.
eg:
if(!Page.IsPostBack)
{
clsCustomers objCust = new clsCustomers();
DataGrid1.DataSource = objCust.SelectAll();
DataGrid1.DataBind();
}

That it, you are done with it, so now Depend on your need you can perform different operations as everything is ready for your use.

Friday, November 24, 2006

.Net Layered Design (Manually)

.Net Layered design

ADO.net Programming article which focus on both how to write efficient code and how to represent the information which take advantage of layered design of .net framework. Articles describes how you can write code efficiently and improve performance of application and avoids errors due to poor coding style.



Target Audience

Programmers having basic ADO.net Knowledge and who are interested to write efficient industry based ADO.net programming.

Advantage / Why use of Layered Design???
This article focus on how to efficiently write database programming so that we can take following advantage and prepared a layered code which is followed by industry standards.

i) Opening of connection for a short time and Closing it as soon as database task is completed, it thus help in improving performance of application.

ii) Better usage of Error-Handling, to make sure that connection is closed even if the exception occurs.

iii) Follow Stateless design, taking all needed information as parameter and return all the data through return value. It helps in load balancing and it would be easy while implementing web-service.

iv) Storing connection string in app.config file allow us to made a single change, to change a connection string. It helps in connection pooling.


Preparing Code

Now, that you ready to learn how to write ADO.net Programming efficiently lets execute the preliminary steps to make code ready for your demo.

Open DemoCode Application
Change Server Name in "app.Config" File if your database is located on Remote Server. Also modifies connection string if it requires user id and password.

Open and Login to MS SQL SERVER, open query analyzer and execute following stored procedure

Select "NORTHWIND" Database

1) Adding Employee Record
create proc procInsertEmployee
@EmployeeId int OUTPUT,
@FirstName varchar(20),
@LastName varchar(20)
as
Insert into employees
(FirstName,LastName)
values
(@FirstName,@LastName)
set @EmployeeId = @@Identity

2) Updating Emplyee Record
create proc procUpdateEmployee
@EmployeeId int,
@FirstName varchar(20),
@LastName varchar(20)
as
Update Employees
set
FirstName = @FirstName,
LastName = @LastName
where EmployeeId = @EmployeeId

3) Delete Employee Record
create proc procDeleteEmployee
@EmployeeId int
as
Delete from Employees
where EmployeeId = @EmployeeId

4) Get Specific Employee
create proc procGetEmployeeRec
@EmployeeId int
as
select EmployeeId,FirstName,LastName
from employees
where EmployeeId = @EmployeeId

5) Get All Employees
Create proc procGetAllEmployee
as
select EmployeeId,FirstName,LastName
from employees

How it works!!!
ADO.net Programming Style consist of Layered design which describes as bellow:

1. User Interface Layer

User Interface consist of Forms which are been designed to interact with User.

Screen Shot


2. Stub for Accessing Database Layer

Stub for accessing database layer is been prepared by creating classes which contains a specific details related to access data and task such as adding, editing and deleting functionality..

Note: Connection string is retrieved from section of the app.config file, rather than hard-coded. This is beneficial for connection pooling, which ultimately improves performance of application.



Stub consist of two class files:

1) A data details class and

2) A database utility class.

1) Data Details Class: It consist of details of record which is manipulated.

public class EmpDetails
{
/* Declaring Property for each field. */
private int employeeId;
public int EmployeeId
{
get{return employeeId;}
set{employeeId = value;}
}

private string firstName;
public string FirstName
{
get{return firstName;}
set{firstName = value;}
}

private string lastName;
public string LastName
{
get{return lastName;}
set{lastName = value;}
}

/* Constructor definition */
public EmpDetails(int employeeId,
string firstName,string lastName)
{
this.employeeId = employeeId;
this.firstName = firstName;
this.lastName = lastName;
}
}


2) Database Utility Class: It consist of different data manipulation operation (such as add, delete, update, select) which is performed to the actual database.

public class EmpDB

{

string connStr;

/* Retrieving Connection String in Constructor*/
public EmpDB()
{

connStr = ConfigurationSettings.AppSettings["connStr"];

}



/* Insertion of employee details*/
public int InsertEmployee(EmpDetails emp)
{



// Opening Connection
SqlConnection conn = new SqlConnection(connStr);

// Creating Command

SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;

cmd.CommandText = "procInsertEmployee";



// Adding required parameter
cmd.Parameters.Add(new SqlParameter("@EmployeeId",SqlDbType.Int));
cmd.Parameters["@EmployeeId"].Direction = ParameterDirection.Output;

cmd.Parameters.Add(new SqlParameter("@FirstName",SqlDbType.NVarChar,20));

cmd.Parameters["@FirstName"].Value = emp.FirstName;

cmd.Parameters.Add(new SqlParameter("@LastName",SqlDbType.NVarChar,20));

cmd.Parameters["@LastName"].Value = emp.LastName;

try

{

conn.Open();


// Executing Command and retrieving result.

int RecordsAffected = cmd.ExecuteNonQuery();
int EmpId;

if(RecordsAffected != 0)

EmpId = (int)cmd.Parameters["@EmployeeId"].Value;

else

EmpId = -1;

return EmpId;

}

catch(SqlException ex)

{

throw new ApplicationException("Data Error");

}

finally

{

// Ensuring that Connection is closed even if exception occurs.
conn.Close();
}

}


// Similarly Perform different database opperation
// Check out "EmpDB.cs" for demo code.
public int UpdateEmployee(EmpDetails emp)
{...}

public int DeleteEmployee(int EmployeeId)

{...}

public EmpDetails GetEmployee(int EmployeeId)

{...}

public EmpDetails[] GetAllEmployee()

{...}

}

3. Database Layer
Database layer is server where MS SQL Server is installed, or where the database is actually stored. This code design is independent of database layer.

Conclusion
Thus by end of this article, you have understand how to write efficient code and how to represent the information which take advantage of layered design of .net framework. You must also now aware about how you can write code efficiently and improve performance of application and avoids errors due to poor coding style.

Hope to hear your useful comments so that together we can make programming easy and efficient.

Wednesday, November 22, 2006

null and its related problem

null and its related problem
I have recieved many queries stating that my ViewState is null than to (ViewState["Test"] != null) doesn't satisfies, what could be the problem why i am recieving such a abnormal output.

Identifying the cause of problem and its resolution

Case 1: When assigning unassigned value to ViewState or Session.
Example:
int iFlag;

ViewState["Test"] = iFlag;

if (ViewState["Test"] != null)
{
Response.Write("I am In");
}
else
{
Response.Write("I am Out");
}
Thanks to the compiler that it identifies such errors at compile time and so it wouldn't be headache for yours.

//Output of above code.
Error : Use of unassigned local variable 'iFlag'


Case 2: When assigning unassigned value of class variable to ViewState or Session.
Example:
ViewState["Test"] = clsGlobal.iFlag; //Definition in clsGlobal: public static int iFlag;

if (ViewState["Test"] != null)
{
Response.Write("I am In");
}
else
{
Response.Write("I am Out");
}

//Output of above code.
I am In
Note: whenever you are assigning integer value to ViewState or Session, unassigned int value is not equals to null and so the output.

Same code with unassigned string variable of class would have work perfectly as per your desire as unassigned string variable is null.
Example:
ViewState["Test"] = clsGlobal.striFlag; //Definition in clsGlobal: public static string striFlag;

if (ViewState["Test"] != null)
{
Response.Write("I am In");
}
else
{
Response.Write("I am Out");
}
//Output of above code.
I am Out

So the moral of disscusion is to avoid such errors it is better to take precaution before assigning integer value to ViewState or Session.
Example:
if(clsGlobal.iFlag != 0)
ViewState["Test"] = clsGlobal.iFlag;

if (ViewState["Test"] != null)
{
Response.Write("I am In");
}
else
{
Response.Write("I am Out");
}
This code will work perfectly
//Output of above code.
I am Out

Saturday, November 18, 2006

Understanding Globalization and Localization Concept

Understanding Globalization: Globalization is process of identifying all the localizable resources in the application, that will support multiple cultures. Ideally it is perform during design phase of an application, so that the resources always remains separate from the code.

Understanding Localization: In Localization you customize the application for new locales. This consist of translating resources that you identified during the globalization phase.

Difference between Localization and Globalization: Globalization is process of identifying how many resources needs to be localized to adopt a multiple culture support, while Localization is actual process of translating resource to a specific culture.

Understanding concept with Example
Step1: Create a Web Project.

Step2: Design your form.
For this example : Take 4 label controls, 4 textbox controls and 1 drop-down list control.
Place the control on form as shown in figure.


Step3: Identifying Resources that needs to be localized (Globalization Phase).
We want the output as shown in figure:

So here Resource that needs localization are

Language Name Label
Long Date Label
currency Label
Amount Label


Now, Applying Localization to resources which needs to be localized and globalization phase. (Localization Phase begin).

Step5: Creating Resource File.
For this example i am creating resource file for French and German culture and other culture would get value from default resource file. Right click the Project in Solution Explorer and add a folder and name it. here i have named it to "MyLocalResources" you can name accordingly.

Now, Right click the Project in Solution Explorer and add a Resource File and add the content as shown in figure.

Creating Default Resource File "MyRes.resx"
(content of this resource file would be applied to resource in case resource content for language selected by user is not available.)


Creating French Resource File


Creating German Resource File


Step6: Adding code in .CS file to make it work

Adding Namespace
using System.Globalization;
using System.Threading;
using System.Resources;
using System.Reflection;

Filling Dropdown with set of languages for user-choice.
Code in Page Load Event.

if(!Page.IsPostBack)
{
//CultureInfo Class GetCultures gives collection of language.
foreach(CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
//Filling the language collection into drop-downlistbox for user choice.
ddlLanguage.Items.Add(new ListItem(ci.EnglishName,ci.Name));
}
//Calling the Event when page loads for the first time.
ddlLanguage_SelectedIndexChanged(sender,e);
}

Assigning selected language value to current thread, to reflect changes.
private void ddlLanguage_SelectedIndexChanged(object sender, System.EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(ddlLanguage.SelectedValue);
Thread.CurrentThread.CurrentCulture = new CultureInfo(ddlLanguage.SelectedValue);

//Applying Localization
ApplyLocalization();
ApplyUILocalization();
}

Code which requires localization value.
private void ApplyUILocalization()
{
ResourceManager rm = new ResourceManager("LocalizationPrac6.MyLocalResources.myRes",Assembly.GetExecutingAssembly(),null);
if(rm != null)
{
lblLanguageName.Text = rm.GetString("webform1.lblLanguageName");
lblLongDate.Text = rm.GetString("webform1.lblLongDate");
lblCurrency.Text = rm.GetString("webform1.lblCurrency");
lblAmount.Text = rm.GetString("webform1.lblAmount");
}
}

Code which does not requires localization.
private void ApplyLocalization()
{
//Lets Assume currency and amount to keep example simple.
double dblCurrency = 500.50;
double dblAmount = 9580000.75;

//No extra effort for localization as you see here.
txtLangName.Text = ddlLanguage.SelectedItem.Text;
txtLongDate.Text = DateTime.Now.ToLongDateString();
txtCurrency.Text = dblCurrency.ToString("c");
txtAmount.Text = dblAmount.ToString("n");
}


Now, run the application and select the different culture and based on selection you will get the localized display as shown in figure:

When associated resource file not available culture from Default Resource File would be shown.



Selecting French Culture

Selecting German Culture

Wednesday, November 15, 2006

Pirated Versions Of Vista Won't Last Long

Microsoft on Wednesday said that pirated copies of Windows Vista "will be of limited value" because the operating system's integrated anti-counterfeit technology would disable the fakes in short order.

The Redmond, Wash. developer's response was an answer to earlier reports that final code of both Windows Vista and Office 2007 had been posted to BitTorrent download sites, peer-to-peer networks, and Usenet groups. On some message forums, pirates gloated that they could side-step Vista's product activation process with "cracked" keys.

"The copies of Vista available for download are not final code and users should avoid unauthorized copies which could be incomplete or tampered," a Microsoft spokesperson said.

"These unauthorized downloads rely on the use of pre-RTM [released to manufacturing] activation keys that will be blocked using Microsoft's Software Protection Platform. Consequently, these downloads will be of limited value," the spokesperson added.

The new authentication scheme for Vista -- which Microsoft dubs "Software Protection Platform" -- is supposed to render the operating system inoperative if it suspects a product key is bogus. Copies of the OS whose product keys have been blocked eventually drop into a barely-usable state where only the Internet Explorer browser works, and then only for an hour before its user is automatically logged off. Office 2007, meanwhile, will use a less robust anti-piracy scheme based on Windows XP's already-deployed Windows Genuine Advantage technology.

Windows Vista and Office 2007 are scheduled to launch to businesses at the end of November, and will land in retail on Jan. 30 2007.

Read More...

Tuesday, November 14, 2006

Microsoft released .NET 3.0

Microsoft released the .NET Framework 3.0, which contains the final release of the Windows Presentation Foundation. The main code base has remained the same at its core .NET 3.0 is the same framework as .NET 2.0. The addition of new features such Windows Communication Foundation (WCF), Windows Presentations Foundation (WPF), Windows Workflow Foundation (WWF), and Windows Cardspace caused the version update.A list of available download is stored on the .NET Framework blog.

Sunday, November 12, 2006

Response.Redirect(url,true) Vs Response.Redirect(url,false)

To avoid ThreadAbortException while Redirect

You don't need to put the redirect in a try-catch block. Just replace all calls to Response.Redirect(url) with the following two lines:

Response.Redirect(url, false);

That will avoid the exception being thrown and gracefully end execution of the thread and event chain. See http://www.c6software.com/CodeSolutions/dotnet/ThreadAbortException.aspx for a full solution explanation.

Thursday, November 09, 2006

BlogStars Contest Winner

Its a good news from microsoft team that they found my blog among 20 top bloggers list.




Check out the URL for more details : http://www.microsoft.com/india/blogstars/winners.aspx

Monday, November 06, 2006

Error: Cannot interpret token

Cannot interpret token '!'

This error will occur when you try to pass an Invalid Token specifier.
eg:drCheck = dsSaveTemplate.Tables[0].Select("isExists = 'true' and template_code != '6'");

You will recieve error similar to this...Cannot interpret token '!' at position 37.

Solution
Make use of proper token specifier in search field.
eg: != is replaced with <>drCheck = dsSaveTemplate.Tables[0].Select("isExists = 'true' and template_code <> '6'");

So whenever this error occurs try to find out help on available valid token specifier for a given argument.

Microsoft Zune

iPod Owners Willing To Switch To Microsoft Zune

Many prospective buyers of digital music players, including those who currently use Apple's iPod, would be likely to choose Microsoft's upcoming Zune player, a market research firm said Wednesday.

A survey of 1,725 U.S. teenagers and adults found that of those who planned to buy a digital music player in the next 12 months, 58% who owned iPods and 59% who owned some other brand were either "somewhat likely" or "extremely likely" to choose a Zune, ABI Research said.

Read More...

Saturday, November 04, 2006

Gmail for Mobile webpage

Users can download the free application directly to their mobile device from the Gmail for Mobile webpage. The software requires users to provide their own wireless data connection.

Users can currently access Gmail messages through mobile browsers or built-in email clients, but the new Gmail for Mobile claims to offer a better user experience.

Thursday, November 02, 2006

Microsoft .NET Micro Framework


The Microsoft .NET Micro Framework brings a full-featured managed code environment to smaller, less expensive, and more resource-constrained devices than could previously be served by such cutting-edge technology. Using only a few hundred kilobytes of RAM and an inexpensive processor, the Microsoft .NET Micro Framework platform gives you the means to build applications by using the same unsurpassed development tools and advanced languages that you use to build desktop applications. Currently, this framework supplies the software platform for all Smart Watches for MSN® Direct. There are also plans to include it in Windows Vista™ SideShow displays and in an upcoming version of Microsoft TV Foundation Edition.

The .NET Micro Framework grew out of the Smart Personal Objects Technology (SPOT) initiative, which Microsoft first publicly announced more than three years ago when it introduced the MSN Direct Smart Watch. Developing SPOT devices required support for rich graphical applications on very inexpensive and power-efficient hardware. However, it did not require all of the features that were available in Windows CE. As a result, Microsoft created the .NET Micro Framework.

Won a Monthly C# Book @ DotNetSpider.com

Hello Friends,

Won a Monthly C# Book @ DotNetSpider.com


Check out my profile @ DotNetSpider.com

Wednesday, November 01, 2006

Won a 3rd Prize Prize @ Community-Credit

Hello Friends,


Again Won a Prize @ Community-Credit






I have won 3rd Prize : BendiBoard


Tuesday, October 31, 2006

Removing Duplicates Item from DropDownList

public static void RemoveDuplicateItems(DropDownList ddl)
{

for (int i = 0; i < ddl.Items.Count; i++)
{
ddl.SelectedIndex = i;
string str = ddl.SelectedItem.ToString();
for (int counter = i + 1; counter < ddl.Items.Count; counter++)
{
ddl.SelectedIndex = counter;
string compareStr = ddl.SelectedItem.ToString();
if (str == compareStr)
{
ddl.Items.RemoveAt(counter);
counter = counter - 1;
}
}
}
}

How to set hyperlinkfield to make it point to local file?

In Web.Config File

appSettings --Begin
add key="AboutTess_Pdf_Path" value="Documents/sampleAboutTess.pdf"
appSettings --End



In .CS File
if(!Page.IsPostBack)
{

string strPDFPath = ConfigurationSettings.AppSettings["AboutTess_Pdf_Path"].ToString();

string popupScript = "Javascript: return " +
"window.open('"+ strPDFPath + "', 'CustomPopUp', " +
"'width=600, height=600, menubar=no, resizable=yes');";

//Attach Script to button control
btnDownloadPDF.Attributes.Add("onclick",popupScript);
}

Sunday, October 29, 2006

Merge Individual Query Result in a sorted fashion

It is not possible to apply Order by Clause while using UNION Query, when we want to sort the individual query result and then want to merge the result data

Case: If we want to sort the individual query result and then want to merge the result data it is not possible to do so. Read the following article to see how it is possible.

Example:

Problem
--------
select categoryid,categoryname
from categories
order by 2
UNION
select productid,productname
from products
order by 2

Error
------
--It will give me following error
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'UNION'.


Partial Solution
------------------
select categoryid,categoryname
from categories
UNION
select productid,productname
from products
order by 2

--Problem with Partial Solution
It will sort all the result data by column 2., It is general sorting which is applied when we want to sort all the result data.

But what if we want to sort the individual query result and then want to merge the result data.

Solution
----------

select * from
(
select categoryid,categoryname, 1 as myOrder
from categories
UNION
select productid,productname, 2 as myOrder
from products
)
myTable
order by myTable.myOrder

So finally here the result query will display the data sorted by category and then by product. and the result data is shown.

Sending Web Page as Email

Take 4 Textbox control
1 - For URL typing (URL of webpage you want to send as a mail).
2 - For To Field (Email address of user sending the page.)
3 - For From Field (Destination Email address you want to send).
4 - For Subject Line

Now, switch to code view and add following namespace.

using System.IO;
using System.Net;
using System.Web.Mail;


//Function which convert URL information as string
//Which is used latter to passed as body message.
private String readHtmlPage(string url)
{
String result;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objResponse = objRequest.GetResponse();
using (StreamReader sr =
new StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
return result;
}


//Code for sending webpage as email.
private void btnSend_Click(object sender, System.EventArgs e)
{
//URL is converted into string message.
String message=readHtmlPage(txtURL.Text);
String mailServer = "192.168.0.10"; //Change with your mail server address.


try
{
MailMessage Mailer = new MailMessage();
Mailer.From = txtFrom.Text;
Mailer.To = txtTo.Text;
Mailer.Subject = txtSubject.Text;
Mailer.Body = message;
Mailer.BodyFormat = System.Web.Mail.MailFormat.Html;
SmtpMail.Server(mailServer);
SmtpMail.Send(Mailer);
lblResult.Text = "Page successfully sent!";
}
catch(Exception ex)
{
lblResult.Text = "An error occurred: " + ex.ToString();
}

}

Friday, October 27, 2006

Microsoft Preps XP-to-Vista App Migration Tool

Microsoft will unveil a tool to help Windows XP users migrate not only files and settings, but also applications to Windows Vista when the operating system launches, a company worker said.

Microsoft has released several tools to assist migration to Windows Vista, including an application compatibility kit that identifies applications that will run on Vista and tags those that need further testing or modification.

Read the whole story

Visual Studio Add-Ins : Essential Tools

Essential Tools, Visual Studio Add-Ins Every Developer Should Download Now

  1. TestDriven.NET
  2. GhostDoc
  3. Smart Paster
  4. CodeKeep
  5. PInvoke.NET
  6. VSWindowManager PowerToy
  7. WSContractFirst
  8. VSMouseBindings
  9. CopySourceAsHTML
  10. Cache Visualizer
  11. Wrapping It Up
Get the article at the link below:
Visual Studio Add-Ins Every Developer Should Download Now

Google offers personal searches


Google Custom Search Engine, as the tool is known, allows users to choose which webpages to search. Users can also customise the look of results, how web content is prioritised or add paying adverts to the results. For more detail click here

Thursday, October 26, 2006

Microsoft Blogstar Contest

Microsoft has announced the Microsoft Blogstar Contest a contest to identify the best Developer bloggers in India.

For registration and more information, check Microsoft Blogstar Contest

IndiMix 2006

IndiMix is the Indian version of MIX 2006 but has great additional flavours. One of the key things is that, Steve Ballmer, CEO, Microsoft Corporation addresses the key note and this is exclusively for this Indian event.

Venue: National Centre for the Performing Arts,Nariman Point,Mumbai 400 021India.

You can register for the Event online at IndiMix Event Registration

In case you feel you cannot make it for the event, in-person, then there is a Live Webcast, for which you can register at IndiMix Webcast Registration

Consuming RSS Feed is easy with RSS Toolkit

Consuming RSS Feed is easy with RSS Toolkit

check out the following link : http://blogs.msdn.com/dmitryr/archive/2006/02/21/536552.aspx

The RSS toolkit includes support for consuming as well as publishing RSS feeds in ASP.NET applications.

To know more about RSS Toolkit and downloading the component logon to http://blogs.msdn.com/dmitryr/archive/2006/02/21/536552.aspx

Windows Defender

Windows Defender is a free program that helps you stay productive by protecting your computer against pop-ups, slow performance and security threats caused by spyware and other potentially unwanted software. Download it

Powerful web browser : Maxthon

Maxthon is a powerful web browser with a highly customizable interface. It is based on the Internet Explorer engine which means that what works in IE, works the same in Maxthon but with many additional efficient features. Download It

Wednesday, October 25, 2006

ASP.NET AJAX Beta 1 Released

From Scott Guthrie's Blog:

Today I am very pleased to announce the first official Beta release of Microsoft ASP.NET AJAX v1.0. You can download it now from the http://ajax.asp.net site. Available on the site are three download options:

1) The ASP.NET AJAX v1.0 “Core” download. This redist contains the features that will be fully supported by Microsoft Product Support, and which will have a standard 10 year Microsoft support license (24 hours a day, 7 days a week, 365 days a year). The download includes support for the core AJAX type-system, networking stack, component model, extender base classes, and the server-side functionality to integrate within ASP.NET (including the super-popular ScriptManager, UpdatePanel, and Timer controls).

2) The ASP.NET AJAX “Value-Add” CTP download. This redist contains the additional higher-level features that were in previous CTPs of “Atlas,” but which won’t be in the fully-supported 1.0 “core” redist. These features will continue to be community supported as we refine them further and incorporate more feedback. Over time we’ll continue to move features into the “core” download as we finalize features in this value-add package more.

3) The ASP.NET AJAX Control Toolkit. This project contains 28 free, really cool, AJAX-enabled controls that are built on top of the ASP.NET AJAX 1.0 “Core” download. The project is collaborative shared source and built by a combination of Microsoft and non-Microsoft developers, and you can join the community or just download it on CodePlex today.

SQL Refactor from Red Gate

This software does what it's name implies. It helps you to refactor your database and SQL code. http://www.red-gate.com/messageboard/viewtopic.php?t=3438

For SQL Prompt: http://www.red-gate.com/products/SQL_Prompt/index.htm?gclid=CLaPur_8gogCFQt7WAodtxE5tw

Tuesday, October 24, 2006

Add-ons for IE7

Download add-ons for IE7 from www.ieaddons.com

IE7 Now Available

IE7 Now Available

It beats Firefox 2 out the door. Barely. Download it from http://www.microsoft.com/windows/ie/downloads/default.mspx

This is a major improvement over IE6, both in features (tabs, finally!) and in security. It's still a step behind Firefox in my opinion, but has significantly narrowed the gap.

Monday, October 23, 2006

Tips and Tricks for coding

I enjoyed reading Tips and Tricks from ScottGu's Blog, it is really interesting.  Try to find out more detail from his blog.
Sample
Tip/Trick: Using Server Side Comments with ASP.NET 2.0 

You are coding away on an ASP.NET page, and are trying to isolate a problem within the page. You have some existing html/controls/markup/in-line code that is being used on the page, and you want to temporarily comment it out while you fix the problem.
Solution
ASP.NET supports a little known feature called “server-side comments” that you can use to completely disable code/controls/html in a page. Server-side comments in ASP.NET are delimited using a <%-- --%> syntax.

For more info for this tip : http://weblogs.asp.net/scottgu/archive/2006/07/09/Tip_2F00_Trick_3A00_-Using-Server-Side-Comments-with-ASP.NET-2.0-.aspx
For more Information on lots of coding tricks log to ScottGu's Blog : http://weblogs.asp.net/scottgu/pages/ASP.NET-2.0-Tips_2C00_-Tricks_2C00_-Recipes-and-Gotchas.aspx

Sunday, October 22, 2006

Happy Diwali

Wishing you a very Happy Diwali.May this Diwali brings lots of happienss

Sunday, October 15, 2006

.Net FAQs Links


Dot Net FAQs
1) http://www.dailyfreecode.com/


http://dng-ado.blogspot.com/
http://dng-dotnetframework.blogspot.com/
http://dng-oops.blogspot.com/
http://dng-config.blogspot.com/
http://dng-collections.blogspot.com/


ASP.net FAQs
1) http://www.syncfusion.com/faq/aspnet/default.aspx
2) http://www.aspnetfaq.com
3) http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4081&lngWId=10
4) http://blogs.crsw.com/mark/articles/254.aspx
5) http://www.techinterviews.com/?p=176 & http://www.techinterviews.com/?p=193
6) http://www.eggheadcafe.com/articles/20021016.asp
7) http://www.cmap-online.org/Default.aspx?tabindex=4&tabid=-17

C# FAQs
1) http://www.andymcm.com => for c# and dot net frame work faqs
2) http://www.syncfusion.com/faq/windowsforms/default.aspx
3) http://www.c-sharpcorner.com/faq.asp
4) http://msdn.microsoft.com/vcsharp/productinfo/faq/default.aspx
5) http://www.yoda.arachsys.com/csharp/faq/
6) http://www.gotdotnet.com/team/csharp/learn/faq/
7) http://www.syncfusion.com/faq/windowsforms/default.aspx

Saturday, October 14, 2006

Import Excel To Datagrid ASP.net

private void btnImportExcelToGrid_Click(object sender,
System.EventArgs e)
{
String strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Book2.xls;" +
"Extended Properties=Excel 8.0;";

DataSet ds = new DataSet();
//You must use the $ after the object
//you reference in the spreadsheet
OleDbDataAdapter da = new OleDbDataAdapter
("SELECT * FROM [Sheet1$]", strConn);

//da.TableMappings.Add("Table", "ExcelTest");

da.Fill(ds);
DataGrid2.DataSource = ds.Tables[0].DefaultView;
DataGrid2.DataBind();
}

Note: If you want to give client upload facility, than first upload the file to the server. Next call the excel file from the following server location. Reference: http://www.dotnetspider.com/kb/Article361.aspx

Export Datagrid Data To Excel ASP.net

private void btnExportToExcel_Click(object sender,
System.EventArgs e)
{
ExportToExcel("Report.xls",DataGrid1);
}


private void ExportToExcel(string strFileName,DataGrid dg)
{ Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition",
"attachment;filename=" + strFileName);
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter sw = new StringWriter();
System.Web.UI.HtmlTextWriter htw = new HtmlTextWriter(sw);
dg.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}

Google Code Search

There is yet another brand new service from Google named as Google Code Search. This service designed to make it easier for computer programmers to find bits of code online. Google Code Search will make it easier for software developers to find programming code directly, without having to search forums, most of which are open source code.

http://www.google.com/codesearch

Friday, October 13, 2006

Brainbench Certified for .Net Framework Fundamental



I have achieved .NET Framework Fundamentals Certificate of Brainbench. You can logged to http://www.brainbench.com/ and enter my transcript-id : 6274829


OR


Friday, October 06, 2006

Generating Registration Image on FLY in asp.net

This article focus on generating image on fly in asp.net. This is very basic functionality which you find on almost all the website which require registration of user. Example: Yahoo Registration require to type you secret string before you can successfully login, this feature has no. of reasons and i am not going into detail of why we want rather i am explaining here how we can. Look for Screenshot for better idea



For demo purpose i am generating image on button click. But generally you require to generate image on page load event of registration form.
Ok back on coding.
Step1: Create a new web application
Step2: Open Code Behind Form of web application you have created.
Step3: Add Namespace for drawing Image.
using System.Drawing;
using System.Drawing.Imaging;
Step4: Write Code for Generating Random Registration String (Here: Generating Random string of 10 in length).
// Generate a random password with the specified length. The password will only
// contain digits and letters (either lowercase or uppercase)
public static string GetRandomPassword(int length)
{
Random rand = new Random();
System.Text.StringBuilder password = new System.Text.StringBuilder(length);
for (int i = 1; i <= length; i++) { int charIndex; // allow only digits and letters do { charIndex = rand.Next(48, 123); } while (!((charIndex >= 48 &&amp;amp; charIndex <= 57) (charIndex >= 65 && charIndex <= 90) (charIndex >= 97 && charIndex <= 122))); // add the random char to the password being built password.Append(Convert.ToChar(charIndex)); } return password.ToString(); }


Step5: Write Code for Generating Image. This code will create RegistrationImg.gif in your application folder.
//Generate Image
private void GenerateImage(string strRegistrationStr)
{
Bitmap objBitmap = new Bitmap(150, 30);
Graphics objGraphics = Graphics.FromImage(objBitmap);

//Fore Color and Background of Image
SolidBrush objForeColor = new SolidBrush(Color.White);
SolidBrush objBackColor = new SolidBrush(Color.Black);

objGraphics.FillRectangle(objBackColor, 0, 0, 150, 30);
//Font settings for Image
Font objFont = new Font("Arial", 15);
//Display from 5point from x-axis and 5point from y-axis
Point objPoint = new Point(5, 5);
//Drawing Registration String
objGraphics.DrawString(strRegistrationStr, objFont, objForeColor, objPoint);
//Saving Registration String as Image
//If you dont want image to save
//objBitmap.Save(Response.OutputStream, ImageFormat.Gif);
//otherwise use this
objBitmap.Save(Server.MapPath("RegistrationImg.gif"), ImageFormat.Gif);
//Release object
if(objBitmap != null)
objBitmap.Dispose();
if (objGraphics != null)
objGraphics.Dispose();
}


Step6: Finally code for calling the created functionality.
protected void btnShowRegistrationImg_Click(object sender, EventArgs e)
{
GenerateImage(GetRandomPassword(10));
ImgRegistrationStr.ImageUrl = "RegistrationImg.gif";
}

Wednesday, October 04, 2006

Won a Grand Prize @ Community-Credit

Hello Friends,

Again Won a Grand Prize @ Community-Credit



check out url and select "August 2006" from drop-down : http://www.community-credit.com/DisplayCommunityCreditPerMonth.aspx

I have won : Optimus Mini Three Keyboard


The Optimus Mini connects to your PC via USB and features three keys, each with their own backlit OLED screen. Each key can display a static image or full animation. Press the key and a different action occurs depending on what is assigned to it. Think it as some kind of futuristic dynamic hotkey device.
The bundled Optimus Mini Configurator software allows you to assign various actions to each of the three keys. Furthermore you can instantly switch between six different key layouts by holding down the Ctrl, Shift, Alt-Shift, or Ctrl+Shift keys on your larger keyboard. Hotkey options for Internet Explorer, Microsoft Word, Outlook Express and Windows media player are included. But forget about the practical stuff... what we liked best was being able to assign a different webcam image to each key and have them dynamically update. Or have a clock face with animated second hand displaying the time in Tokyo on one key while a CPU Usage graph scrolled across another key. You can of course mix and match the key functions to your desire and there is even support for portrait or landscape orientation.

Visual Studio and Vista Conflicts

Microsoft Cautions Developers About Visual Studio/Vista Conflicts Microsoft set off a furor among developers this week when it disclosed that Visual Studio 2005 won't be fully compatible with Vista and that older versions of Visual Studio won't be supported at all on Vista. Microsoft pledged to smooth out the Visual Studio 2005 software conflicts with a patch "soon" after Vista's release. Stacy Cowley

The bad thing is Visual Studio 2003's users cann't write applications in Vista , it means there are forced to migrate to 2005 version and also orcas is in the way. BTW Sql Server 2005 is also need a patch to work without any conflict in Vista. If it means Sql Server 2000 doesn't work in Vista ?

Monday, October 02, 2006

ASP.net Website Paths

Determining Physical Path of an Application

The MapPath method returns the complete physical path for a virtual path that you pass to the method. For example, the following code returns the file path for the root of your Web site:
String rootPath = Server.MapPath("~");


Client Elements
Elements that are not Web server controls on a page—client elements—are passed through as-is to the browser. Therefore, when referring to a resource from a client element, you construct paths according to standard rules for URLs in HTML. You can use a fully qualified (which is also known as absolute) URL path or various types of relative paths. For example, if your page contains an img element, you can set its src attribute using one of the following paths:

1) An absolute URL path. An absolute URL path is useful if you are referencing resources in another location, such as an external Web site.
img src="http://www.yahoo.com/MyApplication/Images/SampleImage.jpg"

2) A site-root relative path, which is resolved against the site root (not the application root). Site-root relative paths are useful if you keep cross-application resources, such as images or client script files, in a folder that is located under the Web site root.

This example path assumes that an Images folder is located under the Web site root.
img src="/Images/SampleImage.jpg"

Here, If your Web site is http://www.yahoo.com, the path would resolve to the following.
http://www.yahoo.com/Images/SampleImage.jpg

3) A relative path that is resolved against the current page path.
img src="Images/SampleImage.jpg"

4) A relative path that is resolved as a peer of the current page path.
img src="../Images/SampleImage.jpg"



Server Controls

Absolute and relative path references in a server control have the following disadvantages:

i) Absolute paths are not portable between applications. If you move the application that the absolute path points to, the links will break.

ii) Relative paths in the style of client elements can be difficult to maintain if you move resources or pages to different folders.

To overcome these disadvantages, ASP.NET includes the Web application root operator (~), which you can use when specifying a path in server controls. ASP.NET resolves the ~ operator to the root of the current application. You can use the ~ operator in conjunction with folders to specify a path that is based on the current root.

The following example shows the ~ operator used to specify a root-relative path for an image when using the Image server control In this example, the image file is read from the Images folder that is located directly under the root of the Web application, regardless of where in the Web site the page is located.
asp:image runat="server" id="Image1" ImageUrl="~/Images/SampleImage.jpg"

Sunday, October 01, 2006

Microsoft .NET Framework 3.0 - Release

The Microsoft .NET Framework 3.0 (formerly known as WinFX), is the new
managed code programming model for Windows. It combines the power of the .NET
Framework 2.0 with new technologies for building applications that have visually
compelling user experiences, seamless communication across technology
boundaries, and the ability to support a wide range of business processes. These
new technologies are Windows Presentation Foundation, Windows Communication
Foundation, Windows Workflow Foundation, and Windows CardSpace (formerly code named "Infocard"). Microsoft plans to ship .NET Framework 3.0 as part of the
Windows Vista operating system. In addition, Microsoft is making these
technologies available on Windows XP and Windows Server 2003. The following
Community Technology Preview of .NET Framework 3.0 enables you to continue
experimenting with early builds of these technologies, get acquainted with the
development experience, and provide feedback to Microsoft.

Download : http://www.microsoft.com/downloads/details.aspx?FamilyId=19E21845-F5E3-4387-95FF-66788825C1AF&displaylang=en

Got in to All Time List of Community-Credits

I have been entered into All Time List of Community-Credit.

You can check out the Link : http://www.community-credit.com

Become a Most Valuable Member of DotNetSpider Team


I have started contributing on DotNetSpider last month.

And i become a Most Valuable Member of DotNetSpider Team.

Thanks God and my well wisher whose blessings works out for me.

You can check out : http://www.dotnetspider.com/team/SpiderTeam.aspx

Send Email from Gmail in asp.net 2.0

Simplest Way of Sending Email from Gmail

protected void btnSendEmail_Click(object sender, EventArgs e)
{
//Create Mail Message Object with content that you want to send with mail.
System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage("dotnetguts@gmail.com","myfriend@yahoo.com",
"This is the mail subject", "Just wanted to say Hello");

MyMailMessage.IsBodyHtml = false;

//Proper Authentication Details need to be passed when sending email from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential("dotnetguts@gmail.com", "myPassword");

//Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587
//For different server like yahoo this details changes and you can
//get it from respective server.
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com",587);

//Enable SSL
mailClient.EnableSsl = true;

mailClient.UseDefaultCredentials = false;

mailClient.Credentials = mailAuthentication;

mailClient.Send(MyMailMessage);
}

Saturday, September 30, 2006

Microsoft Security Bulletin MS06-055

Vulnerability in Vector Markup Language Could Allow Remote Code Execution (925486)


If a user is logged on with administrative user rights, an attacker who successfully exploited this vulnerability could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.

Read it if you are using microsoft products, this will help u to avoid the direct attack.

http://www.microsoft.com/technet/security/bulletin/ms06-055.mspx

OOPs!!!! Vista won't support older Visual Studio versions

Windows Vista will not support older versions of Visual Studio, a move that will require many developers writing applications for the forthcoming operating system to upgrade to Visual Studio 2005, a Microsoft executive said Tuesday.

Developers writing Vista-compatible applications will be unable to use Visual Studio 2002 or Visual Studio 2003 if those are running on top of the new operating system, wrote S. Somasegar, vice president of Microsoft's developer division, in a blog entry.

The requirement was included as part of announcement of Service Pack 1 for Visual Studio 2005, which was released Tuesday on the Microsoft Connect Web site for developers.



http://www.infoworld.com/article/06/09/26/HNvisualstudioupdate_1.html

Monday, September 25, 2006

EasyListBox web control (FREE)

EasyListBox is an ASP.NET server control. This means that your server is required to have ASP.NET (and, by definition, the .NET Framework) installed. If you do not have ASP.NET, you can download it from the official website.

...with SuperSearch
...with AJAX for comboboxes and related lists
...to support ASP.NET validators
...to provide multi-column dropdown lists
...to support HTML in a listbox

Total customization: HTML, images, scrollbars

...with SpeedSearch
...with URLJump
...to integrate combo box behavior (with the flip of a switch)
...to bring you swapper lists
...to provide no-code databinding
...to bring you full Dreamweaver compatibility
...with DataGrid integration

http://www.asp.net/download-1.1.aspx?tabindex=0&tabid=1

http://easylistbox.com/home.aspx

Wednesday, September 20, 2006

Replacing Cursor with For Loops


Advantages of replacing curosors with for loop
-Implicitly declares its loop index as a %rowtype record
-opens, fetch and close operation are done automatically.
-It reduce coding and it is easy to understand.


----------------------------------
--Simple Select Procedure Example
----------------------------------
--Create Procedure
CREATE PROCEDURE SP_Print_Hello
AS
BEGIN
FOR IDX IN (Select ename from emp)
LOOP
DBMS_OUTPUT.PUT_LINE('Hello ' IDX.ename);
END LOOP;
END;


--Execute Procedure
begin
scott.sp_inc_salary ( );
end;


--Output
Hello SMITH
Hello ALLEN
Hello WARD
Hello JONES
Hello MARTIN
Hello BLAKE
Hello CLARK
Hello SCOTT
Hello KING
Hello TURNER
Hello ADAMS
Hello JAMES
Hello FORD
Hello MILLER
----------------------------------



-------------------------------------
--Manipulate Batch Update Statement
-------------------------------------
--Create Procedure
CREATE PROCEDURE SP_Increment_Salary
AS
mIncAmt number(5);
BEGIN
mIncAmt := 2000;
FOR IDX IN (Select empno,sal from emp)
LOOP
Update emp
Set sal = IDX.sal + mIncAmt
where empno = IDX.empno;
END LOOP;
END;


--Execute Procedure
begin
scott.SP_Increment_Salary ( );
end;


--OUTPUT
Procedure updated successfully....
-----------------------------------------

Data Dictionary Queries for SQL Server and Oracle

For SQL Server

--Finding all details of Primary Key constraint
select * from sysobjectswhere xtype='PK'

--Finding all details of Foreign Key constraint
select * from sysobjectswhere xtype='F'

--Finding all User-Defined objects (tables, etc)
select * from sysobjectswhere xtype='U'

--Finding all System objects
select * from sysobjectswhere xtype='S'

--Finding all user names
select * from sysusers

--Finding Column Names of Particular Table
--Select Pubs Database
select c.name from sysobjects o, syscolumns cwhere o.id = c.id ando.name = 'publishers'



For ORACLE
select * from sys.dba_objectswhere owner = 'scott'and object_type='TABLE'
SELECT owner, object_name, object_type FROM sys.dba_objectswhere object_type='SEQUENCE' and owner='scott';

Today I was just trap with some queries and so the solution i come up with

Tuesday, September 19, 2006

Tri-State TreeView Control for Web Application

I had found a Tri-State Treeview control for web application (asp.net) for both .net 1.1 and 2.0

There are lots of third party tree-view controls available on net but among that i found that ExpertTree control is the best control. It has all the features that i was looking for and the most important of all is Tri-State.

Download Demo version:
http://www.aspnetexpert.com/Download.aspx

Tech Blog i enjoyed

I enjoyed my time on reading blog : http://blog.vanslaars.com/

I specially enjoyed it asp.net 2.0 section

Monday, September 11, 2006

.Net Forums

Advice Forums are most useful forum for .Net Query Posting.

There are lots of forum available, but i was truly helped by advice forum. Most of the members are experience and are MVP, and to best of all they participate actively.

I had been trapped with "how to use dynamic control optimally" so that it doesn't affect my web performance, i got a very good response.

You can try out
http://aspadvice.com/

beside that there are other interesting forum
http://www.dotnetspider.com
http://www.sqladvice.com
http://www.xmladvice.com

Saturday, September 02, 2006

Won a Special Gift @ DotNetSpider

Hello Friends,

Won a Special Gift @ DotNetSpider



check out url and select "August 2006" from drop-down : http://www.dotnetspider.com/profiles/ViewProfile.aspx?userId=CodeGuruDotNet

I have won : Special Gift: Mini Memory Stick (128MB)

Again its a happy day... as I become a proud member of DotNetSpider.com

Yahoo services available on Windows-based mobile phones

Yahoo made e-mail, Internet search and other services available on mobile telephones with Microsoft's Windows Mobile operating systems.

The 'Yahoo Go for Mobile' suite of services available on Windows "smartphones" such as the Motorola Q included news, photo albums, and calendars, according to the Sunnyvale, California, company.

"Staying connected to essential information, from business contacts and calendar to personal email or news, is a crucial part of today's mobile lifestyle," Microsoft general manager Scott Horn said in a release.

"The availability of Yahoo Go for Mobile on Windows Mobile-powered phones will allow our
customers to bring their favorite Yahoo services to the devices they already rely on."

http://news.yahoo.com/s/afp/20060830/tc_afp/afplifestyleusinternet

Friday, September 01, 2006

Won a Grand Prize @ Community-Credit

Hello Friends,

Won a Grand Prize @ Community-Credit



check out url and select "August 2006" from drop-down : http://www.community-credit.com/DisplayCommunityCreditPerMonth.aspx

I have won : T.One 8GB USB Microdrive



Satiate Your Portable Storage Hunger with this month's Grand Prize . Trust us when we say the T.One is the mack-daddy of USB thumb drives. You get 8 gigs of storage and high-speed USB 2.0 transfer speeds in a sleek case less than 2 inches square. How do you cram a boatload of storage into such a small package? Amazingly, each T.One Microdrive has an eensy weensy 8GB hard drive inside. Buy one and dominate over your co-workers in the office thumb drive smackdown.

I am now a proud member of community-credit

Well Today was happy day..

Popup .PDF File in New Window from ASP.net Code Page

//Add the Following in Web.Config File





//Add the Following Line of Code in Page Load Event

//Find the path of Download .PDF File from Web.Config File
string sPDFPath = ConfigurationSettings.AppSettings["Pdf_Path"].ToString();

//Prepare a script to open the file in a new window
string popupScript = "Javascript: return " +
"window.open('"+ sPDFPath + "', 'CustomPopUp', " +
"'width=600, height=600, menubar=no, resizable=yes');";


//Attach Script to button control
btnDownloadPdf.Attributes.Add("onclick",popupScript);

Thursday, August 31, 2006

Google Now Offers Book Downloads


Google has expanded its controversial book search service to allow people to download whole copies of books in PDF format to their computers, with the ability to print them out.
The feature will go live Wednesday at the service's Web site, said Adam Smith, group product manager of Google Book Search and Google Scholar.


The books available for download will only be those that are in the public domain and thus not protected by copyright, Smith said. Until now, people have been able to read these public-domain books on the Google Book Search Web site, but not download and print them, he said.

Google will not allow downloading of copyrighted books, not even those for which it has obtained permission from the copyright holders to display their full text, Smith said.

The vast majority of the public-domain books available for download have been scanned as part of the library project of the Google Book Search service, Smith said.


http://books.google.com/


To read entire article : http://www.pcworld.com/article/id,126964-c,google/article.html

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape