Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: declaring variables... Pin
Arjan Einbu29-Jun-03 0:37
Arjan Einbu29-Jun-03 0:37 
GeneralRe: declaring variables... Pin
theJazzyBrain29-Jun-03 0:54
theJazzyBrain29-Jun-03 0:54 
GeneralPrinter fonts Pin
berylius26-Jun-03 22:07
berylius26-Jun-03 22:07 
GeneralRe: Printer fonts Pin
Mazdak26-Jun-03 22:32
Mazdak26-Jun-03 22:32 
GeneralRe: Printer fonts Pin
berylius26-Jun-03 22:42
berylius26-Jun-03 22:42 
GeneralTabControl,TabPage and Context Menu Pin
Anonymous26-Jun-03 21:16
Anonymous26-Jun-03 21:16 
QuestionData-bind Windows Forms Treeview? Pin
J. Dunlap26-Jun-03 18:13
J. Dunlap26-Jun-03 18:13 
GeneralConvert to C# code Pin
Steve McLenithan26-Jun-03 18:06
Steve McLenithan26-Jun-03 18:06 
How would I change this darn VB.net code to C#?

Public Function AddPortalInfo(ByVal PortalName As String, 
   ByVal PortalAlias As String, Optional ByVal Currency As String = "",
   Optional ByVal FirstName As String = "", Optional ByVal LastName As String = "", 
   Optional ByVal Username As String = "", Optional ByVal Password As String = "", 
   Optional ByVal Email As String = "", Optional ByVal ExpiryDate As String = "", 
   Optional ByVal HostFee As Double = 0, Optional ByVal HostSpace As Double = 0, 
   Optional ByVal SiteLogHistory As Integer = -1, <SqlParameter(, , , , , ParameterDirection.Output)> 
   Optional ByVal PortalId As Integer = -1) As Integer
   Dim myConnection As New SqlConnection(GetDBConnectionString)

   ' Generate Command Object based on Method
   Dim myCommand As SqlCommand = SqlCommandGenerator.GenerateCommand(myConnection, _
      CType(MethodBase.GetCurrentMethod(), MethodInfo), _
      New Object() {PortalName, PortalAlias, IIf(Currency <> "", Currency, "USD"), 
      FirstName, LastName, Username, Password, Email, IIf(ExpiryDate <> "", ExpiryDate, SqlInt16.Null), 
      HostFee, HostSpace, IIf(SiteLogHistory <> -1, SiteLogHistory, SqlInt16.Null), PortalId})

   myConnection.Open()
   myCommand.ExecuteNonQuery()
   myConnection.Close()

   Return CInt(myCommand.Parameters("@PortalID").Value)
End Function


I never got into vb.net so I have no idea what to do with the Optional keyword. Does that mean I have to makie a bunch of overloads of this functionin C#?

<SqlParameter(, , , , , ParameterDirection.Output)> wtf is that?

How do I get around the IIf thing (does that mean if and only if?

Thanks for any clarification on this garbage;)

Steve
McLenithan

Is Bert Evil? | Homer: "Hello, operator, gimme the number for 911!"

GeneralRe: Convert to C# code Pin
Nick Seng26-Jun-03 18:19
Nick Seng26-Jun-03 18:19 
GeneralRe: Convert to C# code Pin
Steve McLenithan26-Jun-03 20:03
Steve McLenithan26-Jun-03 20:03 
GeneralRe: Convert to C# code Pin
J. Dunlap26-Jun-03 18:32
J. Dunlap26-Jun-03 18:32 
GeneralRe: Convert to C# code Pin
Steve McLenithan26-Jun-03 20:06
Steve McLenithan26-Jun-03 20:06 
GeneralRe: Convert to C# code Pin
leppie27-Jun-03 10:05
leppie27-Jun-03 10:05 
GeneralRe: Convert to C# code Pin
Steve McLenithan27-Jun-03 11:17
Steve McLenithan27-Jun-03 11:17 
GeneralRe: Convert to C# code Pin
Kant27-Jun-03 10:08
Kant27-Jun-03 10:08 
GeneralRe: Convert to C# code Pin
Steve McLenithan27-Jun-03 11:18
Steve McLenithan27-Jun-03 11:18 
GeneralOne code, two different results - C# vs C++ Pin
C. Augusto Proiete26-Jun-03 16:25
C. Augusto Proiete26-Jun-03 16:25 
GeneralRe: One code, two different results - C# vs C++ Pin
Nick Seng26-Jun-03 16:49
Nick Seng26-Jun-03 16:49 
GeneralRe: One code, two different results - C# vs C++ Pin
leppie26-Jun-03 18:03
leppie26-Jun-03 18:03 
GeneralRe: One code, two different results - C# vs C++ Pin
Nick Seng26-Jun-03 18:13
Nick Seng26-Jun-03 18:13 
GeneralRe: One code, two different results - C# vs C++ Pin
jspano27-Jun-03 6:23
jspano27-Jun-03 6:23 
GeneralRe: One code, two different results - C# vs C++ Pin
C. Augusto Proiete27-Jun-03 15:23
C. Augusto Proiete27-Jun-03 15:23 
GeneralRe: One code, two different results - C# vs C++ Pin
jspano28-Jun-03 16:26
jspano28-Jun-03 16:26 
GeneralRe: One code, two different results - C# vs C++ Pin
Bo Hunter28-Jun-03 10:54
Bo Hunter28-Jun-03 10:54 
Questionusing Byte[] in a WebService method?? Pin
Uploader26-Jun-03 12:26
Uploader26-Jun-03 12:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.