Monday, August 11, 2014

.NET Windows Application Using VB.NET free vb.net project with source codes

.NET Windows Application Using VB.NET

The following are the projects I have developed as class room projects for VB.NET batches. We start with design and then develop the project and also discuss about deplyoment. Indeed a complete project. However, as some of the screen are given to students as assignments they may not figure in these projects. It means some of the screen and reports may not be available in the project. You are expected to do them on your own.
Since these projects are done in the class room they cannot be comprehensive like real world projects. At the same time they do server as first step and give you an idea about how to develop application using VB.NET using Oracle as the backend.
You can find structure of tables and required stored procedures in text files in the ZIP typically with the names - CRTTAB.SQL and PROCEDURES.SQL.
Software Project Management System
Allows project managers to manage details related to projects,modules, components and elements of projects.
Systems Information
Allows any company or college or institute to maintain the information about computers, peripherals, vendors , softwares and softwares loaded on each computer.
Library Management
A typical library management software. Allows users to store details of members, books, issues and returns.
Software Tracker
Allows user to keep track of softwares that are available in different CDs. This allows user to store details of CDs, Sofwares etc. so that user can easily get information about which software is in which CD.
Sales Management System
Computerizes all steps right from customers placing an order to dispatching goods to customer and receipt of cheque.
Video Library System
Allows any video library to store details of members, cds and issues.
Students Information System
Stores information about courses, batches, students and payments.
Online Examination
Allows user to take exam on any of the available subjects.
Customer Support System
Stores details of complaints made by customers. Generates reports related to complaints and other important entities in a typical customer support system.
CD Library
Allows you to manage software CDs collection one has. It allows you to add new CDs, delete and search for softwares in CDs.
Finance Management
Allows you to store details of income and expenditure.
Institute Maintenance
Automates front-office operations of a typical training institute.
Fixed Deposits Maintenance
Stores details of all fixed deposits a person or a small company has. It allows you to generate reports related to deposits.
Chits Management
Computerizes daily operartions of a chit company. Operations such as bids, payment by members etc are handled.
Books Management
Keeps track of an individual's personal library. Allows you to quickly search of books on a topic etc.
Cricket Statistics
Stores details of matches, players and other statistics.
Personal Accounting System
Allows all financial operations of an individual to be computerized.
School Management
Manages all transaction related to a typical school.

ASP.NET Projects Developed In Classroom

ASP.NET Projects Developed In Classroom

The following is the list of projects developed in the recent .NET batches. For each project, complete source code and other relevant instructions are provided.

Friday, October 19, 2012

Download C# .net, asp .net Web and Desktop Application Project Source code

System.InvalidOperationException-- Maximum length exceeded

System.InvalidOperationException-- Maximum length exceeded

Problem

You get following error when you use javascript to call Web Methods defined in Web Service file(ASMX). This usually happens when you are using ASP.Net AJAX framework.
The server method failed with the following error: System.InvalidOperationException-- Maximum length exceeded.
Everything works fine until the web service returns a larger number of objects.

Solution

Go to your Web.Config file. Add following sections if they don't exist under <configuration>
01.<configuration>
02.<configSections>
03.<sectionGroup name="system.web.extensions"
04.type="System.Web.Configuration.SystemWebExtensionsSectionGroup, 
05.System.Web.Extensions, Version=1.0.61025.0, Culture=neutral
06.PublicKeyToken=31bf3856ad364e35">
07.<sectionGroup name="scripting"
08.type="System.Web.Configuration.ScriptingSectionGroup, 
09.System.Web.Extensions, Version=1.0.61025.0, Culture=neutral
10.PublicKeyToken=31bf3856ad364e35">
11.<section name="scriptResourceHandler"
12.type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, 
13.System.Web.Extensions, Version=1.0.61025.0, 
14.Culture=neutral, PublicKeyToken=31bf3856ad364e35"
15.requirePermission="false"
16.allowDefinition="MachineToApplication"/>
17.<sectionGroup name="webServices"
18.type="System.Web.Configuration.ScriptingWebServicesSectionGroup, 
19.System.Web.Extensions, Version=1.0.61025.0, 
20.Culture=neutral, PublicKeyToken=31bf3856ad364e35">
21.<section name="jsonSerialization"
22.type="System.Web.Configuration.ScriptingJsonSerializationSection, 
23.System.Web.Extensions, Version=1.0.61025.0, 
24.Culture=neutral, PublicKeyToken=31bf3856ad364e35"
25.requirePermission="false" allowDefinition="Everywhere" />
26.<section name="profileService"
27.type="System.Web.Configuration.ScriptingProfileServiceSection, 
28.System.Web.Extensions, Version=1.0.61025.0, 
29.Culture=neutral, PublicKeyToken=31bf3856ad364e35"
30.requirePermission="false"
31.allowDefinition="MachineToApplication" />
32.<section name="authenticationService"
33.type="System.Web.Configuration.ScriptingAuthenticationServiceSection, 
34.System.Web.Extensions, Version=1.0.61025.0, 
35.Culture=neutral, PublicKeyToken=31bf3856ad364e35"
36.requirePermission="false"
37.allowDefinition="MachineToApplication" />
38.</sectionGroup>
39.</sectionGroup>
40.</sectionGroup>
41.</configSections>
42.<system.web.extensions>
43.<scripting>
44.<webServices>
45.<jsonSerialization maxJsonLength="5000000">
46.<converters>
47.</converters>
48.</jsonSerialization>
49.</scripting>
50.</system.web.extensions>
51.</configuration>
As you can see above I have set maxJsonLength="5000000" in jsonSerialization section. This solves maximum length exceeded error.

Cause

When you call ASP.Net Web Methods from javascript, it uses serialization and de-serialization of returned objects. Serialization converts .Net objects to XML format.When this XML data length exceeds default limit of serialization, ASP.Net throws this error. To prevent this error you should make sure that returned object does not generate large XML data. If it's not possible to decrease data, you can use above solution to fix it. But this may slow down ASP.Net application as it has to transmit so much of data for each call.

Server Application Unavailable Error

Server Application Unavailable Error

Problem

I have installed IIS 5.1 on my machine ,it works allright for asp pages but when I try to access .aspx pages it throws out following error,

"Server Application Unavailable"

Even when have a look at event viewer I find the following response.

aspnet_wp.exe could not be launched because the username and/or password supplied in the processModel section of the config file are invalid.

Solution

You should check following,

(1) Go to your website properties in IIS by right clicking on it. Make sure ASP.Net version is 2.0 or whatever you are using.

(2) Navigate to your website folder from windows explorer. Right click on this folder and open properties. Go to Security tab and see if there are read permissions for following accounts
(a) [Your Machine Name]\ASPNet (b) Network Service (c) IUSR_[YourMahineName]

One of these accounts is used for running ASP.Net process. If these accounts do not have read access to your website folder. You will get this error.

(3) Make sure that you have installed IIS first and then .Net Framework. If you have installed in reverse order, run following command from the directory where .Net Framework is installed. In my case it is,

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

This will install .Net Framework again. -i switch is for installation.

After installing .Net Framework check step (1) again.

Cannot convert type ASP.login_aspx to System.Web.UI.WebControls.Login

Cannot convert type ASP.login_aspx to System.Web.UI.WebControls.Login

Problem

You get following error when you run ASP.Net login page
1.Cannot convert type ASP.login_aspx to System.Web.UI.WebControls.Login

Solution


  • Go to your login.aspx.cs code behind file.
  • Find line where page class is defined.
    1.public partial class Login : System.Web.UI.Page
  • Rename this class to something else. For example,
    1.public partial class clsLogin : System.Web.UI.Page
  • Now go to your webform code in login.aspx file. And change inherit attribute to point to clsLogin class.
    1.<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true"
    2.CodeFile="Login.aspx.cs" Inherits="Login" %>

    Change this to,
    1.<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true"
    2.CodeFile="Login.aspx.cs" Inherits="clsLogin" %>
Note how Inherits="Login" is changed to Inherits="clsLogin" above

This should solve your problem

Cause

Login is treated as a reserve word in ASP.Net. If you use it for your class name, it conflicts with existing ASP.Net Login class.

Online Stock Streaming using ASP.Net

Online Stock Streaming using ASP.Net


Online Stock Streaming

Introduction

It always made me wonder how sites like http://finance.yahoo.com and http://finance.google.com display stock quotes online so quickly and without refreshing entire page. So I decided to implement something similar. It looks very difficult to implement these kind of streaming, but ASP.Net and it's feature rich AJAX controls makes it really simple to implement this. This is my first attempt to build similar streaming web page. This sample may sound fairly easy to you and some of you might think that everyone knows this. But it might provide a good base for those who wants to build similar web sites and still have no idea where to start.

Using Code

Sample code provided in this article includes a web page Default.aspx and Default.aspx.cs code behind.
Default.aspx (UI)
UI code is fairly simple. First component is Script Manager. This component is necessary for AJAX functionality. After Script Manager, next component is UpdatePanel. This ajax control stops ASP.Net page from posting back. Instead of posting back page, it sends control inputs to server using client side javascripts. When it receives response from server, it refreshes content inside it on client side. Next control is an AJAX timer control. It rebinds grid with new quotes every 2 seconds.
Default.aspx.cs (Code Behind)
01.DataTable GetGridData()
02.{
03.DataTable DT = new DataTable();
04.DT.Columns.Add("Symbol",typeof(string));
05.DT.Columns.Add("Company Name",typeof(string));
06.DT.Columns.Add("LastTrade", typeof(float));
07.DT.Columns.Add("Bid", typeof(float));
08.DT.Columns.Add("Ask", typeof(float));
09.DT.Columns.Add("Volume", typeof(int));
10.DT.Columns.Add("Market Capital", typeof(string));
11.DT.Columns.Add("EPS", typeof(float));
12.DT.Columns.Add("P/E", typeof(float));
13. 
14.Random r = new Random();
15. 
16.//Apple
17. 
18.//Get a random value of last trade, bid, ask and volume.
19. 
20.float LastTrade = ((float)r.Next(17222,17434))/100;
21.float Bid = LastTrade - (float)0.34;
22.float Ask = LastTrade + (float)0.43;
23.int Volume = r.Next(23000000, 23600000);
24.DT.Rows.Add("AAPL", "Apple Inc.", LastTrade, Bid, Ask,
25.Volume, "153.88B", 3.93, 44.71);
26. 
27.//Microsoft
28. 
29.LastTrade = ((float)r.Next(3378, 3487)) / 100;
30.Bid = LastTrade - (float)0.34;
31.Ask = LastTrade + (float)0.43;
32.Volume = r.Next(38064903, 40075689);
33.DT.Rows.Add("MSFT", "Microsoft Corporation", LastTrade,
34.Bid, Ask, Volume, "153.88B", 2.13, 21.2);
35. 
36.//Yahoo
37. 
38.LastTrade = ((float)r.Next(2520, 2834)) / 100;
39.Bid = LastTrade - (float)0.34;
40.Ask = LastTrade + (float)0.43;
41.Volume = r.Next(14400000, 15500000);
42.DT.Rows.Add("YHOO", "Yahoo Inc.", LastTrade, Bid, Ask,
43.Volume, "34.48B", 1.42, 10.23);
44. 
45.//Google
46. 
47.LastTrade = ((float)r.Next(67025, 69000)) / 100;
48.Bid = LastTrade - (float)5;
49.Ask = LastTrade + (float)5;
50.Volume = r.Next(4500000, 5000000);
51.DT.Rows.Add("GOOG", "Google Inc.", LastTrade, Bid, Ask,
52.Volume, "213.73B", 12.42, 53.23);
53. 
54.//WYNN
55. 
56.LastTrade = ((float)r.Next(13249, 14022)) / 100;
57.Bid = LastTrade - (float)0.90;
58.Ask = LastTrade + (float)0.89;
59.Volume = r.Next(1222785, 1400000);
60.DT.Rows.Add("WYNN", "Wynn Resorts Ltd.", LastTrade, Bid, Ask,
61.Volume, "15.13B",1.81, 73.15);
62. 
63.return DT;
64.}
65. 
GetGridData() function simulates quotes for different stock symbols. Instead of simulated data you can replace this function to fetch real time quotes from other sources. This function builds a data table using random quotes and returns it.
1.protected void Timer1_Tick(object sender, EventArgs e)
2.{
3.//Bind grid view
4.GridView1.DataSource = GetGridData();
5. 
6.GridView1.DataBind();
7.}
Timer1_Tick() function is a timer function which executes every 2 seconds. It rebinds grid with simulated stock data.

Points of Interest

As you can see here, I am using a simulation for stock quotes. It would be interesting to know how can we fetch real time quotes from Yahoo/Google or any other source.
These are few links I have found which discusses this,
http://tutorials.programmingsite.co.uk/yahoocsv.php
http://asp.programmershelp.co.uk/xmlstock1.php
http://www.webdeveloper.com/forum/archive/index.php/t-6821.html

http://aspalliance.com/articleViewer.aspx?aId=112&pId=