Home| Progetto| Web| Faq| Acronimi | ||||
Argomenti Documenti pubblicabili:1120
Scripts:1282 Documenti non pubblicabili:162 Categorie tematiche:68 .Net |_C# |_Visual basic.net |_Asp.net Active Server Pages C++ Cascade Style Sheet JavaScript Mysql Php Xml Java |_Java 2 Micro Edition |_Java server pages |_Java Servlet Oracle |_PLSQL PostgreSQL Unix
Asp.net...
Info:
Esecuzione di una pagina aspx
Oracle...
Script:
Dato il nome di una vista ricava informazioni su tipo e attributi della colonna di riferimenti
Unix...
Tip:
Eseguire più comandi in una sola linea
Asp.net...
Tip:
Un solo web form lato server...
Asp.net...
Faq:
Cosa è un Controllo Server (Server Control)?
Shell scripting...
Script:
Script for archiving and compressing folder and file
Un servizio Web XML è un'unità logica di applicazioni che fornisce dati e servizi ad altre applicazioni.
Le applicazioni accedono ai servizi Web XML tramite protocolli Web universali e formati di dati quali HTTP, XML e SOAP.
Php Funzione mail()
La J2EE (Java 2 Enterprise Edition) è dedicata a tutti coloro che desiderano aggiungere il supporto della versione Enterprise di Java (ad esempio a Tomcat) e quindi le funzionalità avanzate come Enterprise JavaBeans etc.
Un servizio Web XML è un'unità logica di applicazioni che fornisce dati e servizi ad altre applicazioni.
Le applicazioni accedono ai servizi Web XML tramite protocolli Web universali e formati di dati quali HTTP, XML e SOAP.
|
Asp.net
Home >Asp.net > Datagrid
ScopeThe aim of this tutorial is to offer you a jump start into using .Net technologies, in particular how to read trough a web form using a datagrid and some C# code.In fact, ASP.NET controls such as datagrid allow developers to design quick aspx pages for simple tasks, but usually time consuming, such query and printing the result of a database query. In this example I will use some C# code and a datagrid control to produce a web page with a simple but stylish results of a Sql query. The compressed file datgrid.zip contains source of the web page and the database. RequirementsTo practice with the following example you need of a web server such as Microsoft Internet Information Server (IIS) running .Net framework. It means that on your local web path you set up a folder such as c:\inetpub\wwwroot\datagrid where it is possible executing an aspx page and reading on Access database. So before beginning, remember you may need to grant these privileges to the aspx page (executing) and Access database (reading).SuggestionsMaybe the best way to learn this tutorial is:
Books tableFirst of all, let's make sure you have the mydatabase.mdb Access file, located somewhere such as c:\inetpub\wwwroot\datagrid, containing the books table with the following columns:
The Missing World, Margot Livesey, 2000 The King is Dead, Jim Lewis, 2003 The books table should look something like this: ![]() Extracting and printing the dataIn c:\inetpub\wwwroot\datgrid the file datagrid.aspx contains all the code we need. To achieve our first task, we need C# function that connects to the database and queries and pass the data to a Web Control.At the top of the page, we need to specify the language used and to import the necessary Namespace (class) containing the OleDb objects we need for database interaction. <%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data.OleDb" %> For any C# aspx page the .Net Framework looks for the start-up function Page_Load() that, in our case, calls the function ScrollData(). <script runat="server">
// Tutorial by Marco Magnani // ©2003 www.fishscript.com // Use this script as you like it void Page_Load(Object sender, EventArgs e) { ScrollData(); } (...) </script> ScrollData() 's duty is to query and to pass the data the Datagrid Web Control, as you can see there is a comment on top of most relevant line of code:
private void ScrollData()
{ //Creation object OleDbConnection OleDbConnection conn = null; OleDbDataReader reader = null; //Construct try/catch //If something goes bad the catch expression will handle try //the catch construct in case connection, query or else goes wrong prints the relative error message finally} Web control datagridAs stated above, in this example, it we use the web control datagrid because it really makes easy publish Sql results in a nice and formatted Html table with some Css style.In fact, for this basic example we just need of the following code:
<asp:DataGrid id="mydatagrid" runat="server"
BorderColor="blue" BorderWidth="1" CellPadding="3" Font-Name="Verdana" Font-Size="8pt" AutoGenerateColumns="true"> <HeaderStyle BackColor="#aaaadd"> </HeaderStyle> </asp:DataGrid> The property BorderColor,BorderWidth,CellPadding, Font-Name="Verdana", Font-Size="8pt" refers to the layout of the datagrid. You may try to change them with different colour, width, font face and size, etc. The property AutoGenerateColumns="true" is true anyway by default, it means that the data grid scrolls of the columns of the queried recordset, otherwise, if you se the value to false you need a control for each column. In this example we simply want all the data easy and quick so we just define the colour of the HeaderStyle and request the page in a browser. The page should look something as this: ![]() Was it quick? Downloads: datgrid.zip ( 10 KB) ![]() Warning: include(ads/text468x15.html): failed to open stream: No such file or directory in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Warning: include(): Failed opening 'ads/text468x15.html' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Tutorial ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Script ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Esercizi ![]() ![]() ![]() Comandi ![]() ![]() ![]() |
Cerca
Asp.net...
Info:
Esecuzione di una pagina aspx
Well-formedness is a new concept introduced by [XML]. Essentially this means that all elements must either have closing tags or be written in a special form (as described below), and that all the elements must nest properly.
Well-formedness is a new concept introduced by [XML]. Essentially this means that all elements must either have closing tags or be written in a special form (as described below), and that all the elements must nest properly.
Asp.net...
Info:
Esecuzione di una pagina aspx
Oracle...
Definizioni:
Set di caratteri (Characterset)
Shell scripting...
Script:
Array in do while construct
fishScript.Com is accessible by Mobile access technology
as mobile phones, Palm and Pocket PC .
Nicoleta e Marco Magnani tutorial, examples, courses, esempi, corsi, esercizi, appunti vari Dottoressa Nicoleta Dragu Formatrice Docente Insegnante Mediatrice Culturale Dott. Marco Magnani Universita La Sapienza Roma Master Computer Science Hunter College New York , Data Base Administrator DBA oracle System architect |