I got a code in vb.net for preparing user privileges, I want to convert to c#.
this is my code.
Public Shared Function GetMenueRights(ByVal mUsername As String, ByVal mTitle As String) As Boolean
Dim myConnection As SqlConnection = New SqlConnection(GetConnectionString)
Dim myCommand As SqlCommand
Dim myReader As SqlDataReader
myCommand = New SqlCommand("SELECT mr_user FROM MenuRights WHERE mr_user ='" & mUsername & "' AND mr_menutitle ='" & mTitle & "'", myConnection)
myConnection.Open()
myReader = myCommand.ExecuteReader
myReader.Read()
If myReader.HasRows = True Then
GetMenueRights = True
Else
GetMenueRights = False
End If
myConnection.Close()
End Function
Please help me.
Rathnayake