Ciao a tutti.
Sono alle prime armi con ASP NET.
Ho creato la mia prima pagina:
Ed un file web.config:codice:<%@ Page Language="VB" %> <script runat="server"> Private Sub Page_Load(sender As Object, e As EventArgs) Messaggio.Text = "La mia prima pagina ASP.NET!" End Sub </script> <html> <head> <title>La mia prima pagina ASP.NET</title> </head> <body> <form id="Modulo" runat="server"> <asp:Label id="Messaggio" runat="server"></asp:Label> </form> </body> </html>
Adesso devo lanciare una semplice query select su una tabella del db mysql m714... ma come si fa? Avete un esempio?codice:<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <!-- DYNAMIC DEBUG COMPILATION Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to false will improve runtime performance of this application. Set compilation debug="true" to insert debugging symbols (.pdb information) into the compiled page. Because this creates a larger file that executes more slowly, you should set this value to true only when debugging and to false at all other times. For more information, refer to the documentation about debugging ASP .NET files. --> <compilation defaultLanguage="c#" debug="true" /> <!-- CUSTOM ERROR MESSAGES Set customError mode values to control the display of user-friendly error messages to users instead of error details (including a stack trace): "On" Always display custom (friendly) messages "Off" Always display detailed ASP.NET error information. "RemoteOnly" Display custom (friendly) messages only to users not running on the local Web server. This setting is recommended for security purposes, so that you do not display application detail information to remote clients. --> <customErrors mode="RemoteOnly" /> <!-- AUTHENTICATION This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", "Passport" and "None" --> <!-- SESSION STATE SETTINGS By default ASP .NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". --> <!-- GLOBALIZATION This section sets the globalization settings of the application. --> <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> </system.web> <appSettings> <!-- SQL Server <add key="AdMentorConnString" value="Provider=sqloledb;Data Source=dbsth8;Initial catalog=fotoalb;User Id=sa;Password=;" /> <add key="AdMentorConnType" value="SQLServer" /> --> <!-- MySQL <add key="AdMentorConnString" value="Driver={MySQL ODBC 3.51 Driver};Server=localhost;Port=3306;Option=131072;Stmt=;Database=admentornet;Uid=root;Pwd=;" /> <add key="AdMentorConnType" value="MySQL" /> --> <!-- Access --> <add key="AdMentorConnString" value="Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=m714; User=root;Password=XXXXX;Option=3;" /> <add key="AdMentorConnType" value="MySQL" /> <!-- ConnType kan vara antingen Access, MySQL or SQLServer --> </appSettings> </configuration>
Grazie!

Rispondi quotando