Thursday, July 30, 2009

In vb.net optional Byval params() as SqlParameter=Nothing what is in c#.net?

C# does not allow optional paramters, but the good news is that overloading a method is easy, just write:


public void myProc(SqlParamter params[])


{


//Do something


}





public void myProc()


{


//Do something


}





If you absolutely need to have the parameter in the function you will need to pass something either a valid SqlParameter object or null will work but be sure you are validating your params

avender

No comments:

Post a Comment