There is no way to directly convert that to C#.
SELECT 3
FoxPro has the concept of 'work areas' - like slots, each of which can have an opened DBF file in it. This command says "OK - we're looking at work area 3."
This has no equivalent in .NET
USE student SHARED
This will open student.dbf, in the current directory, for shared access in work area 3.
SET FILTER TO
If we have a filter set, which will limit what records are available, clear that filter now. Pointless, as we've just opened the table and we didn't set a filter.
LOCATE FOR id=thisform.txtStudentID.Value
Find the first record where id = thisform.txtStudentID.Value. The latter part is a custom property of the form that is running this code.
So all this code is doing is locating a record in student.dbf based on a value. If you wanted to pull that record back in C# using the OLE DB provider you could check How to load DBF data into a DataTable.