title: Long query won't work
body: <p>Im new to vb and im working on a monitoring system with a long query</p>
  
  <pre><code>If frm_MonitoringReg.txtIDnumber.Text = String.Empty Or frm_MonitoringReg.txtAddress.Text = String.Empty Or frm_MonitoringReg.txtBirthPlace.Text = String.Empty Or frm_MonitoringReg.txtFirstName.Text = String.Empty Or frm_MonitoringReg.txtIDnumber.Text = String.Empty Or frm_MonitoringReg.txtLastName.Text = String.Empty Or frm_MonitoringReg.txtMiddleName.Text = String.Empty Or frm_MonitoringReg.cmbCivilStatus.SelectedIndex = 0 Or frm_MonitoringReg.cmbGender.SelectedIndex = 0 Then
          MsgBox("Must Fill All Fields")
      Else
          Dim AccountDS, PersonDS As New DataSet
          'Dim Command As New SqlCommand(SQLCon)
          'Command.Open()
          Dim cmdSelectPersonInfo As New SqlCommand("SELECT * FROM [186].[dbo].personInfo WHERE pIDnumber = @pIDnumber", Connection)
          cmdSelectPersonInfo.CommandType = CommandType.Text
          cmdSelectPersonInfo.Parameters.AddWithValue("@pIDnumber", frm_MonitoringReg.txtIDnumber.Text)
          Dim dAdapterPerson As New SqlDataAdapter(cmdSelectPersonInfo)
          dAdapterPerson.Fill(PersonDS)
  
          If PersonDS.Tables(0).Rows.Count &gt;= 1 Then
              MsgBox("Person Information is already created")
          Else
              Dim cmdAddPersonInfo As New SqlCommand("INSERT INTO [186].[dbo].[personInfo] (pIDnumber, pLname, pFname, pMname, pAddress, " &amp; _
                                                       "pGender, pBirthday, pBirthPlace, pCivilStatus, DeletedFlag, createBy, createDate,pWorking " &amp; _
                                                       "pOccupation,pStudying,pTSchool ,pHEducation,pDisability,pYr,pPrecinct,pYrBahay,pKPaninirahan " &amp; _
                                                       "pKPKanino,pKPUpa,pLTinitirhan,pLTukuyin,pKBahay,pKtukuyin,pMBahay,pMTukuyin,pMeralco,pMaynilad " &amp; _
                                                       "pTelepono,pBKita,pGPamilya,pKapitbahay,pPalikuran,pPagluluto,pPTukuyin,pTubig,pTTukuyin,pIlaw " &amp; _
                                                       "pITukuyin,pLTelevision,pLVideoke,pLSports,pLMusical,pLReading,pLMalling,pLHiking,pHAso " &amp; _
                                                       "pHPusa,pHManok,pHBaboy,pHIba,pHBilang,pSKotse,pSVan,pSJeepney,pSTricycle,pSIba,pSIba,pKRadio,pKAudio,pKKaraoke " &amp; _
                                                       "pKPiano,pKCellphone,pKTV,pKVideoP,pKCam,pKWood,pKKerosene,pKLPG,pKGas,pKEStove,pKERange,pKMicrowave " &amp; _
                                                       "pKRef,pKFreezer,pKWashing,pKHeated,pKAircon,pKEFan,pKETank,pKEHeater,pKComputer,pKLaptop,pKSystem,pKFlatI) " &amp; _
                                                       "VALUES (@IDnumber, @Lname, @Fname, @Mname, @Address, @Gender, @bDay, @bPlace, @CivilStat, @deletedFlag, @createBy, @createDate " &amp; _
                                                       "@pWorking,@pOccupation,@pStudying,@pTSchool,@pHEducation,@pDisability,@pYr,@pPrecinct,@pYrBahay,@pKPaninirahan " &amp; _
                                                       "@pKPKanino,@pKPUpa,@pLTinitirhan,@pLTukuyin,@pKBahay,@pKtukuyin,@pMBahay,@pMTukuyin,@pMeralco,@pMaynilad " &amp; _
                                                       "@pTelepono,@pBKita,@pGPamilya,@pKapitbahay,@pPalikuran,@pPagluluto,@pPTukuyin,@pTubig,@pTTukuyin,@pIlaw " &amp; _
                                                       "@pITukuyin,@pLTelevision,@pLVideoke,@pLSports,@pLMusical,@pLReading,@pLMalling,@pLHiking,@pHAso " &amp; _
                                                       "@pHPusa,@pHManok,@pHBaboy,@pHIba,@pHBilang,@pSKotse,@pSVan,@pSJeepney,@pSTricycle,@pSIba,@pSIba,@pKRadio,@pKAudio,@pKKaraoke " &amp; _
                                                       "@pKPiano,@pKCellphone,@pKTV,@pKVideoP,@pKCam,@pKWood,@pKKerosene,@pKLPG,@pKGas,@pKEStove,@pKERange,@pKMicrowave " &amp; _
                                                       "@pKRef,@pKFreezer,@pKWashing,@pKHeated,@pKAircon,@pKEFan,@pKETank,@pKEHeater,@pKComputer,@pKLaptop,@pKSystem,@pKFlatI)", Connection)
              cmdAddPersonInfo.CommandType = CommandType.Text
              cmdAddPersonInfo.Parameters.AddWithValue("@IDnumber", frm_MonitoringReg.txtIDnumber.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@Lname", frm_MonitoringReg.txtLastName.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@Fname", frm_MonitoringReg.txtFirstName.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@Mname", frm_MonitoringReg.txtMiddleName.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@Address", frm_MonitoringReg.txtAddress.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@Gender", frm_MonitoringReg.cmbGender.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@bDay", frm_MonitoringReg.dtpBirthDay.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@bPlace", frm_MonitoringReg.txtBirthPlace.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@CivilStat", frm_MonitoringReg.cmbCivilStatus.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@deletedFlag", 0)
              cmdAddPersonInfo.Parameters.AddWithValue("@createBy", LoginForm.txtUsername.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@createDate", Now.Date.ToString)
              cmdAddPersonInfo.Parameters.AddWithValue("@pWorking", frm_MonitoringReg.chckWorking.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pOccupation", frm_MonitoringReg.txtOccupation)
              cmdAddPersonInfo.Parameters.AddWithValue("@pStudying", frm_MonitoringReg.chckStudying.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pTSchool", frm_MonitoringReg.cmboTypeofSchool.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHEducation", frm_MonitoringReg.cmboHighestEduc.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pDisability", frm_MonitoringReg.chckDisablity.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pYr", frm_MonitoringReg.txtYrofStay)
              cmdAddPersonInfo.Parameters.AddWithValue("@pPrecinct", frm_MonitoringReg.txtPrecintNo)
              cmdAddPersonInfo.Parameters.AddWithValue("@pYrBahay", frm_MonitoringReg.txttyr)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKPaninirahan", frm_MonitoringReg.cmboKatayuan.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKPKanino", frm_MonitoringReg.txtKanino)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKPUpa", frm_MonitoringReg.txtUpa)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLTinitirhan", frm_MonitoringReg.cmboLote.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLTukuyin", frm_MonitoringReg.txtlTukuyin)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKBahay", frm_MonitoringReg.cmboBahay.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKtukuyin", frm_MonitoringReg.txtbTukuyin)
              cmdAddPersonInfo.Parameters.AddWithValue("@pMBahay", frm_MonitoringReg.cmbomBahay.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pMTukuyin", frm_MonitoringReg.txtmTukuyin)
              cmdAddPersonInfo.Parameters.AddWithValue("@pMeralco", frm_MonitoringReg.chckMeralco.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pMaynilad", frm_MonitoringReg.chckMaynilad.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pTelepono", frm_MonitoringReg.chckTelepono.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pBKita", frm_MonitoringReg.txtKita)
              cmdAddPersonInfo.Parameters.AddWithValue("@pGPamilya", frm_MonitoringReg.txtGastos)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKapitbahay", frm_MonitoringReg.txtKapitbahay)
              cmdAddPersonInfo.Parameters.AddWithValue("@pPalikuran", frm_MonitoringReg.cmboPalikuran.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pPagluluto", frm_MonitoringReg.cmboPagluluto.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pPTukuyin", frm_MonitoringReg.txtpTukuyin)
              cmdAddPersonInfo.Parameters.AddWithValue("@pTubig", frm_MonitoringReg.cmboTubig.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pTTukuyin", frm_MonitoringReg.txttTukuyin.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pIlaw", frm_MonitoringReg.cmboIlaw.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pITukuyin", frm_MonitoringReg.txtiTukuyin.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLTelevision", chckTelevision.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLVideoke", chckVideoke.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLSports", chckSports.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLMusical", chckMusicalInstruments.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLReading", chckReading.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLMalling", chckMalling.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLHiking", chckHiking.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pLReading", chckReading.CheckState)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHAso", txtAso.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHPusa", txtPusa.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHManok", txtManok.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHBaboy", txtBaboy.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHIba", TxtHIba.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pHBilang", txtHBilang.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pSKotse", txtkotse.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pSVan", txtVan.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pSJeepney", txtJeepney.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pSTricycle", txtTricycle.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pSIba", txtSIba.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pSBilang", txtSBilang.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKRadio", txtRadio.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKAudio", txtSystem.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKKaraoke", txtKaraoke.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKPiano", txtKeyboard.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKCellphone", txtCp.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKTV", txtTV.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKVideoP", txtVideoP.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKCam", txtCamcorder.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKWood", txtWood.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKKerosene", txtKerosene.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKLPG", txtStove.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKGas", txtGas.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKEStove", txtElectric.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKERange", txtElectricCooking.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKMicrowave", txtOven.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKRef", txtRef.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKFreezer", txtFreezer.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKWashing", txtWashing.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKHeated", txtDryer.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKAircon", txtAirCon.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKEFan", txtFan.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKETank", txtTank.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKEHeater", txtHeater.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKCompute", txtComputer.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKLaptop", txtLaptop.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKSystem", txtGameSystem.Text)
              cmdAddPersonInfo.Parameters.AddWithValue("@pKFlatI", txtFlatiron.Text)
  
              Dim dAdapter As New SqlDataAdapter(cmdAddPersonInfo)
              dAdapter.Fill(AccountDS)
              MsgBox("Information Successfuly Added")
              frm_MonitoringReg.Close()
              Me.Close()
              Monitoring.Show()
          End If
      End If
  </code></pre>
  
  <p>But when I try to save it I get an error in line </p>
  
  <pre><code> Dim dAdapter As New SqlDataAdapter(cmdAddPersonInfo)
              dAdapter.Fill(AccountDS)
  </code></pre>
  
  <p>The error says "No mapping exists from object type System.Windows.Forms.TextBox to a known managed provider native type.". The first time I tried to input the program it successfully input but only until the table "createby" so I try to find why it stops there but I failed to find it and this error pops out of nowhere. I don't know what to do anymore.</p>