Category Archives: C# 3.5

How to close all windows upon signout?

This solution might not be the exact solution to close all open windows, but it does close all windows upon clicking sign out. First, you need to create a sign out button on your master page. Then put this code … Continue reading

Posted in ASP.NET 3.5, ASP.NET 3.5 And C# 3.5, ASP.NET 3.5 And JavaScript, C# 3.5, JavaScript | Leave a comment

How to do multiple popup window using ASP.NET 3.5 and AJAX Control and Javascript?

There are three ways to popup a new window. The first way to do popup window, this.lnkNewWindow.Attributes.Add(“onclick”, “window.open(‘NewWindow.aspx’, ‘NewWindow’, ‘toolbar=no, menubar=no, directories=no, resizable=yes, scrollbar=yes’);return false;”); this the second way to do popup window, <asp:LinkButton ID=”lnkNewWindow” runat=”server” Text=”New Window” onclick=”javascript:openNewWindow();” /> Put … Continue reading

Posted in ASP.NET 3.5 And JavaScript, C# 3.5, C# 3.5 AND ASP.NET 3.5, JavaScript | Leave a comment

How to extract data from site?

Web scraping (also called Web harvesting or Web data extraction) is a computer software technique of extracting information from websites. Here is the code that extract the content of a specific site, WebClient wc = new WebClient(); string html = … Continue reading

Posted in C# 3.5 | Leave a comment

How to upload and download files thru FTP Server?

How to upload and download files thru FTP Server? I have use several references in creating this window application. I have somehow simplified it and extract codes from the references that I have used. There is only three buttons, they … Continue reading

Posted in C# 3.5, FTP Server | Leave a comment

How to create simple dynamic window form application?

I have created a window form that will generate two textbox, one combobox, one datepicker, and four label. This form does not connect to any database. The purpose of this application is to show how to create controls at runtime. … Continue reading

Posted in C# 3.5, Visual Studio 2008 | Leave a comment

How to create code generator for your data objects, data access layer and business access layer?

This post of mine shows how I create DAL, BAL, Data entity objects, interface. This code generator will generate code for this .cs file. First, this is how it looks like when you are creating DAL, Second, this is how … Continue reading

Posted in ASP.NET 3.5, ASP.NET 3.5 And C# 3.5, C# 3.5, C# 3.5 and ADO.NET Entity Framework 3.5 | Leave a comment

How to insert audio file into SQL Server and retrieve it back and play it?

This is how the form looks like. This is the source code, This is the code for inserting audio file into sql server, SqlConnection con = new SqlConnection(“Data Source=DEV-ARNOLD;Initial Catalog=Sample;User ID=sa;Password=passw0rd”); SqlCommand com = new SqlCommand(“insert into tblVoice(FileName, FilePath, fldvoice) … Continue reading

Posted in C# 3.5 | Leave a comment

How to determine which form is open?

You wish to determine which form is open. Here is the code that will determine whether the form is open or not. PDFViewer viewer = null; foreach (Form OpenForm in Application.OpenForms) { if (OpenForm.GetType() == typeof(PDFViewer)) { viewer = (PDFViewer)OpenForm; … Continue reading

Posted in C# 3.5 | Leave a comment

How to apply CRUD and linq to entity on gridview using ASP.Net 3.5?

Before you start, you need the following software or installer: Visual Studio 2008 Professional Edition/ Team System Edition Visual Studio 2008 Service Pack 1 .NET Framework 3.5 .NET Framework 3.5 Service Pack 1 Windows 7 or Windows XP You need … Continue reading

Posted in ASP.NET 3.5, ASP.NET 3.5 And C# 3.5, C# 3.5, C# 3.5 and ADO.NET Entity Framework 3.5, Linq to Entity | Leave a comment

How to use comparevalidator to compare date in ASP.NET 3.5?

In designer, <asp:CompareValidator ID=”cvReturnDate” runat=”server”                             ControlToValidate=”txtReturnDate”                             ErrorMessage=”Return date must be valid date.” Type=”Date”                             ValidationGroup=”validateInquiry” >*</asp:CompareValidator> In Code,                     this.cvReturnDate.Operator = ValidationCompareOperator.GreaterThan;                     this.cvReturnDate.ValueToCompare = DateTime.Now.ToShortDateString(); or you just want to check if it is a date, the … Continue reading

Posted in ASP.NET 3.5, ASP.NET 3.5 And C# 3.5, C# 3.5 | Leave a comment