class instance

Posted on 2008-10-23
Last Modified: 2012-05-05
hello experts

i wanted to set the instance of this customerdetailclass based on learnit value
i tried the following and am getting errors

 If learnIt Then
    Dim ContactDetails As New CustomerDetailsClass(ContactTitle, txtContactFirstName.Text,,,,,,)
    Dim ContactDetails As New CustomerDetailsClass(ContactTitle, txtContactFirstName.Text,,,,,,)
 end if

 Can I not use like this?

 Dim ContactDetails As New CustomerDetailsClass
 if learnt then
  ContactDetails = ContactDetails(ContactTitle, txtContactFirstName.Text,,,,)
  ContactDetails = ContactDetails(ContactTitle, txtContactFirstName.Text,,,,)
end if

please advise
Question by:learningnet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Accepted Solution

Bane83 earned 400 total points
ID: 22787991
Try this:

Dim ContactDetails As CustomerDetailsClass ' (if this doesn't work, try Object instead of CustomerDetailsClass here)
 if learnt then
  ContactDetails = New CustomerDetailsClass(ContactTitle, txtContactFirstName.Text,,,,)
  ContactDetails = New CustomerDetailsClass(ContactTitle, txtContactFirstName.Text,,,,)
end if
LVL 13

Assisted Solution

TechTiger007 earned 100 total points
ID: 22788386
Solution suggested by Bane83 will work. unless the constructor throws some exception

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question