Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multi Line Coding in VB.Net for passing parameter

Posted on 2010-08-27
4
Medium Priority
?
305 Views
Last Modified: 2013-11-27


I want to break this Single line Parameter passing code in Multi line..

Multi line coding will be easier to understand and debug
objBL.insReportDetails(txtFName.Text.Trim(), txtMIName.Text.Trim(), txtLName.Text.Trim(), Convert.ToInt32(txtSSN.Text), strAddress, txtCity.Text.Trim(), cmbState.SelectedValue.ToString(), Convert.ToInt32(txtZipCode.Text), txtDOB.Text, rbMale.Checked, Convert.ToInt32(txtHPhone.Text), Convert.ToInt32(txtCellPhone), Convert.ToInt32(txtWPhone.Text), strShipping, rdShipmentYes.Checked, txtEmail.Text.Trim(), txtDCity.Text.Trim(), Convert.ToInt32(txtDZipCode.Text), txtBestTimeToCall.Text.Trim(), rdMessageYes.Checked, rdPolicyYes.Checked, cmbTypeOfInsurance.SelectedValue.ToString(), txtPolicyHolderName.Text, txtRelationshipPolicyHolder.Text, Convert.ToDateTime(txtPolicyHolderDOB.Text), Convert.ToInt32(txtPolicySSN.Text), cmbPhy1.SelectedValue.ToString(), txtP1Phn.Text.Trim(), txtP1Fax.Text.Trim(), cmbPhy2.SelectedValue.ToString(), txtP2Phn.Text.Trim(), txtP2Fax.Text.Trim(), cmbPhy3.SelectedValue.ToString(), txtP3Phn.Text.Trim(), txtP3Fax.Text.Trim(), cmbCaseManagers.SelectedValue.ToString(), txtOrganization.Text.Trim(), Convert.ToInt32(txtCPhoneNumber.Text), txtReferredBy.Text.Trim(), txtRefRelationship.Text.Trim(), Convert.ToInt32(txtRelationshipPhoneNumber.Text))

Open in new window

0
Comment
Question by:chokka
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Zhaolai earned 2000 total points
ID: 33546429
Try this:

        objBL.insReportDetails(txtFName.Text.Trim(), txtMIName.Text.Trim(), txtLName.Text.Trim(),
                               Convert.ToInt32(txtSSN.Text), strAddress, txtCity.Text.Trim(),
                               cmbState.SelectedValue.ToString(), Convert.ToInt32(txtZipCode.Text),
                               txtDOB.Text, rbMale.Checked, Convert.ToInt32(txtHPhone.Text),
                               Convert.ToInt32(txtCellPhone), Convert.ToInt32(txtWPhone.Text),
                               strShipping, rdShipmentYes.Checked, txtEmail.Text.Trim(), txtDCity.Text.Trim(),
                               Convert.ToInt32(txtDZipCode.Text), txtBestTimeToCall.Text.Trim(),
                               rdMessageYes.Checked, rdPolicyYes.Checked, cmbTypeOfInsurance.SelectedValue.ToString(),
                               txtPolicyHolderName.Text, txtRelationshipPolicyHolder.Text,
                               Convert.ToDateTime(txtPolicyHolderDOB.Text), Convert.ToInt32(txtPolicySSN.Text),
                               cmbPhy1.SelectedValue.ToString(), txtP1Phn.Text.Trim(), txtP1Fax.Text.Trim(),
                               cmbPhy2.SelectedValue.ToString(), txtP2Phn.Text.Trim(), txtP2Fax.Text.Trim(),
                               cmbPhy3.SelectedValue.ToString(), txtP3Phn.Text.Trim(), txtP3Fax.Text.Trim(),
                               cmbCaseManagers.SelectedValue.ToString(), txtOrganization.Text.Trim(),
                               Convert.ToInt32(txtCPhoneNumber.Text), txtReferredBy.Text.Trim(),
                               txtRefRelationship.Text.Trim(), Convert.ToInt32(txtRelationshipPhoneNumber.Text))


Or

        objBL.insReportDetails(txtFName.Text.Trim(), txtMIName.Text.Trim(), txtLName.Text.Trim(), _
                               Convert.ToInt32(txtSSN.Text), strAddress, txtCity.Text.Trim(), _
                               cmbState.SelectedValue.ToString(), Convert.ToInt32(txtZipCode.Text), _
                               txtDOB.Text, rbMale.Checked, Convert.ToInt32(txtHPhone.Text), _
                               Convert.ToInt32(txtCellPhone), Convert.ToInt32(txtWPhone.Text), _
                               strShipping, rdShipmentYes.Checked, txtEmail.Text.Trim(), txtDCity.Text.Trim(), _
                               Convert.ToInt32(txtDZipCode.Text), txtBestTimeToCall.Text.Trim(), _
                               rdMessageYes.Checked, rdPolicyYes.Checked, cmbTypeOfInsurance.SelectedValue.ToString(), _
                               txtPolicyHolderName.Text, txtRelationshipPolicyHolder.Text, _
                               Convert.ToDateTime(txtPolicyHolderDOB.Text), Convert.ToInt32(txtPolicySSN.Text), _
                               cmbPhy1.SelectedValue.ToString(), txtP1Phn.Text.Trim(), txtP1Fax.Text.Trim(), _
                               cmbPhy2.SelectedValue.ToString(), txtP2Phn.Text.Trim(), txtP2Fax.Text.Trim(), _
                               cmbPhy3.SelectedValue.ToString(), txtP3Phn.Text.Trim(), txtP3Fax.Text.Trim(), _
                               cmbCaseManagers.SelectedValue.ToString(), txtOrganization.Text.Trim(), _
                               Convert.ToInt32(txtCPhoneNumber.Text), txtReferredBy.Text.Trim(), _
                               txtRefRelationship.Text.Trim(), Convert.ToInt32(txtRelationshipPhoneNumber.Text))


0
 

Author Comment

by:chokka
ID: 33546462


Can you please help me in this Function header ..
Public Sub insReportDetails(ByVal strFName As String, ByVal strMName As String, ByVal strLName As String, ByVal iSSN As Integer, ByVal strAddress As String, ByVal strCity As String, ByVal strState As String, ByVal iZip As Integer, ByVal iDOB As Date, ByVal bMale As Boolean, ByVal iHPhn As Integer, ByVal iCellPhn As Integer, ByVal iWPhn As Integer, ByVal strShippingAddress As String, ByVal bEmailShip As Boolean, ByVal strEmailAdd As String, ByVal strDCity As String, ByVal iDZip As Integer, ByVal strBestTimeToCall As String, ByVal bLeaveMessage As Boolean, ByVal bPolicyHolder As Boolean, ByVal strTypeofInsurance As String, ByVal strPolicyHolderName As String, ByVal strRelationshiptoPolicyHolder As String, ByVal dPolicyDOB As Date, ByVal iPolicySSN As Integer, ByVal strPhysician1 As String, ByVal iPhysician1PhnNumber As Integer, ByVal iPhysician1FaxNumber As Integer, ByVal strPhysician2 As String, ByVal iPhysician2PhnNumber As Integer, ByVal iPhysician2FaxNumber As Integer, ByVal strPhysician3 As String, ByVal iPhysician3PhnNumber As Integer, ByVal iPhysician3FaxNumber As Integer, ByVal strCaseManager As String, ByVal strOrganization As String, ByVal intCMPhone As Integer, ByVal strReferredBy As String, ByVal strRelationship As String, ByVal iRelationshipPhn As Integer)

Open in new window

0
 
LVL 17

Assisted Solution

by:Zhaolai
Zhaolai earned 2000 total points
ID: 33546481
Here it is:

    Public Sub insReportDetails(ByVal strFName As String, ByVal strMName As String, ByVal strLName As String,
                                ByVal iSSN As Integer, ByVal strAddress As String, ByVal strCity As String,
                                ByVal strState As String, ByVal iZip As Integer, ByVal iDOB As Date,
                                ByVal bMale As Boolean, ByVal iHPhn As Integer, ByVal iCellPhn As Integer,
                                ByVal iWPhn As Integer, ByVal strShippingAddress As String, ByVal bEmailShip As Boolean,
                                ByVal strEmailAdd As String, ByVal strDCity As String, ByVal iDZip As Integer,
                                ByVal strBestTimeToCall As String, ByVal bLeaveMessage As Boolean,
                                ByVal bPolicyHolder As Boolean, ByVal strTypeofInsurance As String,
                                ByVal strPolicyHolderName As String, ByVal strRelationshiptoPolicyHolder As String,
                                ByVal dPolicyDOB As Date, ByVal iPolicySSN As Integer, ByVal strPhysician1 As String,
                                ByVal iPhysician1PhnNumber As Integer, ByVal iPhysician1FaxNumber As Integer,
                                ByVal strPhysician2 As String, ByVal iPhysician2PhnNumber As Integer,
                                ByVal iPhysician2FaxNumber As Integer, ByVal strPhysician3 As String,
                                ByVal iPhysician3PhnNumber As Integer, ByVal iPhysician3FaxNumber As Integer,
                                ByVal strCaseManager As String, ByVal strOrganization As String,
                                ByVal intCMPhone As Integer, ByVal strReferredBy As String,
                                ByVal strRelationship As String, ByVal iRelationshipPhn As Integer)

Or

    Public Sub insReportDetails(ByVal strFName As String, ByVal strMName As String, ByVal strLName As String, _
                            ByVal iSSN As Integer, ByVal strAddress As String, ByVal strCity As String, _
                            ByVal strState As String, ByVal iZip As Integer, ByVal iDOB As Date, _
                            ByVal bMale As Boolean, ByVal iHPhn As Integer, ByVal iCellPhn As Integer, _
                            ByVal iWPhn As Integer, ByVal strShippingAddress As String, ByVal bEmailShip As Boolean, _
                            ByVal strEmailAdd As String, ByVal strDCity As String, ByVal iDZip As Integer, _
                            ByVal strBestTimeToCall As String, ByVal bLeaveMessage As Boolean, _
                            ByVal bPolicyHolder As Boolean, ByVal strTypeofInsurance As String, _
                            ByVal strPolicyHolderName As String, ByVal strRelationshiptoPolicyHolder As String, _
                            ByVal dPolicyDOB As Date, ByVal iPolicySSN As Integer, ByVal strPhysician1 As String, _
                            ByVal iPhysician1PhnNumber As Integer, ByVal iPhysician1FaxNumber As Integer, _
                            ByVal strPhysician2 As String, ByVal iPhysician2PhnNumber As Integer, _
                            ByVal iPhysician2FaxNumber As Integer, ByVal strPhysician3 As String, _
                            ByVal iPhysician3PhnNumber As Integer, ByVal iPhysician3FaxNumber As Integer, _
                            ByVal strCaseManager As String, ByVal strOrganization As String, _
                            ByVal intCMPhone As Integer, ByVal strReferredBy As String, _
                            ByVal strRelationship As String, ByVal iRelationshipPhn As Integer)
0
 

Author Closing Comment

by:chokka
ID: 33546529
Thanks for helping me ..
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline

963 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