Posts

Auto Complete Example in Asp.net C#

There are too many methods to make an auto complete text box in asp.net You can use JQuery ( Use jquery for Auto Complete ), Ajax Auto complete extender and so on. If you will search on internet you will find so many examples which are using JQuery or Ajax Extender to show auto complete on websites. I had searched on many sites I had tried so many examples to populate auto complete list but, unfortunately, I am not able to find an efficient auto complete example. Finally after searching for many hours I had decided to write my own code. My example is using an asp.net C# to show auto complete. Here, code goes Download Code Run and try typing some numbers or text. You will find an auto complete list on page

How to use Enterprise Library using C#

Summary The Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist software developers with common enterprise development cross-cutting concerns (such as logging, validation, data access, exception handling, and many others). Application blocks are a type of guidance; they are provided as source code, test cases, and documentation that can be used "as is," extended, or modified by developers to use on complex, enterprise-level line-of-business development projects. Some Features While using enterprise library you have to concern about opening and closing connections. This will automatically handle connection pooling and other important errors of connection and database. I had used Enterprise Library 2.0 - January 2006. To use Enterprise Library you required to add reference of following files:- Microsoft.Practices.EnterpriseLibrary.Common.dll Microsoft.Practices.EnterpriseLibrary.Configuration.De...

How to create base class in C#

Image
Introduction One of the many benefits of object-oriented programming is that it allows for reuse of logic. For example, classes can be created that contain a base level of functionality. These base classes can then be extended through inheritance to create new classes that encompass the functionality of the base class along with any custom logic needed. The end result is that as a developer, once the base class has been created, you can extend and enhance the functionality of the base class with minimal effort. Since the .NET Framework is built upon the principles of object-oriented programming (OOP), it's no surprise that ASP.NET borrows heavily from the tenets of OOP, one such tenet being inheritance. The base functionality for all ASP.NET pages is spelled out by the Page class in the System.Web.UI namespace. This class defines the essential properties, methods, and events for an ASP.NET page, including such members as: The intrinsic objects - Response, Request, Session, and...

How to send e-mail using C# with Attachment

When I am working in core asp mail sending is one of the biggest task. For mail sending I have to check for third party on server. I have to according to third party avalibale on different server. But, now say thanks to Microsoft who had made that task easy. Sending a email using ASP.NET 2.0 and C# 2.0 is actually very simple. First, you will need to import the System.Net.Mail namespace. The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email. You have to write this code to your page. public static void Send(string SMTPServerName, string SMTPUserName, string SMTPPassWord, string MailFrom, string MailTo, string CC, string BCC, string Subject, string Body, bool BodyHTML, string Attachment) { MailMessage message = new MailMessage(MailFrom, MailTo, Subject, Body); /******************************************/ //Adding multiple To Addresses foreach (string sTo...

How to Make Windows Service Using C# 2008

Image
I have an task to run a Stored procedure after every 30 minutes. My first choice is to create a job on Sql server. But I also have to write a log file along with the stored procedure. Now, my choice will be Windows service. Creating a windows service is a very easy task but how to deply...... let me explain how to work with windows service. Creating a program that can run in the background of the operating system has any benefits, this is very important as the program can run without a graphic user interface. Complex service that are to run are longer time, and without the need the user to login the system. Windows services are harder to develop, debug, and test. But if you software are to run in server that require to start up automatically with the server is turn on, Windows service is your choice. Creating your skeleton project in Visual Studio 2008 To create a Windows Service project in Visual Studio 2008, you must select from the Visual C# Windows Projects. Give your Windows Servi...

How to Debug JavaScript Using C#

Image
Client Java Script is one of the most important things in web development but not the best and easiest to develop. Building of bigger and more complicated scripts, especially using DOM model or form field values can cause a lot of frustration and head pain. Moreover, JavaScript debugging is not easy and obvious as should be. But there is a hope. Before start, we should ensure that client script debugging is not disabled in IE as it is by default. Suitable options are located on advanced tab of Internet Options where both script debugging checkboxes should be unchecked. Go to Tools>>Options >> and refer image below. You can also download code from http://www.4shared.com/file/106977680/64e2c2b2/DebugJavascript.html Now open your code and put Debugger; key word in your code. Refer image below Now run your code, on IE. You will find and window. Refer image below. Click yes to start debugging. It will take some time to open debu...

launch of Visual Studio 2010 and .NET Framework 4 Beta 1

Microsoft Launched Visual Studio 2010 Beta 1. For more information please visit http://blogs.msdn.com/jasonz/archive/2009/05/20/general-download-of-vs2010-net-framework-4-0-beta-1.aspx Can also download from http://msdn.microsoft.com/hi-in/vstudio/dd582936(en-us).aspx One new language suite F# http://msdn.microsoft.com/hi-in/fsharp/default(en-us).aspx The final release will take time to be launched. I really want to hear your feedback! I will definitely follow blog comments, but the best way to give us that feedback is through the Visual Studio 2010 / .NET Framework 4 Beta 1 site . You can get your issues and suggestions routed to the teams directly by going through this route.