Torna al Thread

Protected Sub conferma1_Click(ByVal sender As Object, ByVal e As System.EventArgs) If (user_ins1.Text = "" Or password_ins1.Text = "" Or cognome_ins.Text = "" Or nome_ins.Text = "" Or cf_ins.Text = "" Or datan_ins.Text = "" Or ind1_ins.Text = "" Or cit1_ins.Text = "" Or tel1_ins.Text = "" Or mail1_ins.Text = "") Then If user_ins1.Text = "" Then effett1.Text = "il campo Utente è obbligatorio" ElseIf password_ins1.Text = "" Then effett1.Text = "il campo Password è obbligatorio" ElseIf cognome_ins.Text = "" Then effett1.Text = "il campo Cognome è obbligatorio" ElseIf nome_ins.Text = "" Then effett1.Text = "il campo Nome è obbligatorio" ElseIf cf_ins.Text = "" Then effett1.Text = "il campo Codice Fiscale è obbligatorio" ElseIf datan_ins.Text = "" Then effett1.Text = "il campo Data è obbligatorio" ElseIf ind1_ins.Text = "" Then effett1.Text = "il campo Indirizzo è obbligatorio" ElseIf cit1_ins.Text = "" Then effett1.Text = "il campo Citta' è obbligatorio" ElseIf tel1_ins.Text = "" Then effett1.Text = "il campo Telefono è obbligatorio" ElseIf mail1_ins.Text = "" Then effett1.Text = "il campo EMail è obbligatorio" End If Else Dim con As New System.Data.OleDb.OleDbConnection("Provider=SQLOLEDB;Data Source=GOMMOSA\SQLEXPRESS;Initial Catalog=MIO_SITO;User ID=sa;Password=saweb") con.Open() Dim com2 As New System.Data.OleDb.OleDbCommand() com2.Connection = con com2.CommandText = "select USER_ID from Utenti" Dim dr1 As System.Data.OleDb.OleDbDataReader dr1 = com2.ExecuteReader() While dr1.Read() If dr1.Item("USER_ID") = user_ins1.Text Then effett1.Text = "USER NAME già in uso" End If End While Dim com As New System.Data.OleDb.OleDbCommand() com.Connection = con com.CommandText = "insert into UTENTI(USER_ID, PASSWORD, COGNOME, NOME, CF, DATA_NASCITA, INDIRIZZO, CITTA, TELEFONO, EMAIL) VALUES(" com.CommandText = com.CommandText + "'" + user_ins1.Text + "', " com.CommandText = com.CommandText + "'" + password_ins1.Text + "', " com.CommandText = com.CommandText + "'" + cognome_ins.Text + "', " com.CommandText = com.CommandText + "'" + nome_ins.Text + "', " com.CommandText = com.CommandText + "'" + cf_ins.Text + "', " com.CommandText = com.CommandText + "'" + datan_ins.Text + "', " com.CommandText = com.CommandText + "'" + ind1_ins.Text + "', " com.CommandText = com.CommandText + "'" + cit1_ins.Text + "', " com.CommandText = com.CommandText + "'" + tel1_ins.Text + "', " com.CommandText = com.CommandText + "'" + mail1_ins.Text + "') " com.ExecuteNonQuery() con.Close() End If Response.Redirect("registrazioneeffettuata.aspx") End Sub Protected Sub home1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Redirect("home.aspx") End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5