Leggere un file di testo riga per riga

Pubblicato su
La funzione restituisce un arraylist contenente tutte le righe di testo contenute all'interno del file passato come parametro. public ArrayList ReadLinesFromFile(string FilePath)   {     ArrayList tmpArrayList = new ArrayList();     string line;     // Read the ...
Di più

ASP.Net – File Upload (c#)

Pubblicato su
maschera web form <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>ASP.Net esempio di file upload </title> </head> <body> <form id="form1...
Di più

GRIDVIEW CON FILTRO DINAMICO ASP.NET C#

Pubblicato su
CODICE ASPX <asp:SqlDataSource ID="sorgente" ConnectionString="<%$ ConnectionStrings: northwind %>" SelectCommand="SELECT * FROM Customers" runat="server"> </asp:SqlDataSource> CODE BEHIND protected void Page_Load(object sender, EventArgs e) { //faccio questa operazione solo se l'utente ha fatto il postback in segu...
Di più

Aggiungere un campo a una tabella del DB SQL SERVER

Pubblicato su
//AGGIUNGI UN CAMPO A UNA TABELLA DEL DB public void AddField(String TableName, String NomeCampo, String TipoCampo) { if (myReader != null) myReader.Dispose(); cmd1 = connection.CreateCommand(); using (cmd1 = new SqlCommand("ALTER TABLE [" + TableName + "] ADD [" + NomeCampo + "] " + TipoCampo + " NULL")) { try  catch (SqlExcep...
Di più

Drop Table database SQL Server

Pubblicato su
//drop table public void DropTable(String tName)         {             String sql = "IF OBJECT_ID('" + tName + "') IS NOT NULL DROP TABLE " + tName;             AlterTb(sql); }
Di più

Pulsante Stampa non presente nel controllo ReportViewer

Pubblicato su
Il pulsante di stampa del ReportViewer è un componente ActiveX, pertanto non viene correttamente visualizzato in browser come firefox, chrome, ... Ma non è correttamente gestito nemmeno in IE11. Pertanto, è necessario ricorrere a java script per bypassare il problema. La soluzione trovata consta nel creare un pulsante standard nella pagina aspx <asp:Button ID="PrintButton" runat...
Di più