Перевести код с C# - Visual Basic .NET
Формулировка задачи:
Здравствуйте! Пишу программуи не могу разобраться как переделать этот код под Visual Basic
Я конечно понимаю,что они похожи,но все же.
Решение задачи: «Перевести код с C#»
textual
Листинг программы
Private Sub button2_Click(sender As Object, e As EventArgs)
Dim count As Integer = 0
Using connection As New SqlConnection("Data Source=prodenis\SQLEXPRESS;AttachDbFilename=|DataDirectory|\db_APM.mdf;Integrated Security=True;user Instance=True")
Using command As New SqlCommand("select * from [user] where user=user and password=password", connection)
command.Parameters.AddWithValue("user", textBox1.Text)
command.Parameters.AddWithValue("password", textBox2.Text)
connection.Open()
Using reader As SqlDataReader = command.ExecuteReader()
While reader.Read()
count += 1
End While
End Using
connection.Close()
End Using
If count = 0 Then
MessageBox.Show("Пароль неверен!")
Return
End If
Me.Hide()
Dim frm2 As New APM()
frm2.Show()
End Using
End Sub