Torna al Thread

Dim source7 As String = WebConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Dim sql7 As String = "SELECT Codfisc, Dal, Al FROM Ferie WHERE ((Codfisc=@Codfisc) AND ((@Dal>=Dal AND @Dal<=Al) OR (@Al>=Dal AND @Al<=Al) OR (@Dal<=Dal AND @Al>=Al)))" Dim conn7 As New SqlConnection(source7) conn7.Open() Dim cmd7 As New SqlCommand(sql7, conn7) cmd7.Parameters.Add("@CodfisclDbType.VarChar, 16).Value = HiddenField1.Value cmd7.Parameters.Add("@DalSqSqlDbType.Date).Value = TextBox1.Text cmd7.Parameters.Add("@AlSqSqlDbType.Date).Value = TextBox2.Text Dim dr7 As SqlDataReader dr7 = cmd7.ExecuteReader() If dr7.Read() Then ClientScript.RegisterStartupScript(Me.GetType(), "AlertScript", "alert('Periodo già inserito!');", True) conn7.Close() Return End If
Copyright © 2002-2023
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5