C# .NET - can i get some help in converting this VB.Net code into C# code please

Asked By Glenn Boucher on 18-Apr-14 05:28 PM
Dim updateSql As String = _
               "UPDATE tblUsers " & _
               "SET Status = Locked " & _
               "WHERE UserID = @UserID"
Robbe Morris replied to Glenn Boucher on 18-Apr-14 06:32 PM
string updateSql = "update tblUsers set status = Locked where UserID = @UserID";

C# uses a + instead of & to concatenate strings.
Hemanth Kumar replied to Glenn Boucher on 28-Apr-14 05:51 AM

Glenn,


You can convert the code into C# as given below

string updateSql = "UPDATE tblUsers " + "SET Status = Locked " + "WHERE UserID = @UserID";

We have a online tool to convert the VB.NET to c#

http://www.developerfusion.com/tools/convert/vb-to-csharp/?batchId=78229545-6a3f-4da1-9b16-5726629acd9b