Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multi Line Coding in VB.Net for passing parameter

Posted on 2010-08-27
4
Medium Priority
?
302 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
[X]
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
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 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