Torna al Thread

Protected Sub gw_Arrivati_Oggi_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gw_Arrivati_Oggi.RowCommand If (e.CommandName = "Update") Then Dim c As Control = CType(e.CommandSource, Control) Dim d As DropDownList = CType(c.NamingContainer, DropDownList) Dim Albergo As iAlbergo Albergo = CType(Session("Albergo"), iAlbergo) Try Dim conString = ConfigurationManager.ConnectionStrings("DB_GESTIONE_ALBERGHI") Dim strConnString As String = conString.ConnectionString Using db As New SqlConnection(strConnString) db.Open() Using sqlcmd As New SqlCommand("Get_Esenzione_categoria", db) sqlcmd.CommandType = CommandType.StoredProcedure sqlcmd.Parameters.AddWithValue("@codalbergo", SqlDbType.Int).Value = Albergo.CodAlbergo sqlcmd.Parameters.AddWithValue("@esente_imposta", SqlDbType.Int).Value = d.SelectedValue sqlcmd.ExecuteNonQuery() End Using End Using Catch ex As SqlException ScriptManager.RegisterStartupScript(Me, Me.GetType, "Errore", ex.Message, True) Catch ex As Exception ScriptManager.RegisterStartupScript(Me, Me.GetType, "Errore", ex.Message, True) End Try End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5