Torna al Thread

Protected Sub Btn_InsRouter2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Btn_InsRouter2.Click Dim stringasql As String Dim url As String = String.Empty Dim SQLCmd As New SqlCommand() If Me.Txt_RouterIns.Text = "" Or Me.Txt_IpIns.Text = "" Or Txt_SubMaskIns.Text = "" Then MessageBox(Me, "Errore, i campi Nome, Indirizzo IP e Subnet Mask sono obbligatori !") pulisci_campi() ElseIf Me.Hide_IdRete.Text = "" Then MessageBox(Me, "Errore nell\' applicazione perchè la rete deve essere selezionata !") pulisci_campi() Else stringasql = "INSERT INTO Router (NOMERO, IPROUT, SMASKR, LINPRI, LINBCK, IDRETE, DATINS) " & _ " Values ('" & Replace(Me.Txt_RouterIns.Text, "'", "''") & "', '" & Replace(Me.Txt_IpIns.Text, "'", "''") & "', '" & Replace(Me.Txt_SubMaskIns.Text, "'", "''") & "', " & _ " '" & Replace(Me.Txt_LinPrincIns.Text, "'", "''") & "', '" & Replace(Me.Txt_LinBckIns.Text, "'", "''") & "', " & Nz(Me.Hide_IdRete.Text, 0) & ", getdate())" SQLCmd.Connection = Utilita.GetOpenConnection SQLCmd.CommandText = stringasql SQLCmd.ExecuteNonQuery() GetCloseConnection() MessageBox(Me, "Inserimento effettuato con successo !") dopoinsertrouter() Me.RepeaterRouter.DataSource = SqlDataSourceRouter Me.RepeaterRouter.DataBind() Me.RepeaterRouter.Visible = True End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5