.Net, ADO.NET, ASP.NET, C#, Database, DB Connection Example, Example Connection, Programming, SQL, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2012, Web Development, WebForms

Basic Example of using the ASP.NET FileUpload to Save into a Database

Here is a super-simple bare-bones example of an ASP.NET Web form page in C# that uses the .NET FileUpload component to allow a user to upload a file into a SQL Server database table. I’ve put this together as a template to show just how easy it is to do and how few lines of actual code the process actually requires. Surprisingly the examples I found online and at the Microsoft support site were incomplete or had errors, so this is my attempt at making things clear. Continue reading “Basic Example of using the ASP.NET FileUpload to Save into a Database”

Advertisement
.Net, ASP.NET, C#, Programming, VB.NET

FormView DataBinding: Safely Detecting FormView Status Based on a TextBox or DropDownList

FormView controls are very useful in rapidly putting together a multi-view Web form. As part of this, dynamically changing the status of the Form between Read, Edit, Insert is an important task.

The catch can be that this can get quirky to do right. and the simplest method is to programmatically trigger an event when a Control in your Form gets rendered or bound to data. The ways of doing so vary depending on the type of control that you are checking. In this example I will take a look at adding an event to the DropDownList and to the TextBox controls. Continue reading “FormView DataBinding: Safely Detecting FormView Status Based on a TextBox or DropDownList”