I have a small application in VB2017, but I decided to buy VB2022

manny cash

Active member
Joined
Oct 19, 2024
Messages
43
Programming Experience
Beginner
I have 7 small Appication in VB 2017 and all of them are working good with your help. I decide to tests VB 2022 and I transferred a small snipet to vb2022 and all of them are working good.
Last night, I created a small snippet database in SQL, a copy of my 2017 VB.NET compiler. Data entry program. Suddenly, a button appears on my screen telling me to upgrade my new VB.NET 2022.
It upgraded my VB.NET with something git Hum, and now my compiler 2022 does not recognize my SQL connection and says it is obsolete. So I am confused why the SQL connection is obsolete.
Here is a little code that shows the connection is no good anymore

Private Sub BtnAdd_Click(sender As Object, e As EventArgs) Handles BtnAdd.Click
Dim query As String = "INSERT INTO Citas1 (ID, Company, Contacts, _
Telephone, Address, Email, _AppoDate, AppoTime, Matters, Solutions) VALUES (@ID, _
@Company, @Contacts, @Telephone, @Address, @Email, @AppoDate, @AppoTime, @Matters, @Solutions)"
Dim command As New SqlCommand(query, connection)
command.Parameters.AddWithValue("@ID", TxtID.Text)
command.Parameters.AddWithValue("@Company", TxtCompany.Text)
command.Parameters.AddWithValue("@Contacts", TxtContacts.Text)
command.Parameters.AddWithValue("@Telephone", TxtTelephone.Text)
command.Parameters.AddWithValue("@Address", TxtAddress.Text)
command.Parameters.AddWithValue("@Email", TxtEmail.Text)
command.Parameters.AddWithValue("@AppoDate", TxtAppoDate.Text)
command.Parameters.AddWithValue("@AppoTime", TxtAppoTime.Text)
command.Parameters.AddWithValue("@Matters", TxtMatters.Text)
command.Parameters.AddWithValue("@Solutions", TxtSolutions.Text)

connection.Open()
command.ExecuteNonQuery()
connection.Close()
LoadData()

' Hide btbSave Click Event
BtnSave.Visible = False ' Hides the target button
End Sub

Thank you guys, and my beautiful community, VB.NET Developer Community.
 
Back
Top