The purpose of this blog is to show you the bare bones of ASP.NET. Often times when you search for a tutorial on the web you see that the tutorials are way too complex or an overkill of what you are trying to do at that moment. So the in this blog series I want to cut through all the fat and just show you how to get things done quickly. The best way to start an ASP.NET web application is to create an empty project. In this tutorial I will show you how to create an empty web application project in Visual Studio 2012. You can download Visual Studio 2012 at http://www.microsoft.com/visualstudio/eng/downloads#d-2012-editions you can get a 90 trial by registering with microsoft.com. Another alternative is to download the free Visual Studio Express version at http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express Here are the steps to create an empty web application project in Visual Studio 2012 1. Open Visual Studio 2012 2. Click on "File", t...
SQL GROUPING allows you to segregate data into groups so that you can work on it separately from the rest of the table records. Let's say you want to get the number of products in a category in the Northwind database Products table. You would write the following query: SELECT COUNT(*) NumberOfProductsByCategory FROM Products GROUP BY CategoryID The query above gives you the following results: The query gives you the number of products in each category, however it's not very useful. You don't really know what category the count is for in each record. You might want to try to change the query into something like this: SELECT CategoryID,COUNT(*) NumberOfProductsByCategory FROM Products GROUP BY CategoryID The above query is more useful the preceding one, however it only gives you the CategoryID number not the CategoryName in the Categories table. Being the perfectionist that you are you say to yourself, I can do better. "Yes, I can". I think that was a ca...
In this blog we will go over how to query an Oracle database in ASP.NET using the System.Data.OracleClient data provider in C#. Namespaces: using System.Web.Configuration; using System.Data.OracleClient; using System.Data; string cs = WebConfigurationManager.ConnectionStrings["SomeConnectionString"].ConnectionString; using (OracleConnection oc = new OracleConnection(cs)) { oc.Open(); DataTable dt = new DataTable(); OracleCommand ocmd = new OracleCommand("SELECT * FROM SOMETABLE", oc); OracleDataAdapter oda = new OracleDataAdapter(ocmd); oda.Fill(dt); GridView1.DataSource = dt; GridView1.DataBind(); }
Comments
Post a Comment