Pardon me. I have seen ur sample code, I have known the error, but I still have not found the solution for this. Should I create the instance class so many times? Kind Regards,
Kevin http://www.vinshop.us PIN : 21AD562F Gtalk: [email protected] -----Original Message----- From: ARUN KUMAR <[email protected]> Sender: [email protected] Date: Sat, 28 May 2011 21:20:04 To: <[email protected]> Reply-To: [email protected] Subject: Re: [DotNetDevelopment] [ASK] call same method twice on VB.NET Hi Yosef Kevin, Please find below code it may be help you to find error in Koneksi class Dim Con as new Sample Con.GetClassName() ‘ -it return Sample class Con.GetClassName() ’ it return Nothing Public class Sample Private MyName as string =”SampleClass” Public function GetClassName() Try Return MyName Catch ex as exception Finally MyName=Nothing ’ error is here End Try End Sub End Class On 27 May 2011 09:08, Yosef Kevin <[email protected]> wrote: > This is my problem: > > I have a class , the name is "Koneksi", and this class has a method > "getAttrTambahBarang" with two string parameters. The method will return an > output based on the parameters inputed > > On the form, I instance this class and call that method like this: > > Dim con as New Koneksi > con.getAttrTambahBarang("handphone","getId") > con.getAttrTambahBarang("handphone","getNama") > > The problem is when I call the same method twice (or say more than once), > the method doesn't return the expected result (it returns nothing). > But, if I change the code above into this: > > This is my problem: > > I have a class , the name is "Koneksi", and this class has a method > "getAttrTambahBarang" with two string parameters. The method will return an > output based on the parameters inputed > > On the form, I instance this class and call that method like this: > > Dim con as New Koneksi > con.getAttrTambahBarang("handphone","getId") > Dim con2 as New Koneksi > con2.getAttrTambahBarang("handphone","getNama") > > It works, but of course, it's not good solution (since if I want to call > the method 100times, its fool to create 100 instance). Please help me ASAP > > > -- > Yosef Kevin > http://codingexplorer.blogspot.com > PIN : 21AD562F > MSN : [email protected] > YM : yosef.kevin > Gtalk: yosef.kevin > > -- > You received this message because you are subscribed to the Google > Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML > Web Services,.NET Remoting" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en > or visit the group website at http://megasolutions.net > -- Regards, Arun Kumar -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
