Hello Friends....
Welcome to this Blog...This Blog is specially for the .Net Developers where all developers can discuss the .Net and Sql Articles.
"And will you succeed? Yes! You will indeed!(98 and 3/4 percent guaranteed)."

Wednesday, September 7, 2011

Delete data from Gridview using Command Field

In this article, I am going to explain how to delete a record from Gridview.This is very easy process and steps for this is as follows:

1. Add New Webpage in your Webapplication.

2. Drag Gridview from toolbox and bind it to database.

Note:If you need any help in binding the gridview to the database you can view my article which is:

3. Now we proceed further after successfully binding of data.The Steps for Deleting records from gridview are:

a: Select Edit columns from properties of Gridview.

b:You will see dialog box appears for Field:

c:You have to select the Command Fields option from the available field.In Command Fields you will find 3 events which are:
  • Edit,Update and Cancel.
  • Select
  • Delete
From the above Points select Delete Button.

d: Now fire the event RowDeleteing from Gridview Properties

Coding to delete the data from gridview on Event Row Deleting is:

            protected void GridView1_RowDeleting(object sender,          
      GridViewDeleteEventArgs e)
         {
           con.Open();
           Label id =(Label)GridView1.
           Rows[e.RowIndex].FindControl("Label5");
           SqlCommand save = new SqlCommand();
           save.Connection = con;
           save.CommandText="delete from tbtablename where id='"+     
           id.Text+"'";
           save.ExecuteNonQuery();
           save.Dispose();
           con.Close();
           luck(); //bind function name
          }

 If you any query in this article do ask me.

Thank You

           

Monday, April 25, 2011

Introduction to .NET and .NET Architecture

What is .NET?

Microsoft .NET (pronounced “dot net”) is a software component that runs on the Windows operating system. .NET provides tools and libraries that enable developers to create Windows software much faster and easier. .NET benefits end-users by providing applications of higher capability, quality and security. The .NET Framework must be installed on a user’s PC to run .NET applications.
This is how Microsoft describes it: “.NET is the Microsoft Web services strategy to connect information, people, systems, and devices through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions with Web services.
  
What is the .NET architecture?

Microsoft .NET consists of four major components:
  • Common Language Specification (CLS) – blue in the diagram below
  • Framework Class Library (FCL) – red
  • Common Language Runtime (CLR) – green
  • .NET Tools – yellow



At the base of the diagram in gray is the operating system, which technically can be any platform but typically is Microsoft Windows 2000 or greater, accessed through the Win32 API (Application Programming Interface).
 

Common Language Specification (CLS)


The CLS is a common platform that integrates code and components from multiple .NET programming languages. In other words, a .NET application can be written in multiple programming languages with no extra work by the developer (though converting code between languages can be tricky).
.NET includes new object-oriented programming languages such as C#, Visual Basic .NET, J# (a Java clone) and Managed C++.

 

Framework Class Library (FCL)

The FCL is a collection of over 7000 classes and data types that enable .NET applications to read and write files, access databases, process XML, display a graphical user interface, draw graphics, use Web services, etc. The FCL wraps much of the massive, complex Win32 API into more simple .NET objects that can be used by C# and other .NET programming languages.

 

Common Language Runtime (CLR)

The CLR is the execution engine for .NET applications and serves as the interface between .NET applications and the operating system. The CLR provides many services such as:
  • Loads and executes code
  • Converts intermediate language to native machine code
  • Separates processes and memory
  • Manages memory and objects
  • Enforces code and access security
  • Handles exceptions
  • Interfaces between managed code, COM objects, and DLLs
  • Provides type-checking
  • Provides code meta data (Reflection)
  • Provides profiling, debugging, etc.

 

.NET Tools

Visual Studio .NET is Microsoft’s flagship tool for developing Windows software. Visual Studio provides an integrated development environment (IDE) for developers to create standalone Windows applications, interactive Web sites, Web applications, and Web services running on any platform that supports .NET.
In addition, there are many .NET Framework tools designed to help developers create, configure, deploy, manage and secure .NET applications and components.

Thank You:
Dinesh Wadhwa

Tuesday, March 15, 2011

Difference Between ASP.NET & ASP

What Are Active Server Pages (Classic ASP)?

Active Server Pages or Classic ASP, as it is more commonly known, is a technology that enables you to make dynamic and interactive web pages.

Classic ASP uses server-side scripting to dynamically produce web pages that are not affected by the type of browser the website visitor is using.

The default scripting language used for writing ASP is VBScript, although you can use other scripting languages like JScript (Microsoft's version of JavaScript).

Classic ASP pages have the extension .asp instead of .htm, when a page with the extension .asp is requested by a browser the web server knows to interpret any ASP contained within the web page before sending the HTML produced to the browser. This way all the ASP is run on the web server and no ASP will ever be passed to the web browser.

Any web pages containing ASP cannot be run by just simply opening the page in a web browser. The page must be requested through a web server that supports ASP, this is why ASP stands for Active Server Pages, no server, no active pages.

As Classic ASP was first introduced by Microsoft on it's web server, Internet Information Services (IIS), that runs on all versions of Windows from NT4, including Windows 7, Vista, XP Pro, and Windows Server OS's like Windows 2000, 2003, 2008, it is this web server that ASP pages usually run best on.

What Is ASP.NET ?

ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
ASP.NET web pages or webpage, known officially as "web forms", are the main building block for application development. Web forms are contained in files with an ".aspx" extension; these files typically contain static (X)HTML markup, as well as mark up defining server-side Web Controls and User Controls where the developers place all the required static and dynamic content for the web page. Additionally, dynamic code which runs on the server can be placed in a page within a block <% -- dynamic code -- %>, which is similar to other web development technologies such as PHP, JSP, and ASP. With ASP.NET Framework 2.0, Microsoft introduced a new code-behind model which allows static text to remain on the .aspx page, while dynamic code remains in an .aspx.vb or .aspx.cs file (depending on the programming language used).

ASP.NET compared with ASP classic

ASP.NET simplifies developers' transition from Windows application development to web development by offering the ability to build pages composed of controls similar to a Windows user interface. A web control, such as a button or label, functions in very much the same way as its Windows counterpart: code can assign its properties and respond to its events. Controls know how to render themselves: whereas Windows controls draw themselves to the screen, web controls produce segments of HTML and JavaScript which form parts of the resulting page sent to the end-user's browser.
ASP.NET encourages the programmer to develop applications using an event-driven GUI model, rather than in conventional web-scripting environments like ASP and PHP. The framework combines existing technologies such as JavaScript with internal components like "ViewState" to bring persistent (inter-request) state to the inherently stateless web environment.
Other differences compared to ASP classic are:
  • Compiled code means applications run faster with more design-time errors trapped at the development stage.
  • Significantly improved run-time error handling, making use of exception handling using try-catch blocks.
  • Similar metaphors to Microsoft Windows applications such as controls and events.
  • An extensive set of controls and class libraries allows the rapid building of applications, plus user-defined controls allow commonly-used web template, such as menus. Layout of these controls on a page is easier because most of it can be done visually in most editors.
  • ASP.NET uses the multi-language abilities of the .NET Common Language Runtime, allowing web pages to be coded in VB.NET, C#, J#, Delphi.NET, Chrome, etc.
  • Ability to cache the whole page or just parts of it to improve performance.
  • Ability to use the code-behind development model to separate business logic from presentation.
  • Ability to use true object-oriented design for programming pages and controls
  • If an ASP.NET application leaks memory, the ASP.NET runtime unloads the AppDomain hosting the erring application and reloads the application in a new AppDomain.
  • Session state in ASP.NET can be saved in a Microsoft SQL Server database or in a separate process running on the same machine as the web server or on a different machine. That way session values are not lost when the web server is reset or the ASP.NET worker process is recycled.
  • Versions of ASP.NET prior to 2.0 were criticized for their lack of standards compliance. The generated HTML and JavaScript sent to the client browser would not always validate against W3C/ECMA standards. In addition, the framework's browser detection feature sometimes incorrectly identified web browsers other than Microsoft's own Internet Explorer as "downlevel" and returned HTML/JavaScript to these clients with some of the features removed, or sometimes crippled or broken. However, in version 2.0, all controls generate valid HTML 4.0, XHTML 1.0 (the default) or XHTML 1.1 output, depending on the site configuration. Detection of standards-compliant web browsers is more robust and support for Cascading Style Sheets is more extensive.
  • Web Server Controls: these are controls introduced by ASP.NET for providing the UI for the web form. These controls are state managed controls and are WYSIWYG controls.

Monday, January 24, 2011

Embed Tiny Editor in Your Web Application:

1. First of all open your Web page in your application in which you want to embed the
Editor.

2. This editor is know as Tiny Editor which has nice features by which the user can enter his/her text in stylish way by embedding smileyes, embed photos.

3. We can set font family, Font Size, Cut, Copy, Paste and many other functions are there by which the text can be represented in a better way.


4. Now Steps to embed the Tiny Editor in you web page are:

a: Drag and Drop Textbox and give id to id name RichTextBox.

b: Set the Property of Textbox:-TextMode Property to Multiline.

c: Drop one Label to page, we transfer the text from RichText Box to Label when we store the text to database.

d: Put this Code in your Head Tag:

 <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<script type="text/javascript">
   tinyMCE.init(
    {
        mode : "textareas",
        theme : "advanced",
        plugins : safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false,
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js"
    });
</script>

This code include the path of Java Script File of tiny editor.
5. Download the Tiny Editor from the path which I am giving you below:

Link:  http://tinymce.moxiecode.com/download/download.php

6. Put the Downloaded Folder into you Website. This Folder contains all editor files including JS File.

We have given the link of the Editor JS File in 4(d) Point.

7. Now Run your Webpage and see Tiny Editor Placed there.



Enjoy Your Coding:

IF any Query then you can ask me here only.