In this article I will explain how we can save and retrieve files from Windows Folder and Directory and display them in ASP.Net GridView control with download and delete option. HTML Markup Below is the HTML Markup of the page, where I have an ASP.Net control FileUpload to upload files, a Buttoncontrol to trigger file uploads and an ASP.Net GridViewcontrol to display the files from folder. <asp:GridView ID=”GridView1″ runat=”server” AutoGenerateColumns=”false” EmptyDataText=”No files uploaded”> <Columns> <asp:BoundField DataField=”Text” HeaderText=”File Name” /> <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID=”lnkDownload” Text=”Download” CommandArgument='<%# Eval(“Value”) %>’ runat=”server” OnClick=”DownloadFile”></asp:LinkButton>…
Category: Uncategorized
How to create simple Background Agent in Windows Phone
This article provides a minimal example on how to create Background Agents (Tasks) in Windows Phone. There is a more comprehensive example on Dev Center How to implement background agents for Windows Phone. Introduction Windows Phone apps are made dormant when running in the background or when the phone is locked (to conserve device memory and battery life). If your application needs to perform processing when it is (may be) in the background you can use a background agent to run activities according to some schedule. Background agents are…
Checking the Internet connection type on Windows Phone
All Windows Phone applications that use Internet data should always check if there is a valid Internet connection; if there is no connection, a proper message should be displayed to the user. The correct way to check if you have an Internet connection (WIFI, Ethernet, or none) is by checking the property: NetworkInterface.NetworkInterfaceType Unfortunately checking this property is a synchronous operation, so calling it in the UI thread can block the UI for many seconds. If your application relies on a specific server you might be tempted to simply check…
Add Rows to a DataTable
To add new records into a dataset, a new data row must be created and added to the DataRow collection (Rows) of a DataTable in the dataset. The following procedures show how to create a new row and insert it into a DataTable. Examples are provided for both typed and untyped datasets. I created this Dataset (view picture). dsOperation dt = new dsOperation(); DataRow opRow = dt.Tables[“Operations”].NewRow(); opRow[“Group”] = “FirstGroup”; opRow[“SubGroup”] = “SecondGroup”; opRow[“Debit”] = 0; opRow[“Credit”] = 10; dt.Tables[0].Rows.Add(opRow);
Create a File or Folder
// Specify a name for your top-level folder. string folderName = @”c:\Top-Level Folder”; // To create a string that specifies the path to a subfolder under your // top-level folder, add a name for the subfolder to folderName. string pathString = System.IO.Path.Combine(folderName, “SubFolder”); // You can write out the path name directly instead of using the Combine // method. Combine just makes the process easier. string pathString2 = @”c:\Top-Level Folder\SubFolder2″; // You can extend the depth of your path if you…
Come reinizializzare, reimpostare o ripristinare il PC
Se hai problemi con il PC, puoi provare a reinizializzarlo, reimpostarlo o ripristinarlo. La reinizializzazione del PC comporta la reinstallazione di Windows mantenendo le tue impostazioni e i tuoi file personali, nonché le app fornite con il PC e le app installate da Windows Store. La reimpostazione del PC comporta la reinstallazione di Windows, con l’eliminazione di file, impostazioni e app, ad eccezione delle app fornite con il PC. Il ripristino del PC consente di annullare le modifiche apportate recentemente al sistema. Se vuoi eseguire il backup e il ripristino…
Use a reuseIdentifier Where Appropriate
A common mistake in app development is not setting the correct reuseIdentifier for UITableViewCells, for UICollectionViewCells, or even UITableViewHeaderFooterViews. For maximum performance, a table view’€™s data source should generally reuse UITableViewCell objects when it assigns cells to rows in tableView:cellForRowAtIndexPath:. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse.What happens if you don’t use a reuseIdentifier? If you don’t, your table view will configure a brand-new cell each time a row is displayed. This is an expensive operation and will…
Building of an organizational chart for AdventureWorks & AdventureWorks2008
— SQL recursive CTE to find subordinates of executive, manager & supervisor– Tree processing – find all descendants – find children – self-referencing tableDECLARE @EmployeeID INT SET @EmployeeID = 109 USE AdventureWorks; WITH cteEmployeeName AS (SELECT FullName = FirstName + ‘ ‘ + LastName, EmployeeID FROM HumanResources.Employee e INNER JOIN Person.Contact c ON e.ContactID = c.ContactID), cteSubordinates AS (SELECT EmployeeID, LEVEL = 0 FROM HumanResources.Employee WHERE EmployeeID = @EmployeeID UNION ALL SELECT e.EmployeeID, LEVEL + 1 FROM cteSubordinates cte INNER JOIN HumanResources.Employee e ON cte.EmployeeID = e.ManagerID) SELECT FullName, s.EmployeeID,…