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:
Check if database is running on Rac or Exclusive via plsql dbms_utility
Unix...
Tip:
How remove a file named -r
Asp.net...
Tip:
Un solo web form lato server...
Asp.net...
Faq:
Cosa è un Controllo Server (Server Control)?
Shell scripting...
Script:
Hide user input on screen
La rabbia è creativa, la depressione è senza utilità
Dyson, Freeman J.
Php Funzione mail()
Charles Babbage(1791-1871) nel 1823 ottenne dal governo 100 Sterline per la costruzione del calcolatore Different Engine.
La rabbia è creativa, la depressione è senza utilità
Dyson, Freeman J.
|
Asp.net
Home >Asp.net > Web controls and C# Sharp (Part I)
ScopeThis tutorial is meant to give you a jump start into using .Net technologies, in particular how to read and write data trough a web form and some C# code.The practical aim is writing a simple web page that allows to read and save data the entry for our on line bookstore in a Microsoft Access database. The compressed file bookstore.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\bookstore where it is possible executing an aspx page and reading and writing Access database. So before to start remember you may need to grant this privileges to the aspx page (executing) and Access database (reading and writing).SuggestionsMaybe the best way to learn this tutorial is:
Guestbook tableFirst of all, let’s make sure you have the mydatabase.mdb Access file, located somewhere such as c:\inetpub\wwwroot\bookstore, 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\bookstore the file list_insert_books.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" %> The page includes also a style sheet file, also provided in the zip file:
<link rel="stylesheet" type="text/css" href="somestyle.css" />
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 // ©2004 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 Repeater Web Control:
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 RepeaterIn this example, it we use the web control Repeater becouse is very flexible and easy implemented with html and Css.In fact, the last lines of ScrollData code referring to a Repeater Web Control defined by the following code:
<asp:Repeater ID= "myrepeater" Runat= "server">
</asp:Repeater> The property SeparatorTemplate allows to define the html output between the items (the data rows). The property ItemTemplate through the databinding of the columns of displays each row within a <div class="Item">. The Css class Item is defined in the included file somestyle.css. Anyhow, the core Asp.net tag is <%# DataBinder.Eval(Container.DataItem, column name) %>: it prints the data retrieved by the c# function ScrollData(). Since we manually inserted some rows the page should display an output as following: The King is Dead
Jim Lewis,2003
€:9 ***** The Missing World, Margot Livesey,2000
€:12 If you did not get any errors, you are ready to move to the second part Web controls and C# Sharp (Part II) saving data in an Access database using a web form . Dott. Marco Magnani DBA 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
Il web è un giovane media: infatti ha solo 10 anni di età.
Si pensi alla televisione o al cinema all'età di 10 anni. A quei tempi questi media erano primitivi, ancora alla ricerca della loro strada.
Venivano esplorati i limiti della nuova tecnologia, ma grandi progressi dovevano ancora essere raggiunti.
Oggi, i professionisti del web si trovano nella stessa fase. Sono pionieri che stanno ancora esplorando i limiti del nuovo media. Senza dubbio, i nostri nipoti, quando vedranno quello che abbiamo fatto pensaranno a qualcosa di elementare.
C'è ancora molto da scopire su quello che il Web può fare e suo come può essere utilizzato.
Jason Foss
Il web è un giovane media: infatti ha solo 10 anni di età.
Si pensi alla televisione o al cinema all'età di 10 anni. A quei tempi questi media erano primitivi, ancora alla ricerca della loro strada.
Venivano esplorati i limiti della nuova tecnologia, ma grandi progressi dovevano ancora essere raggiunti.
Oggi, i professionisti del web si trovano nella stessa fase. Sono pionieri che stanno ancora esplorando i limiti del nuovo media. Senza dubbio, i nostri nipoti, quando vedranno quello che abbiamo fatto pensaranno a qualcosa di elementare.
C'è ancora molto da scopire su quello che il Web può fare e suo come può essere utilizzato.
Jason Foss
Asp.net...
Info:
Esecuzione di una pagina aspx
Oracle...
Definizioni:
Variabile bind
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 |