Torna al Thread

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim cnn As New SqlConnection Dim Reader As SqlDataReader Dim cmd As New SqlCommand Dim strSQL As String Dim id_elemento As String If Not IsPostBack Then strSQL = "SELECT TestiHome.* " & _ "FROM TestiHome " & _ "WHERE Sezione = 'TestoCentrale'" cnn.ConnectionString = "... Tua Connessione ..." cnn.Open() cmd.Connection = cnn.strConnection() cmd.CommandText = strSQL Reader = cmd.ExecuteReader() If Reader.Read() txtTestoCentraleText = Reader.Item("DescrizioneSezione").ToString() End if Reader.Close() cmd.Dispose() cnn.Close() cnn.Dispose() End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5