C# : Tutorial of Asp.net with c# and example

Example and code about windows application, web application, SQL, C#, WPF etc which is helpful to developer and programer.

Search This Blog

Tutorial : What is vb dot net and its use?

♠ Posted by Unknown in ,,

What is vb.Net?


VB.Net is a simple, modern, object-oriented computer programming system developed and owned by Microsoft.


Visual Basic was originally developed to make it easier to write programs for the Windows operating system. The basis of Visual Basic is an earlier programming language called BASIC. Visual Basic is often referred to using just the initials VB. Visual Basic is easily the most widely used computer programming system in the history of software.it is combine the power of .NET Framework and the common language runtime with the productivity benefits that are the hallmark of Visual Basic.



Visual Basic was one of the first systems that made it practical to write programs for the Windows operating

system. This was possible and easy for programmer because VB included software tools to automatically create the detailed programming required by Windows its make programmer life very easy. These software tools not only create Windows programs, they also take full advantage of the graphical way that Windows works by letting programmers "draw" their systems with a mouse on the computer. So it's called "Visual" Basic.


Visual Basic .NET has many new and improved features that make it a powerful object-oriented programming language, including inheritance, interfaces, and overloading. Other new language features include free and structured exception handling. Visual Basic .NET also fully integrates the .NET Framework and the Common Language Runtime, which provide language interoperability, garbage collection, enhanced security, and improved versioning support.


Visual Basic .NET, the next generation of the Visual Basic language, is a fast and easy way to create .NET-

based applications, including XML Web services and Web applications.

Version history:



2002 (VB 7.0)
2003 (VB 7.1)
2005 (VB 8.0)
2008 (VB 9.0)
2010 (VB 10.0)
2012 (VB 11.0)
2015 (VB 14)

Sample program for Hello World display



Public Class HelloForm

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MessageBox.Show("Hello World Good Morning...", "Message Box Title")
    End Sub

End Class

aspdotnethelpmaster.blogspot.in what is vb.net
aspdotnethelpmaster:what is vb.net


Improve Your Answer as comment below.

If our post is useful please share and comment on our post for more post and detail Visit :


http://aspdotnethelpmaster.blogspot.in/

Disadvantages of ASP.NET Technology


Disadvantages of ASP.Net

Limited control compare to HTML:

Server controls render themselves as HTML(Hypertext markup language), but the HTML output usually failed to comply with web standards, and server controls generated irregular and complex ID values that are hard to access using JavaScript.

Big data in the view state:

annoying site visitors with slower response times and required the bandwidth demands of the server.

Limited support for testing:

The tightly coupled architecture designed is unsuitable for unit testing. Integration testing can be a great challenge, too.

Difficult Page Life cycle:


  •  Lots of people will not be able to effectively use ASP.NET page life cycle because it is very difficult the control hierarchy at run time or finding a proper event handlers to execute.
  • The page life cycles of the asp.NET page are well documented but the many number of events make the developer extremely difficult to figure out how and where to implement code.

Difficulty with MVC:

It is difficult to understand code and do programming when you need some customization. If you have everyday changes in your database, you may find it irritating to keep building application again and again. It may also create problem in several other parts of application.

Difficulty with Session:

Low Performance for large volumes of data and  Overhead involved for serializing and de-serializing the Session data.

Difficulty with Updatepanel:

the biggest disadvantage is that it still sends all the viewstate back and forward so you won't waste a lot of bandwidth. Another one's that most of the page life cycle still gets rum.

Disadvantages of Asp.Net


Improve Your Answer as comment below.

If our post is useful please share and comment on our post for more post and detail Visit :


http://aspdotnethelpmaster.blogspot.in/

Advantages of asp.net and Asp.net vs Asp

Advantages of ASP.NET


Advantages of ASP.NET framework for Web development are as follows:

  • Web application exists in compiled form on the server so the execution speed is faster as compared to the interpreted scripts.
  • ASP.NET reduces the line of code needed to develop large applications.
  • The code-behind allows you easier to maintain the code when it comes to large websites.
  • The ASP code and HTML smoothly mix with each other to generate dynamic web pages.
  • It is an ideal server-side scripting technology that is why code runs on the windows server before displaying on the web browser.
  • Built-in Windows authentication and per-application configuration keep your applications secured.
  • Content and program logic are separated which reduces the inconveniences of program maintenance.
  • Dot NET framework is language independent, so choose any programming language that best suited to develop your application.
  • To develop program logic, a developer can choose to write their code in more than 25 .Net languages including VB.Net, C#, JScript.Net etc.
  • You have the freedom of choosing from multiple languages (C#, VB.NET, C++, etc.)
  • Being part of .Framework, it has access to all the features of .Net Framework.
  • ASP.NET makes development simpler and easier to maintain with an event-driven, server-side programming model.
  • ASP.NET makes for easy deployment. There is no need to register components because the configuration information is built-in.
  • SQL Server is also very fast, secure, and it can store extremely large amounts of data; actually, there’s no limit.
  • With ASP.NET you get the whole .NET Class Library and the thousands of third party components as well. There are definitely much more third party components out there for .NET than for PHP.
  • The Windows Web server precisely monitors the web pages, various components and application running over it.
  • It immediately gives an alert for any memory leaks, unbounded loops and other illegal behaviors. It instantly kills those behaviors and restarts automatically.
  • Introduction of view state helps in maintaining state of the controls automatically between the postbacks events.
  • ASP.NET offers built-in security features through windows authentication or other authentication methods.
  • ASP.Net features such as early binding, JIT compilation, caching services and native optimization supports to get high level of performance.
  • All the applications are minutely monitored and managed to help application continuously available to handle requests.
  • ASP.NET is a quick way of getting started with web development if you have worked with Visual Basic or other visual form development tools before.
  • Good Editor tool available in Visual studio.ASP.NET, with its advantages, is the next- generation platform of Microsoft's ASP. It is a widely used development framework for developing an enterprise level web application. Either for building a small website or a large corporate web application, ASP.NET is the best development application that today’s developers love to use.
  • ASP.NET MVC. It's a .NET implementation of the model-view-controller concept, which basically means you have separate layers for data handling, domain logic and presentation. It will result in much more web-style development, with cleaner separation of code and cleaner output. This will probably result in a much more manageable web site.
  • ASP.Net is the next generation of Microsoft's Active Server Page (ASP) technology platform.


Advantage of ASP.Net over ASP in the following ways:

  • Language Support – While ASP supported VBScript (a subset of Visual Basic) and Jscript (a subset of Java), ASP.Net supports standard programming languages including Visual Basic, C# and C++.
  • Compiled Code – ASP.Net provides greatly increased performance by running compiled versus interpreted code.
  • Event-Driven Programming Model – All ASP.Net objects on a Web page expose events that can be processed by ASP.Net code. Handling events such as Load, Click and Change via code reduces program complexity and increases organization.
  • User Authentication – ASP.Net supports forms-based user authentication, including cookie management and automatic redirection of unauthorized logins. ASP.Net allows for user accounts and roles thus providing a high degree of granularity for controlling access to objects and pages.
  • Third-Party Controls – The ASP.Net community has been growing rapidly for the last two years. 
  • There is a large base of high-quality third-party controls that can be obtained to significantly speed up development time and reduce cost.
  • Easier Configuration & Deployment – Configuration is done with plain text files which can be uploaded or changed while the application is running. There is no need to restart the web server to affect a change.
  • Object and Page Caching – ASP.Net objects and pages can be cached to dramatically increase performance. The caching system is very advanced, allowing you to specify what needs to be cached and what doesn’t and when to recall the cached information rather than perform a new request.
  • Higher Scalability – ASP.Net has some great scalability features built into it, including maintaining session state across servers, and multi-processor load balancing.
  • The Visual Studio .NET IDE. makes coding much, much easier. It can highlight syntax, let you know when the wrong stuff is commented, do command completion, and just plain help you organize better. Visual Studio has a really nice debugger.
  • The Compiled Code (vs. PHP Interpreted Code) – .NET compiles code, such as C#, into what its creators have termed MSIL (Microsoft Intermediate Language).
  • In ASP.NET it’s easy to use threads and build asynchronous handlers in your server-side web code.
  • ASP.NET developers are paid better.




Improve Your Answer as comment below.

If our post is useful please share and comment on our post for more post and detail Visit :


http://aspdotnethelpmaster.blogspot.in/

What is asp.net

♠ Posted by Unknown in

Asp.Net

Definition : 


Asp.Net (Active Server Pages) is server-side Web application framework which is an open source. Asp.Net framework designs for web development its use to create dynamic WebPages. It was developed before 2000 by Microsoft which is allow programmers to build dynamic web application, web service any many more about web. Asp to meet market demand it is run on the server and generates dynamic web pages that can be viewed in different web browsers.


About Version :
Version 1.0 of .Net Framework was released in January 2002 and beginning of success of Microsoft's Active Server Pages (ASP) technology. Asp.Net is built on CLR (Common Language Runtime). CLR allow programmer to write Asp.Net code using any supported .Net languages.

Version 1.1 is release for focused on improving ASP.NET's support for mobile devices and it is loosely based on HTML. ASP.NET Web Pages and the Razor syntax provide a fast, approachable, and lightweight way to combine server code with HTML to create dynamic web content. Connect to databases, add video, link to social networking sites, and include many more features that help you create beautiful sites that conform to the latest web standards. With ASP.NET Web Forms, you can build dynamic websites using a familiar drag-and-drop, event-driven model and 100s of control to develop awesome web page and excellent UI with easy data access. 

About Frameworks:
All ASP.NET frameworks are based on the .NET Framework and share core functionality of .NET and of ASP.NET. In addition, All ASP.NET frameworks are dependent. Since the frameworks can exist in the same web application.  It is common to see individual components of applications written using different frameworks.

For example, Client only See portions of an app might be developed in MVC to optimize the markup, while the data related and admin portions are developed using Web pages to take advantage of data controls and simple and easy data access. Because of that made significant improvements in the latest releases of ASP.NET and Visual Studio to make it easy and simple to use these frameworks together.


Improve Your Answer as comment below.

If our post is useful please share and comment on our post for more post and detail Visit :


http://aspdotnethelpmaster.blogspot.in/

UserControl Tutorial : Create ,Register and use of usercontrol in asp.net with example and code

♠ Posted by Unknown in ,



Tutorial Of Asp.Net UserControl


Definition of UserControl in Asp.Net :

In Asp.Net Web server controls , you can create your own custom, reusable controls using following step. These controls are called user controls.

A user control is a kind of composite control that works much like an ASP.NET other server control . you can add existing Web server controls and markup to a user control, and define properties and methods for the control. You can then embed them in ASP.NET Web pages like same as other server control.



For create asp.net usercontrol using c# following step perform





Step 1: First of all add one folder in your website or project for contain all user control as follow screen.

Step 2:Right Click on folder in which you want to contain usercontrol as follow screen.

Step 3: Select web user control , give proper name and click to add button as follow screen



Step 4 : after add you can see your control in your project or website as follow screen:


Step 5: Now you need to add code in .ascx page as per your required control as follow screen:

Code For Simple Text box control make as userdefine control you set property once in user define control then you no need to write again only need to register control on your page and use it. Following code in .ascx page.

<asp:TextBox ID="TextBox1" runat="server" BackColor="WhiteSmoke" BorderColor="ActiveBorder"
    Font-Bold="true" Font-Size="X-Large" ForeColor="Aqua" Height="70px" TextMode="MultiLine" runat="server"
    Width="100px"></asp:TextBox>
Now your control is ready to use.

Step 6: Add following code to register user control in your webpage in second line:


<%@ Register Src="~/Control/UserDefineTextBoxWebUserControl.ascx" TagName="TextBox" TagPrefix="My" %>

Step 6: Now code for use control in your page at content as follow:

<My:TextBox ID="mytextbox1" runat="server" />

See here no need to set any property and you get output as follow:


This way you can make any server control to your own control such as linkbutton, Dropdown, checkbox, radiobutton, etc.


Improve Your Answer as comment below.
If our post is useful please share and comment on our post for more post and detail Visit :

http://aspdotnethelpmaster.blogspot.in/

How to create database using

♠ Posted by uvesh in

Create Database by programmatically


 protected void CreatDbBtn_Click(object sender, EventArgs e)
    {
        String str;
        SqlConnection myConn = new SqlConnection(@"Server=HOME\SQLEXPRESS;Integrated security=SSPI;database=master");
        str = "CREATE DATABASE MyDatabase ON PRIMARY " +
            "(NAME = MyDatabase_Data, " +
            "FILENAME = 'D:\\UveshMyDatabaseData.mdf', " +
            "SIZE = 2MB, MAXSIZE = 10MB, FILEGROWTH = 10%) " +
            "LOG ON (NAME = MyDatabase_Log, " +
            "FILENAME = 'D:\\MyDatabaseLog.ldf', " +
            "SIZE = 1MB, " +
            "MAXSIZE = 5MB, " +
            "FILEGROWTH = 10%)";

        SqlCommand myCommand = new SqlCommand(str, myConn);
        try
        {
            myConn.Open();
            myCommand.ExecuteNonQuery();
            Response.Write("DataBase is Created Successfully");

            //MessageBox.Show("DataBase is Created Successfully", "MyProgram", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        catch (System.Exception ex)
        {
            Response.Write(ex.ToString());
            //MessageBox.Show(ex.ToString(), "MyProgram", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        finally
        {
            if (myConn.State == ConnectionState.Open)
            {
                myConn.Close();
            }
        }

    }

Improve Your Answer as comment below.

If our post is useful please share and comment on our post for more post and detail Visit :


http://aspdotnethelpmaster.blogspot.in/

Web Service Definition and when it is use and not to use


What is web service and its use.

Web services 
The Definition Web Service A web service is any part of software that makes available over the network and uses a XML (Full form of XML is Extensible Markup Language (XML) is a markup language in a format which is both human-readable and machine-readable.) format messaging system. XML is used to encode all communications to a web service. Any application which has permission to access service can use service from anywhere. It is platform independent. 

(sometimes called application services) are services (usually including some combination of programming and data, but possibly including human resources as well) that are made available from a business's Web server for Web users or other Web-connected programs. Providers of Web services are generally known as application service providers.

It is based information send-Receive systems that use the by Internet for application (software)-to-application (software) communication. This application can include objects, messages, or documents.

Use Of Web Service

It is system software. Specially design for support machine-to-machine interaction over a local network internet. The basic services supported platform is XML and HTTP or HTTPS. XML can be used between different platforms and programming languages and complex messages and functions. It is help to solve interchangeability by giving your applications a way to integrate their data. For Example your one website is online and you also want to make its android application. That time you need web service so you’re both application work synchronously. You require this because user sometime work on website and some time also use mobile application like android app then user want synchronized own data. For that developer use same service for both platform website application and android application so no need to work for both platforms. 

When Not Use Web Service

when your application no need to synchronize and when more application use only single service because of that more load on server.mostly when service use for operation on database that time overload problem occurs so when number of application use web service which is ping db its problematic to database overhead.

so for database you need to make multiple version of web service so its useful to maintain database overhead.


If our article useful or like to you please share our post.for more detail visit About Web service