I know, there were NOT much to post throughout last few months about Oracle as I am nose down into one of the development platforms that I hardly desired for developing business applications.
For me, it was always Oracle forms and reports. The easiest, the most robust development tools for BUSINESS applications which is supported by the ease of SQL, PL/SQL
I am doing loads of research with C# & SQL database, which will be the main technologies behind our next proposed ERP suite. After spending almost 15 years with Forms and reports, I don’t see Oracle is too keen about modernizing their most loved development tools & the latest release lacks loads of features those would have helped to reclaim the desktop based business applications.
Wondering whether there is still room for desktop applications, especially for businesses? dude! there is, and there will be!
So stay tuned, I will start posting my “findings” about C#, who knows may be some sample applications using Windows forms or WPF & Oracle database in near future!
We tease each other calling “Google Programmers” occasionally as we just cut and paste code from forums/websites and meet new business requirements and deadlines.
We started revamping our intranet site recently and was frantically looking at a prospective of converting few .asp driven details using .net application(s)
Our primary requirement was to list the content of a folder, along with subdirectories and files (mostly .pdf and .doc/.docx/.xls/.xlsx)
After loads of googling we came across two potential solutions and they were
The first solution was “too” professional approach for guys like us, who hardly have anything more than few hours of experiences with .net programming
The second solution looked more appropriate as we were looking at something which could be easily altered and adopted to our particular requirement.
Hence we copied the scripts available with the link and started altering them, and with our “extreme” level of exposure to the technology, almost after 72 hours we were able to shape up something which fits into our requirements, somehow and we are sharing the same with you.
We know, it could be done much easier or in a simpler manner, well that part we are leaving for the seasoned .net developers.
First create a .aspx file with name “Default” (eg:Default.aspx) and copy the following code inside the file (Notepad++)
<%–ADD A GRIDVIEW WITH FEW COLUMNS–%>
<asp:GridView ID="GridView2" CssClass="grid" GridLines="None" ShowFooter="true"
AllowPaging="true" PageSize="5" AutoGenerateColumns="false"
runat="server">
<%–A LABEL SHOWING NUMBER OF FILES FOUND IN THE FOLDER.–%>
<p><asp:Label Text="" ID="lblMsg" runat="server"></asp:Label></p>
</div>
</form>
</body>
</html>
[/sourcecode]
Now create another file “Default.aspx.cs” and copy the below code inside the file
[sourcecode language=”csharp”]
using System;
using System.IO;
using System.Globalization;
public partial class _Default : System.Web.UI.Page
{
protected void btShowFiles_Click(object sender, EventArgs e)
{
// ViewState["FileType"] = drop1.SelectedValue; // GET THE FILE TYPE.
GetFilesFromFolder();
}
if (listfiles.Length > 0)
{
// BIND THE LIST OF FILES (IF ANY) WITH GRIDVIEW.
GridView1.Visible = true;
GridView1.DataSource = listfiles;
GridView1.DataBind();
Now move both the files to your web application folder. We were using the default “C:\inetpub\wwwroot” for the testing, hence moved the files to there.
Now you can start calling the application like following
Where memos is an actually folder available within “C:\inetpub\wwwroot” path
If you have folders within the “memos” folder, the application will present you view like following
Based on whether you have subfolders within the “memos” folder the application will either display or hide the Folder(s) grid, the same applies to Files grid as well
The best part is, this application can drill down into any level of nested folders and populate folder and file lists as URLs.
We thank A2S from forums.asp.net for helping us to strip out the extensions from filenames. Please refer to the below link for more details.