Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Aggiornare dei record di una tabella


<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script language="VB" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
  Dim cnn As New SQLConnection("server=DBSERVER;User id=USER;password=PASSWORD;database=DB")
  Dim UpdateCommand As SqlCommand = New SqlCommand()
  UpdateCommand.Connection = cnn
  Dim sql As String
  sql = "Update TABELLA Set CAMPO = 'VALORE' WHERE ID = ID"
  UpdateCommand.CommandText = sql
  Try
    cnn.Open()
    UpdateCommand.ExecuteNonQuery()
  Catch ex As Exception
    Response.Write(ex.ToString())
  Finally
    cnn.Close()
  End Try
End sub
</script>



Scarica il Codice...


Stampa la pagina


 


Inizio pagina

risorse per webmaster