Click here to Skip to main content
15,891,868 members
Home / Discussions / C#
   

C#

 
QuestionCustom Classes in web services Pin
BASONJS5-May-09 4:07
BASONJS5-May-09 4:07 
QuestionAdding a WebReference using WSE 3.0 Pin
ATCsharp5-May-09 3:42
ATCsharp5-May-09 3:42 
Questioni got some xml questions Pin
Miroslav885-May-09 3:25
Miroslav885-May-09 3:25 
GeneralRe: i got some xml questions Pin
harold aptroot5-May-09 3:33
harold aptroot5-May-09 3:33 
GeneralRe: i got some xml questions Pin
Miroslav885-May-09 9:43
Miroslav885-May-09 9:43 
GeneralRe: i got some xml questions Pin
harold aptroot5-May-09 10:57
harold aptroot5-May-09 10:57 
AnswerRe: i got some xml questions Pin
led mike5-May-09 4:31
led mike5-May-09 4:31 
QuestionConvert Variant in VB to C# Pin
klaydze5-May-09 3:22
klaydze5-May-09 3:22 
Hi,

I'm just starting to convert my vb6.0 program to c#.net and I have a function in vb6.0 below:

Anyone can help me to translate this in c#.net.

Public Function GetData(SQL As String) As Variant
Dim RST As ADODB.Recordset
    Set RST = Conn.Execute(SQL)
    With RST
        If .State = adStateOpen Then
            If Not .EOF Then
                If Not IsNull(RST(0)) Then
                    Select Case RST(0).Type
                        Case adVarChar
                            GetData = Trim(RST(0))
                        Case Else
                            GetData = RST(0)
                    End Select
                Else
                    Select Case RST(0).Type
                        Case adBoolean
                            GetData = False
                        Case adVarChar
                            GetData = ""
                        Case adDouble, adInteger
                            GetData = 0
                        Case adDate, adDBTimeStamp
                            GetData = InvalidDate
                    End Select
                End If
            Else
                Select Case RST(0).Type
                    Case adBoolean
                        GetData = False
                    Case adVarChar
                        GetData = ""
                    Case adDouble, adInteger
                        GetData = 0
                    Case adDate, adDBTimeStamp
                        GetData = InvalidDate
                End Select
            End If
        Else
            Select Case RST(0).Type
                Case adBoolean
                    GetData = False
                Case adVarChar
                    GetData = ""
                Case adDouble, adInteger
                    GetData = 0
                Case adDate, adDBTimeStamp
                    GetData = InvalidDate
            End Select
        End If
    End With
    Set RST = Nothing
End Function


THANKS AND REGARDS

klaydze

if(you type your code here) {
Messagebox.Show("You help me a lot!");
}
else {
You help me = null;
}

AnswerRe: Convert Variant in VB to C# Pin
Le centriste5-May-09 5:19
Le centriste5-May-09 5:19 
GeneralRe: Convert Variant in VB to C# Pin
klaydze6-May-09 2:20
klaydze6-May-09 2:20 
QuestionVariant in VB to C# Pin
klaydze5-May-09 3:13
klaydze5-May-09 3:13 
AnswerRe: Variant in VB to C# Pin
Simon P Stevens5-May-09 4:39
Simon P Stevens5-May-09 4:39 
GeneralRe: Variant in VB to C# Pin
klaydze6-May-09 2:17
klaydze6-May-09 2:17 
GeneralRe: Variant in VB to C# Pin
Simon P Stevens6-May-09 2:57
Simon P Stevens6-May-09 2:57 
GeneralRe: Variant in VB to C# Pin
klaydze6-May-09 3:51
klaydze6-May-09 3:51 
GeneralRe: Variant in VB to C# Pin
Simon P Stevens6-May-09 4:38
Simon P Stevens6-May-09 4:38 
GeneralRe: Variant in VB to C# Pin
klaydze6-May-09 4:58
klaydze6-May-09 4:58 
GeneralRe: Variant in VB to C# Pin
Simon P Stevens6-May-09 6:14
Simon P Stevens6-May-09 6:14 
GeneralRe: Variant in VB to C# Pin
klaydze7-May-09 3:44
klaydze7-May-09 3:44 
QuestionRich Text Box Flicker Pin
Paul Unsworth5-May-09 3:12
Paul Unsworth5-May-09 3:12 
AnswerRe: Rich Text Box Flicker Pin
Nuri Ismail5-May-09 5:45
Nuri Ismail5-May-09 5:45 
GeneralRe: Rich Text Box Flicker Pin
Paul Unsworth5-May-09 21:15
Paul Unsworth5-May-09 21:15 
QuestionCalling C# function in Java Pin
raesa5-May-09 1:40
raesa5-May-09 1:40 
AnswerRe: Calling C# function in Java Pin
Nagy Vilmos5-May-09 1:54
professionalNagy Vilmos5-May-09 1:54 
GeneralRe: Calling C# function in Java Pin
raesa5-May-09 2:02
raesa5-May-09 2:02 

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.