C# - After converting to a Project from VB.net to C#.net a functions isn't building.
Posted on 2006-05-04
I converted a project from VB.net to C#.
I have this function which built and works fine in VB.Net but won't build in C#.
Here is the C# call...
if (Login((this.txtUsername.Text),(this.txtPassword.Text),(this.txtURL.Text),(this.cmbConnection.Text), oTradeDesk1) == false)
for the function definition...
private bool Login(ref string sUserName, ref string sPassword, ref string sHostsPath, ref string sTrading, ref object oTradeDesk )
the VB.net version which builds and works fine in VB.net is as follows...
If Login((Me.txtUsername.Text), (Me.txtPassword.Text), (Me.txtURL.Text),(Me.cmbConnection.Text), oTradeDesk1) = False Then Exit Sub
which calls this function....
Private Function Login(ByRef sUserName As String, ByRef sPassword As String, ByRef sHostsPath As String, ByRef sTrading As String, ByRef oTradeDesk As Object) As Boolean
Anyway the C# comparible (I believe anyway) gets an error(s)...
error CS1503: Argument '1': cannot convert from 'string' to 'ref string'
error CS1503: Argument '2': cannot convert from 'string' to 'ref string'
error CS1503: Argument '3': cannot convert from 'string' to 'ref string'
error CS1503: Argument '4': cannot convert from 'string' to 'ref string'
I've tried everything ;(
Anyway please allow me to express my gratitude in advance for your gracious help.
Hope everyone is well.