Click here to Skip to main content
15,926,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Insert TXT data into SQL database Pin
N a v a n e e t h6-Jan-08 21:25
N a v a n e e t h6-Jan-08 21:25 
GeneralRe: Insert TXT data into SQL database Pin
J4amieC6-Jan-08 22:20
J4amieC6-Jan-08 22:20 
Generallambda or anonymous delegate [modified] Pin
Roger Alsing6-Jan-08 20:55
Roger Alsing6-Jan-08 20:55 
GeneralGenerating Reports Pin
sami_pak6-Jan-08 20:26
sami_pak6-Jan-08 20:26 
GeneralRe: Generating Reports Pin
N a v a n e e t h6-Jan-08 20:27
N a v a n e e t h6-Jan-08 20:27 
Generalfilereading problem Pin
chanzeb6-Jan-08 20:10
chanzeb6-Jan-08 20:10 
GeneralRe: filereading problem Pin
N a v a n e e t h6-Jan-08 20:23
N a v a n e e t h6-Jan-08 20:23 
GeneralPassing null to a refrence parameter Pin
N a v a n e e t h6-Jan-08 20:04
N a v a n e e t h6-Jan-08 20:04 
I have VB.NET code shown below.
Module Module1

    Sub Main()
        Dim objClass1 As New class1()
        objClass1.MyProg(Nothing)

    End Sub

    Public Class class1
        Public Function MyProg(ByRef objStruct As MyStruct)

        End Function

    End Class

    Public Structure MyStruct
        Public a As Integer
    End Structure
End Module
I need to convert this to C# equivalant. So I wrote the following,

class Program
    {
        static void Main(string[] args)
        {
            Program p = new Program();
            p.MyProg(null);
        }

        public void MyProg(ref MyStruct objMyStruct)
        {
        }
    }

    struct MyStruct
    {
    }
In VB.NET code compiles correctly. But C# shows error saying that "invalid parameters". How can I pass a null value to a reference parameter ? I know a structure instance can't be null. But how does this happened with VB.NET ? Any idea's ?


All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia

My Website | Ask smart questions


GeneralRe: Passing null to a refrence parameter Pin
Luc Pattyn7-Jan-08 4:10
sitebuilderLuc Pattyn7-Jan-08 4:10 
GeneralRe: Passing null to a refrence parameter Pin
N a v a n e e t h7-Jan-08 19:09
N a v a n e e t h7-Jan-08 19:09 
Generalto insert date into the database Pin
chithra.r6-Jan-08 20:00
chithra.r6-Jan-08 20:00 
GeneralRe: to insert date into the database Pin
N a v a n e e t h6-Jan-08 20:22
N a v a n e e t h6-Jan-08 20:22 
GeneralProgressPare Pin
Thaer Hamael6-Jan-08 19:54
Thaer Hamael6-Jan-08 19:54 
GeneralRe: ProgressPare Pin
N a v a n e e t h6-Jan-08 20:16
N a v a n e e t h6-Jan-08 20:16 
GeneralRe: ProgressPare Pin
Thaer Hamael6-Jan-08 23:24
Thaer Hamael6-Jan-08 23:24 
Generalsavefiledialog Pin
chanzeb6-Jan-08 19:24
chanzeb6-Jan-08 19:24 
GeneralRe: savefiledialog Pin
N a v a n e e t h6-Jan-08 20:10
N a v a n e e t h6-Jan-08 20:10 
GeneralRe: savefiledialog Pin
chanzeb6-Jan-08 20:31
chanzeb6-Jan-08 20:31 
GeneralRe: savefiledialog Pin
N a v a n e e t h6-Jan-08 21:23
N a v a n e e t h6-Jan-08 21:23 
GeneralRegarding assemblies Pin
sekhar20086-Jan-08 19:14
sekhar20086-Jan-08 19:14 
GeneralRe: Regarding assemblies Pin
originSH6-Jan-08 22:51
originSH6-Jan-08 22:51 
GeneralRe: Regarding assemblies Pin
sekhar20087-Jan-08 0:26
sekhar20087-Jan-08 0:26 
GeneralRe: Regarding assemblies Pin
originSH7-Jan-08 1:44
originSH7-Jan-08 1:44 
GeneralRe: Regarding assemblies Pin
sekhar20087-Jan-08 3:06
sekhar20087-Jan-08 3:06 
GeneralCommunicating with USB Port in C## Pin
Sourie6-Jan-08 19:13
Sourie6-Jan-08 19:13 

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.