ClassyLinks
asked on
Error message: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
I have a form written in ASP.NET that adds a record to a SQL table via a stored procedure. There are 116 fields that get collected and passed back to the stored procedure to be inserted into the table. I thought I have worked out all the bugs, but when I fill out the form and submit it, I get the strange error "Index (zero based) must be greater than or equal to zero and less than the size of the argument list." The line errors when I execute the stored procedure. I am at my wits end and cannot find the problem. Sorry about all the variables but It was the only way I knew to make it work. Here's the ASP.NET code:
'RegionID = Session("RegionID")
RegionID = 1
If Not IsPostBack then
ClientID = request.querystring("id")
BindDataGrid(ClientID)
End IF
End Sub
Sub Button_Click(s AS Object, e As DataGridCommandEventArgs)
dim AppNum as textbox = Ctype(e.item.findcontrol(" AppNum"), textbox)
dim ClientSIN as textbox = Ctype(e.item.findcontrol(" ClientSIN" ), textbox)
dim Address as textbox = Ctype(e.item.findcontrol(" Address"), textbox)
dim City as textbox = Ctype(e.item.findcontrol(" City"), textbox)
dim Postal as textbox = Ctype(e.item.findcontrol(" Postal"), textbox)
dim Phone as textbox = Ctype(e.item.findcontrol(" Phone"), textbox)
dim Phone2 as textbox = Ctype(e.item.findcontrol(" Phone2"), textbox)
dim DateCreated as textbox = Ctype(e.item.findcontrol(" DateCreate d"), textbox)
dim DateRecv as textbox = Ctype(e.item.findcontrol(" DateRecv") , textbox)
dim FirstApp as radiobuttonlist = Ctype(e.item.findcontrol(" FirstApp") , radiobuttonlist)
dim FirstAppDate as textbox = Ctype(e.item.findcontrol(" FirstAppDa te"), textbox)
dim Agency_ID as textbox = Ctype(e.item.findcontrol(" Agency_ID" ), textbox)
dim AmountR as textbox = Ctype(e.item.findcontrol(" AmountR"), textbox)
dim AmountF as textbox = Ctype(e.item.findcontrol(" AmountF"), textbox)
dim Approved as Checkbox = Ctype(e.item.findcontrol(" Approved") , Checkbox)
dim ReasonRent as checkbox = Ctype(e.item.findcontrol(" ReasonRent "), checkbox)
dim ReasonUtil as checkbox = Ctype(e.item.findcontrol(" ReasonUtil "), checkbox)
dim ReasonStart as checkbox = Ctype(e.item.findcontrol(" ReasonStar t"),checkb ox)
dim ChqPayName as textbox = Ctype(e.item.findcontrol(" ChqPayName "), textbox)
dim ChqPayAddress as textbox = Ctype(e.item.findcontrol(" ChqPayAddr ess"), textbox)
dim ChqPayCity as textbox = Ctype(e.item.findcontrol(" ChqPayCity "), textbox)
dim ChqPayPostal as textbox = Ctype(e.item.findcontrol(" ChqPayPost al"), textbox)
dim ChqPayPhone as textbox = Ctype(e.item.findcontrol(" ChqPayPhon e"), textbox)
dim ChqPayFax as textbox = Ctype(e.item.findcontrol(" ChqPayFax" ), textbox)
dim Explaination as textbox = Ctype(e.item.findcontrol(" Explainati on"), textbox)
dim OtherAsst1 as textbox = Ctype(e.item.findcontrol(" OtherAsst1 "), textbox)
dim OtherAsst2 as textbox = Ctype(e.item.findcontrol(" OtherAsst2 "), textbox)
dim OtherAsst3 as textbox = Ctype(e.item.findcontrol(" OtherAsst3 "), textbox)
dim Maintain as textbox = Ctype(e.item.findcontrol(" Maintain") , textbox)
dim Repayment as textbox = Ctype(e.item.findcontrol(" Repayment" ), textbox)
dim NegotiatePay as textbox = Ctype(e.item.findcontrol(" NegotiateP ay"), textbox)
dim PlaceEmploy1 as textbox = Ctype(e.item.findcontrol(" PlaceEmplo y1"), textbox)
dim Income1 as textbox = Ctype(e.item.findcontrol(" Income1"), textbox)
dim PlaceEmploy2 as textbox = Ctype(e.item.findcontrol(" PlaceEmplo y2"), textbox)
dim Income2 as textbox = Ctype(e.item.findcontrol(" Income2"), textbox)
dim IncomeOW as textbox = Ctype(e.item.findcontrol(" IncomeOW") , textbox)
dim IncomeChild as textbox = Ctype(e.item.findcontrol(" IncomeChil d"), textbox)
dim IncomeOther as textbox = Ctype(e.item.findcontrol(" IncomeOthe r"), textbox)
dim IncomeSupport as textbox = Ctype(e.item.findcontrol(" IncomeSupp ort"), textbox)
dim IncomeOldAge as textbox = Ctype(e.item.findcontrol(" IncomeOldA ge"), textbox)
dim TotalMonthIncome as textbox = Ctype(e.item.findcontrol(" TotalMonth Income"), textbox)
dim ExpRentMort as textbox = Ctype(e.item.findcontrol(" ExpRentMor t"), textbox)
dim ExpElec as textbox = Ctype(e.item.findcontrol(" ExpElec"), textbox)
dim ExpHeat as textbox = Ctype(e.item.findcontrol(" ExpHeat"), textbox)
dim ExpWaterSew as textbox = Ctype(e.item.findcontrol(" ExpWaterSe w"), textbox)
dim ExpPhone as textbox = Ctype(e.item.findcontrol(" ExpPhone") , textbox)
dim ExpCable as textbox = Ctype(e.item.findcontrol(" ExpCable") , textbox)
dim ExpCar as textbox = Ctype(e.item.findcontrol(" ExpCar"), textbox)
dim ExpLoansCC as textbox = Ctype(e.item.findcontrol(" ExpLoansCC "), textbox)
dim ExpOther as textbox = Ctype(e.item.findcontrol(" ExpOther") , textbox)
dim OweRentMort as textbox = Ctype(e.item.findcontrol(" OweRentMor t"), textbox)
dim OweElec as textbox = Ctype(e.item.findcontrol(" OweElec"), textbox)
dim OweHeat as textbox = Ctype(e.item.findcontrol(" OweHeat"), textbox)
dim OweWaterSew as textbox = Ctype(e.item.findcontrol(" OweWaterSe w"), textbox)
dim OwePhone as textbox = Ctype(e.item.findcontrol(" OwePhone") , textbox)
dim OweCable as textbox = Ctype(e.item.findcontrol(" OweCable") , textbox)
dim OweCar as textbox = Ctype(e.item.findcontrol(" OweCar"), textbox)
dim OweLoansCC as textbox = Ctype(e.item.findcontrol(" OweLoansCC "), textbox)
dim OweOther as textbox = Ctype(e.item.findcontrol(" OweOther") , textbox)
dim TotalOwing as textbox = Ctype(e.item.findcontrol(" TotalOwing "), textbox)
dim TotalMonthly as textbox = Ctype(e.item.findcontrol(" TotalMonth ly"), textbox)
dim TotalIncome as textbox = Ctype(e.item.findcontrol(" TotalIncom e"), textbox)
dim TotalExpenses as textbox = Ctype(e.item.findcontrol(" TotalExpen ses"), textbox)
dim MonthlyBalance as textbox = Ctype(e.item.findcontrol(" MonthlyBal ance"), textbox)
dim PresentAddress as textbox = Ctype(e.item.findcontrol(" PresentAdd ress"), textbox)
dim PresentCity as textbox = Ctype(e.item.findcontrol(" PresentCit y"), textbox)
dim PresentPostal as textbox = Ctype(e.item.findcontrol(" PresentPos tal"), textbox)
dim PresentLL as textbox = Ctype(e.item.findcontrol(" PresentLL" ), textbox)
dim PresLLAddress as textbox = Ctype(e.item.findcontrol(" PresLLAddr ess"), textbox)
dim PresLLCity as textbox = Ctype(e.item.findcontrol(" PresLLCity "), textbox)
dim PresLLPostal as textbox = Ctype(e.item.findcontrol(" PresLLPost al"), textbox)
dim PresLLPhone as textbox = Ctype(e.item.findcontrol(" PresLLPhon e"), textbox)
dim PresentUtil as textbox = Ctype(e.item.findcontrol(" PresentUti l"), textbox)
dim PresentRent as textbox = Ctype(e.item.findcontrol(" PresentRen t"), textbox)
dim PresentTime as textbox = Ctype(e.item.findcontrol(" PresentTim e"), textbox)
dim FutureAddress as textbox = Ctype(e.item.findcontrol(" FutureAddr ess"), textbox)
dim FutureCity as textbox = Ctype(e.item.findcontrol(" FutureCity "), textbox)
dim FuturePostal as textbox = Ctype(e.item.findcontrol(" FuturePost al"), textbox)
dim FutureLL as textbox = Ctype(e.item.findcontrol(" FutureLL") , textbox)
dim FutureLLAddress as textbox = Ctype(e.item.findcontrol(" FutureLLAd dress"), textbox)
dim FutureLLCity as textbox = Ctype(e.item.findcontrol(" FutureLLCi ty"), textbox)
dim FutureLLPostal as textbox = Ctype(e.item.findcontrol(" FutureLLPo stal"), textbox)
dim FutureLLPhone as textbox = Ctype(e.item.findcontrol(" FutureLLPh one"), textbox)
dim FutureUtil as textbox = Ctype(e.item.findcontrol(" FutureUtil "), textbox)
dim FutureRent as textbox = Ctype(e.item.findcontrol(" FutureRent "), textbox)
dim PrevAddress as textbox = Ctype(e.item.findcontrol(" PrevAddres s"), textbox)
dim PrevCity as textbox = Ctype(e.item.findcontrol(" PrevCity") , textbox)
dim PrevPostal as textbox = Ctype(e.item.findcontrol(" PrevPostal "), textbox)
dim PrevLL as textbox = Ctype(e.item.findcontrol(" PrevLL"), textbox)
dim PrevLLAddress as textbox = Ctype(e.item.findcontrol(" PrevLLAddr ess"), textbox)
dim PrevLLCity as textbox = Ctype(e.item.findcontrol(" PrevLLCity "), textbox)
dim PrevLLPostal as textbox = Ctype(e.item.findcontrol(" PrevLLPost al"), textbox)
dim PrevLLPhone as textbox = Ctype(e.item.findcontrol(" PrevLLPhon e"), textbox)
dim HouseholdName1 as textbox = Ctype(e.item.findcontrol(" HouseholdN ame1"), textbox)
dim HouseholdAge1 as textbox = Ctype(e.item.findcontrol(" HouseholdA ge1"), textbox)
dim HouseholdRelation1 as textbox = Ctype(e.item.findcontrol(" HouseholdR elation1") , textbox)
dim HouseholdName2 as textbox = Ctype(e.item.findcontrol(" HouseholdN ame2"), textbox)
dim HouseholdAge2 as textbox = Ctype(e.item.findcontrol(" HouseholdA ge2"), textbox)
dim HouseholdRelation2 as textbox = Ctype(e.item.findcontrol(" HouseholdR elation2") , textbox)
dim HouseholdName3 as textbox = Ctype(e.item.findcontrol(" HouseholdN ame3"), textbox)
dim HouseholdAge3 as textbox = Ctype(e.item.findcontrol(" HouseholdA ge3"), textbox)
dim HouseholdRelation3 as textbox = Ctype(e.item.findcontrol(" HouseholdR elation3") , textbox)
dim HouseholdName4 as textbox = Ctype(e.item.findcontrol(" HouseholdN ame4"), textbox)
dim HouseholdAge4 as textbox = Ctype(e.item.findcontrol(" HouseholdA ge4"), textbox)
dim HouseholdRelation4 as textbox = Ctype(e.item.findcontrol(" HouseholdR elation4") , textbox)
dim HouseholdName5 as textbox = Ctype(e.item.findcontrol(" HouseholdN ame5"), textbox)
dim HouseholdAge5 as textbox = Ctype(e.item.findcontrol(" HouseholdA ge5"), textbox)
dim HouseholdRelation5 as textbox = Ctype(e.item.findcontrol(" HouseholdR elation5") , textbox)
dim HouseholdName6 as textbox = Ctype(e.item.findcontrol(" HouseholdN ame6"), textbox)
dim HouseholdAge6 as textbox = Ctype(e.item.findcontrol(" HouseholdA ge6"), textbox)
dim HouseholdRelation6 as textbox = Ctype(e.item.findcontrol(" HouseholdR elation6") , textbox)
dim HousingLivable as textbox = Ctype(e.item.findcontrol(" HousingLiv able"), textbox)
dim Evicted as textbox = Ctype(e.item.findcontrol(" Evicted"), textbox)
dim RelateLL as textbox = Ctype(e.item.findcontrol(" RelateLL") , textbox)
dim OtherInfo as textbox = Ctype(e.item.findcontrol(" OtherInfo" ), textbox)
dim Consent as checkbox = Ctype(e.item.findcontrol(" Consent"), checkbox)
dim strAppNum as Integer
dim strClientSIN As Integer
dim strAddress As String
dim strCity As String
dim strPostal As String
dim strPhone As String
dim strPhone2 As String
dim strDateCreated as datetime
dim strDateRecv as datetime
dim strFirstApp As integer
dim strFirstAppDate as string
dim strAgency_ID as String
dim strAmountR as integer
dim strAmountF as integer
dim strApproved as integer
dim strReasonRent as String
dim strReasonUtil as String
dim strReasonStart as String
dim strChqPayName as String
dim strChqPayAdress as String
dim strChqPayCity as String
dim strChqPayPostal as String
dim strChqPayPhone as String
dim strChqPayFax as String
dim strExplaination as String
dim strOtherAsst1 as String
dim strOtherAsst2 as String
dim strOtherAsst3 as String
dim strMaintain as String
dim strRepayment as String
dim strNegotiatePay as String
dim strPlaceEmploy1 as String
dim strIncome1 as integer
dim strPlaceEmploy2 as String
dim strIncome2 as integer
dim strIncomeOW as integer
dim strIncomeChild as integer
dim strIncomeOther as integer
dim strIncomeSupport as integer
dim strIncomeOldAge as integer
dim strTotalMonthIncome as integer
dim strExpRentMort as integer
dim strExpElect as integer
dim strExpHeat as integer
dim strExpWaterSew as integer
dim strExpPhone as integer
dim strExpCable as integer
dim strExpCar as integer
dim strExpLoansCC as integer
dim strExpOther as integer
dim strOweRentMort as integer
dim strOweElect as integer
dim strOweHeat as integer
dim strOweWaterSew as integer
dim strOwePhone as integer
dim strOweCable as integer
dim strOweCar as integer
dim strOweLoansCC as integer
dim strOweOther as integer
dim strTotalOwing as integer
dim strTotalMonthly as integer
dim strTotalIncome as integer
dim strTotalExpenses as integer
dim strMonthlyBalance as integer
dim strPresentAddress as string
dim strPresentCity as string
dim strPresentPostal as string
dim strPresentLL as string
dim strPresLLAddress as string
dim strPresLLCity as string
dim strPresLLPostal as string
dim strPresLLPhone as string
dim strPresentUtil as integer
dim strPresentRent as integer
dim strPresentTime as string
dim strFutureAddress as string
dim strFutureCity as string
dim strFuturePostal as string
dim strFutureLL as string
dim strFutureLLAddress as string
dim strFutureLLCity as string
dim strFutureLLPostal as string
dim strFutureLLPhone as string
dim strFutureUtil as integer
dim strFutureRent as integer
dim strPrevAddress as string
dim strPrevCity as string
dim strPrevPostal as string
dim strPrevLL as string
dim strPrevLLAddress as string
dim strPrevLLCity as string
dim strPrevLLPostal as string
dim strPrevLLPhone as string
dim strHouseholdName1 as string
dim strHouseholdAge1 as integer
dim strHouseholdRelation1 as string
dim strHouseholdName2 as string
dim strHouseholdAge2 as integer
dim strHouseholdRelation2 as string
dim strHouseholdName3 as string
dim strHouseholdAge3 as integer
dim strHouseholdRelation3 as string
dim strHouseholdName4 as string
dim strHouseholdAge4 as integer
dim strHouseholdRelation4 as string
dim strHouseholdName5 as string
dim strHouseholdAge5 as integer
dim strHouseholdRelation5 as string
dim strHouseholdName6 as string
dim strHouseholdAge6 as integer
dim strHouseholdRelation6 as string
dim strHousingLivable as string
dim strEvicted as string
dim strRelateLL as string
dim strOtherInfo as string
dim strconsent as integer
strAppNum=AppNum.text
strClientSIN = ClientSIN.text
strAddress = Address.text
strCity = City.text
strPostal = Postal.text
strPhone = Phone.text
strPhone2 = Phone2.text
strDateCreated = DateCreated.text
strDateRecv = DateRecv.text
strFirstApp = FirstApp.selecteditem.valu e
strFirstAppDate = FirstAppDate.text
strAgency_ID= Agency_ID.text
strAmountR = AmountR.text
strAmountF = AmountF.text
strApproved = Approved.checked
strReasonRent = ReasonRent.checked
strReasonUtil = ReasonUtil.checked
strReasonStart = ReasonStart.checked
strChqPayName = ChqPayName.text
strChqPayAdress = ChqPayAddress.text
strChqPayCity = ChqPayCity.text
strChqPayPostal = ChqPayPostal.text
strChqPayPhone = ChqPayPhone.text
strChqPayFax = ChqPayFax.text
strExplaination = Explaination.text
strOtherAsst1 = OtherAsst1.text
strOtherAsst2 = OtherAsst2.text
strOtherAsst3 = OtherAsst3.text
strMaintain = Maintain.text
strRepayment = Repayment.text
strNegotiatePay = NegotiatePay.text
strPlaceEmploy1 = PlaceEmploy1.text
strIncome1 = Income1.text
strPlaceEmploy2 = PlaceEmploy2.text
strIncome2 = Income2.text
strIncomeOW = IncomeOW.text
strIncomeChild = IncomeChild.text
strIncomeOther = IncomeOther.text
strIncomeSupport = IncomeSupport.text
strIncomeOldAge = IncomeOldAge.text
strTotalMonthIncome = TotalMonthIncome.text
strExpRentMort = ExpRentMort.text
strExpElect = ExpElec.text
strExpHeat = ExpHeat.text
strExpWaterSew = ExpWaterSew.text
strExpPhone = ExpPhone.text
strExpCable = ExpCable.text
strExpCar = ExpCar.text
strExpLoansCC = ExpLoansCC.text
strExpOther = ExpOther.text
strOweRentMort = OweRentMort.text
strOweElect = OweElec.text
strOweHeat = OweHeat.text
strOweWaterSew = OweWaterSew.text
strOwePhone = OwePhone.text
strOweCable = OweCable.text
strOweCar = OweCar.text
strOweLoansCC = OweLoansCC.text
strOweOther = OweOther.text
strTotalOwing=TotalOwing.t ext
strTotalMonthly =TotalMonthly.text
strTotalIncome =TotalIncome.text
strTotalExpenses =TotalExpenses.text
strMonthlyBalance =MonthlyBalance.text
strPresentAddress =PresentAddress.text
strPresentCity =PresentCity.text
strPresentPostal=PresentPo stal.text
strPresentLL =PresentLL.text
strPresLLAddress=PresLLAdd ress.text
strPresLLCity =PresLLCity.text
strPresLLPostal=PresLLPost al.text
strPresLLPhone=PresLLPhone .text
strPresentUtil=PresentUtil .text
strPresentRent=PresentRent .text
strPresentTime=PresentTime .text
strFutureAddress=FutureAdd ress.text
strFutureCity =FutureCity.text
strFuturePostal=FuturePost al.text
strFutureLL=FutureLL.text
strFutureLLAddress=FutureL LAddress.t ext
strFutureLLCity =FutureLLCity.text
strFutureLLPostal=FutureLL Postal.tex t
strFutureLLPhone =FutureLLPhone.text
strFutureUtil=FutureUtil.t ext
strFutureRent =FutureRent.text
strPrevAddress =PrevAddress.text
strPrevCity=PrevCity.text
strPrevPostal=PrevPostal.t ext
strPrevLL =PrevLL.text
strPrevLLAddress=PrevLLAdd ress.text
strPrevLLCity =PrevLLCity.text
strPrevLLPostal=PrevLLPost al.text
strPrevLLPhone =PrevLLPhone.text
strHouseholdName1=Househol dName1.tex t
strHouseholdAge1 =HouseholdAge1.text
strHouseholdRelation1 =HouseholdRelation1.text
strHouseholdName2 =HouseholdName2.text
strHouseholdAge2 =HouseholdAge2.text
strHouseholdRelation2 =HouseholdRelation2.text
strHouseholdName3 =HouseholdName3.text
strHouseholdAge3 =HouseholdAge3.text
strHouseholdRelation3 =HouseholdRelation3.text
strHouseholdName4 =HouseholdName4.text
strHouseholdAge4 =HouseholdAge4.text
strHouseholdRelation4 =HouseholdRelation4.text
strHouseholdName5 =HouseholdName5.text
strHouseholdAge5 =HouseholdAge5.text
strHouseholdRelation5 =HouseholdRelation5.text
strHouseholdName6 =HouseholdName6.text
strHouseholdAge6 =HouseholdAge6.text
strHouseholdRelation6 =HouseholdRelation6.text
strHousingLivable = HousingLivable.text
strEvicted = Evicted.text
strRelateLL = RelateLL.text
strOtherInfo = OtherInfo.text
strconsent = consent.checked
if strreasonrent = "0n" then
strreasonrent = 1
else
strreasonrent = 0
end if
if strreasonUtil = "0n" then
strreasonutil = 1
else
strreasonutil = 0
end if
if strreasonStart = "0n" then
strreasonstart = 1
else
strreasonstart = 0
end if
dim cmd As oledbCommand
cmd = New oledbCommand("sp_FlexFund_ new", Connect2)
cmd.CommandType = CommandType.StoredProcedur e
cmd.Parameters.Add("@Clien tAppID", strAppNum)
cmd.Parameters.Add("@Clien tSIN", strClientSIN)
cmd.Parameters.Add("@Addre ss", strAddress)
cmd.Parameters.Add("@City" , strCity)
cmd.Parameters.Add("@Posta l", strPostal)
cmd.Parameters.Add("@Phone ", strPhone)
cmd.Parameters.Add("@Phone 2", strPhone2)
cmd.Parameters.Add("@DateC reated", strDateCreated)
cmd.Parameters.Add("@DateR ecv", strDateRecv)
cmd.Parameters.Add("@First App", strFirstApp)
cmd.Parameters.Add("@First AppDate", strFirstAppDate)
cmd.Parameters.Add("@Agenc y_ID",strA gency_ID)
cmd.Parameters.Add("@Amoun tR", strAmountR)
cmd.Parameters.Add("@Amoun tF", strAmountF)
cmd.Parameters.Add("@Appro ved", strApproved)
cmd.Parameters.Add("@Reaso nRent", strReasonRent)
cmd.Parameters.Add("@Reaso nUtil", strReasonUtil)
cmd.Parameters.Add("@Reaso nStart", strReasonStart)
cmd.Parameters.Add("@ChqPa yName", strChqPayName)
cmd.Parameters.Add("@ChqPa yAddress", strChqPayAdress)
cmd.Parameters.Add("@ChqPa yCity", strChqPayCity)
cmd.Parameters.Add("@ChqPa yPostal", strChqPayPostal)
cmd.Parameters.Add("@ChqPa yPhone", strChqPayPhone)
cmd.Parameters.Add("@ChqPa yFax", strChqPayFax)
cmd.Parameters.Add("@Expla ination", strExplaination)
cmd.Parameters.Add("@Other Asst1", strOtherAsst1)
cmd.Parameters.Add("@Other Asst2", strOtherAsst2)
cmd.Parameters.Add("@Other Asst3", strOtherAsst3)
cmd.Parameters.Add("@Maint ain", strMaintain)
cmd.Parameters.Add("@Repay ment", strRepayment)
cmd.Parameters.Add("@Negot iatePay", strNegotiatePay)
cmd.Parameters.Add("@Place Employ1", strPlaceEmploy1)
cmd.Parameters.Add("@Incom e1", strIncome1)
cmd.Parameters.Add("@Place Employ2", strPlaceEmploy2)
cmd.Parameters.Add("@Incom e2", strIncome2)
cmd.Parameters.Add("@Incom eOW", strIncomeOW)
cmd.Parameters.Add("@Incom eChild", strIncomeChild)
cmd.Parameters.Add("@Incom eOther", strIncomeOther)
cmd.Parameters.Add("@Incom eSupport", strIncomeSupport)
cmd.Parameters.Add("@Incom eOldAge", strIncomeOldAge)
cmd.Parameters.Add("@Total MonthlyInc ome", strTotalMonthIncome)
cmd.Parameters.Add("@ExpRe ntMort", strExpRentMort)
cmd.Parameters.Add("@ExpEl ec", strExpElect)
cmd.Parameters.Add("@ExpHe at", strExpHeat)
cmd.Parameters.Add("@ExpWa terSew", strExpWaterSew)
cmd.Parameters.Add("@ExpPh one", strExpPhone)
cmd.Parameters.Add("@ExpCa ble", strExpCable)
cmd.Parameters.Add("@ExpCa r", strExpCar)
cmd.Parameters.Add("@ExpLo ansCC", strExpLoansCC)
cmd.Parameters.Add("@ExpOt her", strExpOther)
cmd.Parameters.Add("@OweRe ntMort", strOweRentMort)
cmd.Parameters.Add("@OweEl ec", strOweElect)
cmd.Parameters.Add("@OweHe at", strOweHeat)
cmd.Parameters.Add("@OweWa terSew", strOweWaterSew)
cmd.Parameters.Add("@OwePh one", strOwePhone)
cmd.Parameters.Add("@OweCa ble", strOweCable)
cmd.Parameters.Add("@OweCa r", strOweCar)
cmd.Parameters.Add("@OweLo ansCC", strOweLoansCC)
cmd.Parameters.Add("@OweOt her", strOweOther)
cmd.Parameters.Add("@Total Owing1",st rTotalOwin g)
cmd.Parameters.Add("@Total Monthly",s trTotalMon thly)
cmd.Parameters.Add("@Total Income",st rTotalInco me)
cmd.Parameters.Add("@Total Expenses", strTotalEx penses)
cmd.Parameters.Add("@Month lyBalance" ,strMonthl yBalance)
cmd.Parameters.Add("@Prese ntAddress" ,strPresen tAddress)
cmd.Parameters.Add("@Prese ntCity",st rPresentCi ty)
cmd.Parameters.Add("@Prese ntPostal", strPresent Postal)
cmd.Parameters.Add("@Prese ntLL",strP resentLL)
cmd.Parameters.Add("@PresL LAddress", strPresLLA ddress)
cmd.Parameters.Add("@PresL LCity",str PresLLCity )
cmd.Parameters.Add("@PresL LPostal",s trPresLLPo stal)
cmd.Parameters.Add("@PresL LPhone",st rPresLLPho ne)
cmd.Parameters.Add("@Prese ntUtil",st rPresentUt il)
cmd.Parameters.Add("@Prese ntRent",st rPresentRe nt)
cmd.Parameters.Add("@Prese ntTime",st rPresentTi me)
cmd.Parameters.Add("@Futur eAddress", strFutureA ddress)
cmd.Parameters.Add("@Futur eCity",str FutureCity )
cmd.Parameters.Add("@Futur ePostal",s trFuturePo stal)
cmd.Parameters.Add("@Futur eLL",strFu tureLL)
cmd.Parameters.Add("@Futur eLLAddress ",strFutur eLLAddress )
cmd.Parameters.Add("@Futur eLLCity",s trFutureLL City)
cmd.Parameters.Add("@Futur eLLPostal" ,strFuture LLPostal)
cmd.Parameters.Add("@Futur eLLPhone", strFutureL LPhone)
cmd.Parameters.Add("@Futur eUtil",str FutureUtil )
cmd.Parameters.Add("@Futur eRent",str FutureRent )
cmd.Parameters.Add("@PrevA ddress",st rPrevAddre ss)
cmd.Parameters.Add("@PrevC ity",strPr evCity)
cmd.Parameters.Add("@PrevP ostal",str PrevPostal )
cmd.Parameters.Add("@PrevL L",strPrev LL)
cmd.Parameters.Add("@PrevL LAddress", strPrevLLA ddress)
cmd.Parameters.Add("@PrevL LCity",str PrevLLCity )
cmd.Parameters.Add("@PrevL LPostal",s trPrevLLPo stal)
cmd.Parameters.Add("@PrevL LPhone",st rPrevLLPho ne)
cmd.Parameters.Add("@House holdName1" ,strHouseh oldName1)
cmd.Parameters.Add("@House holdAge1", strHouseho ldAge1)
cmd.Parameters.Add("@House holdRelati on1",strHo useholdRel ation1)
cmd.Parameters.Add("@House holdName2" ,strHouseh oldName2)
cmd.Parameters.Add("@House holdAge2", strHouseho ldAge2)
cmd.Parameters.Add("@House holdRelati on2",strHo useholdRel ation2)
cmd.Parameters.Add("@House holdName3" ,strHouseh oldName3)
cmd.Parameters.Add("@House holdAge3", strHouseho ldAge3)
cmd.Parameters.Add("@House holdRelati on3",strHo useholdRel ation3)
cmd.Parameters.Add("@House holdName4" ,strHouseh oldName4)
cmd.Parameters.Add("@House holdAge4", strHouseho ldAge4)
cmd.Parameters.Add("@House holdRelati on4",strHo useholdRel ation4)
cmd.Parameters.Add("@House holdName5" ,strHouseh oldName5)
cmd.Parameters.Add("@House holdAge5", strHouseho ldAge5)
cmd.Parameters.Add("@House holdRelati on5",strHo useholdRel ation5)
cmd.Parameters.Add("@House holdName6" ,strHouseh oldName6)
cmd.Parameters.Add("@House holdAge6", strHouseho ldAge6)
cmd.Parameters.Add("@House holdRelati on6",strHo useholdRel ation6)
cmd.Parameters.Add("@Housi ngLivable" , HousingLivable)
cmd.Parameters.Add("@Evict ed", Evicted)
cmd.Parameters.Add("@Relat eLL", RelateLL)
cmd.Parameters.Add("@Other Info", OtherInfo)
cmd.Parameters.Add("@Conse nt", Consent)
connect2.open()
cmd.ExecuteNonQuery()
connect2.close()
response.redirect("../_adm in/clients /adminclie nts.aspx")
End Sub
Sub BindDataGrid(ClientID AS Integer)
dim GetContactCommand AS OleDBcommand= New OleDBCommand("Select * FROM tblclients WHERE tblClients.ApplicationID=" & ClientID, Connect2)
Dim Adapter AS OleDBDataAdapter = new OleDBDataAdapter
Adapter.Selectcommand = getContactCommand
Adapter.SelectCommand.Conn ection.Ope n
dim ContactDS AS DataSet = New DataSet
Adapter.Fill(ContactDS, "Contact")
ContactGrid.DataSource = ContactDS
Page.dataBind()
End Sub
and the stored procedure:
CREATE procedure dbo.sp_FlexFund_new (
@ClientAppID int,
@ClientSIN int,
@Address varchar (100),
@City char (20),
@Postal char (7),
@Phone char (12),
@Phone2 char (12),
@DateCreated datetime,
@DateRecv datetime,
@FirstApp bit,
@FirstAppDate datetime,
@Agency_ID varchar(50),
@AmountR int,
@AmountF int,
@Approved bit,
@ReasonRent bit,
@ReasonUtil bit,
@ReasonStart bit,
@ChqPayName char (20),
@ChqPayAddress varchar (50),
@ChqPayCity char (20),
@ChqPayPostal char (6),
@ChqPayPhone char (18),
@ChqPayFax char (18),
@Explaination varchar (50),
@OtherAsst1 varchar (50),
@OtherAsst2 varchar (50),
@OtherAsst3 varchar (50),
@Maintain varchar (50),
@Repayment varchar (50),
@NegotiatePay varchar (50),
@PlaceEmploy1 text,
@Income1 int,
@PlaceEmploy2 text,
@Income2 int,
@IncomeOW int,
@IncomeChild int,
@IncomeOther int,
@IncomeSupport int,
@IncomeOldAge int,
@TotalMonthlyIncome int,
@ExpRentMort int,
@ExpElec int,
@ExpHeat int,
@ExpWaterSew int,
@ExpPhone int,
@ExpCable int,
@ExpCar int,
@ExpLoansCC int,
@ExpOther int,
@OweRentMort int,
@OweElec int,
@OweHeat int,
@OweWaterSew int,
@OwePhone int,
@OweCable int,
@OweCar int,
@OweLoansCC int,
@OweOther int,
@TotalOwing int,
@TotalMonthly int,
@TotalIncome int,
@TotalExpenses int,
@MonthlyBalance int,
@PresentAddress varchar (50),
@PresentCity varchar (50),
@PresentPostal varchar (50),
@PresentLL varchar (50),
@PresLLAddress varchar (50),
@PresLLCity varchar (50),
@PresLLPostal varchar (50),
@PresLLPhone text,
@PresentUtil int,
@PresentRent int,
@PresentTime char (10),
@FutureAddress varchar (50),
@FutureCity char (10),
@FuturePostal char (10),
@FutureLL char (10),
@FutureLLAddress char (10),
@FutureLLCity char (10),
@FutureLLPostal char (10),
@FutureLLPhone char (10),
@FutureUtil int,
@FutureRent int,
@PrevAddress char (10),
@PrevCity char (10),
@PrevPostal char (10),
@PrevLL char (10),
@PrevLLAddress char (10),
@PrevLLCity char (10),
@PrevLLPostal char (10),
@PrevLLPhone char (10),
@HouseholdName1 char (10),
@HouseholdAge1 int,
@HouseholdRelation1 char (10),
@HouseholdName2 char (10),
@HouseholdAge2 int,
@HouseholdRelation2 char (10),
@HouseholdName3 char (10),
@HouseholdAge3 int,
@HouseholdRelation3 char (10),
@HouseholdName4 char (10),
@HouseholdAge4 int,
@HouseholdRelation4 char (10),
@HouseholdName5 char (10),
@HouseholdAge5 int,
@HouseholdRelation5 char (10),
@HouseholdName6 char (10),
@HouseholdAge6 int,
@HouseholdRelation6 char (10),
@HousingLivable varchar (50),
@Evicted varchar (50),
@RelateLL varchar (50),
@OtherInfo varchar (50),
@Consent bit
)
AS
SET NOCOUNT ON
insert into tblFlexFund(
ClientSIN,
ClientAppID,
Address,
City,
Postal,
Phone,
Phone2,
DateCreated,
DateRecv,
FirstApp,
FirstAppDate,
Agency_ID,
AmountR,
AmountF,
Approved,
ReasonRent,
ReasonUtil,
ReasonStart,
ChqPayName,
ChqPayAddress,
ChqPayCity,
ChqPayPostal,
ChqPayPhone,
ChqPayFax,
Explaination,
OtherAsst1,
OtherAsst2,
OtherAsst3,
Maintain,
Repayment,
NegotiatePay,
PlaceEmploy1,
Income1,
PlaceEmploy2,
Income2,
IncomeOW,
IncomeChild,
IncomeOther,
IncomeSupport,
IncomeOldAge,
TotalMonthlyIncome,
ExpRentMort,
ExpElec,
ExpHeat,
ExpWaterSew,
ExpPhone,
ExpCable,
ExpCar,
ExpLoansCC,
ExpOther,
OweRentMort,
OweElec,
OweHeat,
OweWaterSew,
OwePhone,
OweCable,
OweCar,
OweLoansCC,
OweOther,
TotalOwing,
TotalMonthly,
TotalIncome,
TotalExpenses,
MonthlyBalance,
PresentAddress,
PresentCity,
PresentPostal,
PresentLL,
PresLLAddress,
PresLLCity,
PresLLPostal,
PresLLPhone,
PresentUtil,
PresentRent,
PresentTime,
FutureAddress,
FutureCity,
FuturePostal,
FutureLL,
FutureLLAddress,
FutureLLCity,
FutureLLPostal,
FutureLLPhone,
FutureUtil,
FutureRent,
PrevAddress,
PrevCity,
PrevPostal,
PrevLL,
PrevLLAddress,
PrevLLCity,
PrevLLPostal,
PrevLLPhone,
HouseholdName1,
HouseholdAge1,
HouseholdRelation1,
HouseholdName2,
HouseholdAge2,
HouseholdRelation2,
HouseholdName3,
HouseholdAge3,
HouseholdRelation3,
HouseholdName4,
HouseholdAge4,
HouseholdRelation4,
HouseholdName5,
HouseholdAge5,
HouseholdRelation5,
HouseholdName6,
HouseholdAge6,
HouseholdRelation6,
HousingLivable,
Evicted,
RelateLL,
OtherInfo,
consent
)
values(
@ClientSIN,
@ClientAppID,
@Address,
@City,
@Postal,
@Phone,
@Phone2,
@DateCreated,
@DateRecv,
@FirstApp,
@FirstAppDate,
@Agency_ID,
@AmountR,
@AmountF,
@Approved,
@ReasonRent,
@ReasonUtil,
@ReasonStart,
@ChqPayName,
@ChqPayAddress,
@ChqPayCity,
@ChqPayPostal,
@ChqPayPhone,
@ChqPayFax,
@Explaination,
@OtherAsst1,
@OtherAsst2,
@OtherAsst3,
@Maintain,
@Repayment,
@NegotiatePay,
@PlaceEmploy1,
@Income1,
@PlaceEmploy2,
@Income2,
@IncomeOW,
@IncomeChild,
@IncomeOther,
@IncomeSupport,
@IncomeOldAge,
@TotalMonthlyIncome,
@ExpRentMort,
@ExpElec,
@ExpHeat,
@ExpWaterSew,
@ExpPhone,
@ExpCable,
@ExpCar,
@ExpLoansCC,
@ExpOther,
@OweRentMort,
@OweElec,
@OweHeat,
@OweWaterSew,
@OwePhone,
@OweCable,
@OweCar,
@OweLoansCC,
@OweOther,
@TotalOwing,
@TotalMonthly,
@TotalIncome,
@TotalExpenses,
@MonthlyBalance,
@PresentAddress,
@PresentCity,
@PresentPostal,
@PresentLL,
@PresLLAddress,
@PresLLCity,
@PresLLPostal,
@PresLLPhone,
@PresentUtil,
@PresentRent,
@PresentTime,
@FutureAddress,
@FutureCity,
@FuturePostal,
@FutureLL,
@FutureLLAddress,
@FutureLLCity,
@FutureLLPostal,
@FutureLLPhone,
@FutureUtil,
@FutureRent,
@PrevAddress,
@PrevCity,
@PrevPostal,
@PrevLL,
@PrevLLAddress,
@PrevLLCity,
@PrevLLPostal,
@PrevLLPhone,
@HouseholdName1,
@HouseholdAge1,
@HouseholdRelation1,
@HouseholdName2,
@HouseholdAge2,
@HouseholdRelation2,
@HouseholdName3,
@HouseholdAge3,
@HouseholdRelation3,
@HouseholdName4,
@HouseholdAge4,
@HouseholdRelation4,
@HouseholdName5,
@HouseholdAge5,
@HouseholdRelation5,
@HouseholdName6,
@HouseholdAge6,
@HouseholdRelation6,
@HousingLivable,
@Evicted,
@RelateLL,
@OtherInfo,
@consent
)
set nocount off
GO
Thanks in advance for your help.
'RegionID = Session("RegionID")
RegionID = 1
If Not IsPostBack then
ClientID = request.querystring("id")
BindDataGrid(ClientID)
End IF
End Sub
Sub Button_Click(s AS Object, e As DataGridCommandEventArgs)
dim AppNum as textbox = Ctype(e.item.findcontrol("
dim ClientSIN as textbox = Ctype(e.item.findcontrol("
dim Address as textbox = Ctype(e.item.findcontrol("
dim City as textbox = Ctype(e.item.findcontrol("
dim Postal as textbox = Ctype(e.item.findcontrol("
dim Phone as textbox = Ctype(e.item.findcontrol("
dim Phone2 as textbox = Ctype(e.item.findcontrol("
dim DateCreated as textbox = Ctype(e.item.findcontrol("
dim DateRecv as textbox = Ctype(e.item.findcontrol("
dim FirstApp as radiobuttonlist = Ctype(e.item.findcontrol("
dim FirstAppDate as textbox = Ctype(e.item.findcontrol("
dim Agency_ID as textbox = Ctype(e.item.findcontrol("
dim AmountR as textbox = Ctype(e.item.findcontrol("
dim AmountF as textbox = Ctype(e.item.findcontrol("
dim Approved as Checkbox = Ctype(e.item.findcontrol("
dim ReasonRent as checkbox = Ctype(e.item.findcontrol("
dim ReasonUtil as checkbox = Ctype(e.item.findcontrol("
dim ReasonStart as checkbox = Ctype(e.item.findcontrol("
dim ChqPayName as textbox = Ctype(e.item.findcontrol("
dim ChqPayAddress as textbox = Ctype(e.item.findcontrol("
dim ChqPayCity as textbox = Ctype(e.item.findcontrol("
dim ChqPayPostal as textbox = Ctype(e.item.findcontrol("
dim ChqPayPhone as textbox = Ctype(e.item.findcontrol("
dim ChqPayFax as textbox = Ctype(e.item.findcontrol("
dim Explaination as textbox = Ctype(e.item.findcontrol("
dim OtherAsst1 as textbox = Ctype(e.item.findcontrol("
dim OtherAsst2 as textbox = Ctype(e.item.findcontrol("
dim OtherAsst3 as textbox = Ctype(e.item.findcontrol("
dim Maintain as textbox = Ctype(e.item.findcontrol("
dim Repayment as textbox = Ctype(e.item.findcontrol("
dim NegotiatePay as textbox = Ctype(e.item.findcontrol("
dim PlaceEmploy1 as textbox = Ctype(e.item.findcontrol("
dim Income1 as textbox = Ctype(e.item.findcontrol("
dim PlaceEmploy2 as textbox = Ctype(e.item.findcontrol("
dim Income2 as textbox = Ctype(e.item.findcontrol("
dim IncomeOW as textbox = Ctype(e.item.findcontrol("
dim IncomeChild as textbox = Ctype(e.item.findcontrol("
dim IncomeOther as textbox = Ctype(e.item.findcontrol("
dim IncomeSupport as textbox = Ctype(e.item.findcontrol("
dim IncomeOldAge as textbox = Ctype(e.item.findcontrol("
dim TotalMonthIncome as textbox = Ctype(e.item.findcontrol("
dim ExpRentMort as textbox = Ctype(e.item.findcontrol("
dim ExpElec as textbox = Ctype(e.item.findcontrol("
dim ExpHeat as textbox = Ctype(e.item.findcontrol("
dim ExpWaterSew as textbox = Ctype(e.item.findcontrol("
dim ExpPhone as textbox = Ctype(e.item.findcontrol("
dim ExpCable as textbox = Ctype(e.item.findcontrol("
dim ExpCar as textbox = Ctype(e.item.findcontrol("
dim ExpLoansCC as textbox = Ctype(e.item.findcontrol("
dim ExpOther as textbox = Ctype(e.item.findcontrol("
dim OweRentMort as textbox = Ctype(e.item.findcontrol("
dim OweElec as textbox = Ctype(e.item.findcontrol("
dim OweHeat as textbox = Ctype(e.item.findcontrol("
dim OweWaterSew as textbox = Ctype(e.item.findcontrol("
dim OwePhone as textbox = Ctype(e.item.findcontrol("
dim OweCable as textbox = Ctype(e.item.findcontrol("
dim OweCar as textbox = Ctype(e.item.findcontrol("
dim OweLoansCC as textbox = Ctype(e.item.findcontrol("
dim OweOther as textbox = Ctype(e.item.findcontrol("
dim TotalOwing as textbox = Ctype(e.item.findcontrol("
dim TotalMonthly as textbox = Ctype(e.item.findcontrol("
dim TotalIncome as textbox = Ctype(e.item.findcontrol("
dim TotalExpenses as textbox = Ctype(e.item.findcontrol("
dim MonthlyBalance as textbox = Ctype(e.item.findcontrol("
dim PresentAddress as textbox = Ctype(e.item.findcontrol("
dim PresentCity as textbox = Ctype(e.item.findcontrol("
dim PresentPostal as textbox = Ctype(e.item.findcontrol("
dim PresentLL as textbox = Ctype(e.item.findcontrol("
dim PresLLAddress as textbox = Ctype(e.item.findcontrol("
dim PresLLCity as textbox = Ctype(e.item.findcontrol("
dim PresLLPostal as textbox = Ctype(e.item.findcontrol("
dim PresLLPhone as textbox = Ctype(e.item.findcontrol("
dim PresentUtil as textbox = Ctype(e.item.findcontrol("
dim PresentRent as textbox = Ctype(e.item.findcontrol("
dim PresentTime as textbox = Ctype(e.item.findcontrol("
dim FutureAddress as textbox = Ctype(e.item.findcontrol("
dim FutureCity as textbox = Ctype(e.item.findcontrol("
dim FuturePostal as textbox = Ctype(e.item.findcontrol("
dim FutureLL as textbox = Ctype(e.item.findcontrol("
dim FutureLLAddress as textbox = Ctype(e.item.findcontrol("
dim FutureLLCity as textbox = Ctype(e.item.findcontrol("
dim FutureLLPostal as textbox = Ctype(e.item.findcontrol("
dim FutureLLPhone as textbox = Ctype(e.item.findcontrol("
dim FutureUtil as textbox = Ctype(e.item.findcontrol("
dim FutureRent as textbox = Ctype(e.item.findcontrol("
dim PrevAddress as textbox = Ctype(e.item.findcontrol("
dim PrevCity as textbox = Ctype(e.item.findcontrol("
dim PrevPostal as textbox = Ctype(e.item.findcontrol("
dim PrevLL as textbox = Ctype(e.item.findcontrol("
dim PrevLLAddress as textbox = Ctype(e.item.findcontrol("
dim PrevLLCity as textbox = Ctype(e.item.findcontrol("
dim PrevLLPostal as textbox = Ctype(e.item.findcontrol("
dim PrevLLPhone as textbox = Ctype(e.item.findcontrol("
dim HouseholdName1 as textbox = Ctype(e.item.findcontrol("
dim HouseholdAge1 as textbox = Ctype(e.item.findcontrol("
dim HouseholdRelation1 as textbox = Ctype(e.item.findcontrol("
dim HouseholdName2 as textbox = Ctype(e.item.findcontrol("
dim HouseholdAge2 as textbox = Ctype(e.item.findcontrol("
dim HouseholdRelation2 as textbox = Ctype(e.item.findcontrol("
dim HouseholdName3 as textbox = Ctype(e.item.findcontrol("
dim HouseholdAge3 as textbox = Ctype(e.item.findcontrol("
dim HouseholdRelation3 as textbox = Ctype(e.item.findcontrol("
dim HouseholdName4 as textbox = Ctype(e.item.findcontrol("
dim HouseholdAge4 as textbox = Ctype(e.item.findcontrol("
dim HouseholdRelation4 as textbox = Ctype(e.item.findcontrol("
dim HouseholdName5 as textbox = Ctype(e.item.findcontrol("
dim HouseholdAge5 as textbox = Ctype(e.item.findcontrol("
dim HouseholdRelation5 as textbox = Ctype(e.item.findcontrol("
dim HouseholdName6 as textbox = Ctype(e.item.findcontrol("
dim HouseholdAge6 as textbox = Ctype(e.item.findcontrol("
dim HouseholdRelation6 as textbox = Ctype(e.item.findcontrol("
dim HousingLivable as textbox = Ctype(e.item.findcontrol("
dim Evicted as textbox = Ctype(e.item.findcontrol("
dim RelateLL as textbox = Ctype(e.item.findcontrol("
dim OtherInfo as textbox = Ctype(e.item.findcontrol("
dim Consent as checkbox = Ctype(e.item.findcontrol("
dim strAppNum as Integer
dim strClientSIN As Integer
dim strAddress As String
dim strCity As String
dim strPostal As String
dim strPhone As String
dim strPhone2 As String
dim strDateCreated as datetime
dim strDateRecv as datetime
dim strFirstApp As integer
dim strFirstAppDate as string
dim strAgency_ID as String
dim strAmountR as integer
dim strAmountF as integer
dim strApproved as integer
dim strReasonRent as String
dim strReasonUtil as String
dim strReasonStart as String
dim strChqPayName as String
dim strChqPayAdress as String
dim strChqPayCity as String
dim strChqPayPostal as String
dim strChqPayPhone as String
dim strChqPayFax as String
dim strExplaination as String
dim strOtherAsst1 as String
dim strOtherAsst2 as String
dim strOtherAsst3 as String
dim strMaintain as String
dim strRepayment as String
dim strNegotiatePay as String
dim strPlaceEmploy1 as String
dim strIncome1 as integer
dim strPlaceEmploy2 as String
dim strIncome2 as integer
dim strIncomeOW as integer
dim strIncomeChild as integer
dim strIncomeOther as integer
dim strIncomeSupport as integer
dim strIncomeOldAge as integer
dim strTotalMonthIncome as integer
dim strExpRentMort as integer
dim strExpElect as integer
dim strExpHeat as integer
dim strExpWaterSew as integer
dim strExpPhone as integer
dim strExpCable as integer
dim strExpCar as integer
dim strExpLoansCC as integer
dim strExpOther as integer
dim strOweRentMort as integer
dim strOweElect as integer
dim strOweHeat as integer
dim strOweWaterSew as integer
dim strOwePhone as integer
dim strOweCable as integer
dim strOweCar as integer
dim strOweLoansCC as integer
dim strOweOther as integer
dim strTotalOwing as integer
dim strTotalMonthly as integer
dim strTotalIncome as integer
dim strTotalExpenses as integer
dim strMonthlyBalance as integer
dim strPresentAddress as string
dim strPresentCity as string
dim strPresentPostal as string
dim strPresentLL as string
dim strPresLLAddress as string
dim strPresLLCity as string
dim strPresLLPostal as string
dim strPresLLPhone as string
dim strPresentUtil as integer
dim strPresentRent as integer
dim strPresentTime as string
dim strFutureAddress as string
dim strFutureCity as string
dim strFuturePostal as string
dim strFutureLL as string
dim strFutureLLAddress as string
dim strFutureLLCity as string
dim strFutureLLPostal as string
dim strFutureLLPhone as string
dim strFutureUtil as integer
dim strFutureRent as integer
dim strPrevAddress as string
dim strPrevCity as string
dim strPrevPostal as string
dim strPrevLL as string
dim strPrevLLAddress as string
dim strPrevLLCity as string
dim strPrevLLPostal as string
dim strPrevLLPhone as string
dim strHouseholdName1 as string
dim strHouseholdAge1 as integer
dim strHouseholdRelation1 as string
dim strHouseholdName2 as string
dim strHouseholdAge2 as integer
dim strHouseholdRelation2 as string
dim strHouseholdName3 as string
dim strHouseholdAge3 as integer
dim strHouseholdRelation3 as string
dim strHouseholdName4 as string
dim strHouseholdAge4 as integer
dim strHouseholdRelation4 as string
dim strHouseholdName5 as string
dim strHouseholdAge5 as integer
dim strHouseholdRelation5 as string
dim strHouseholdName6 as string
dim strHouseholdAge6 as integer
dim strHouseholdRelation6 as string
dim strHousingLivable as string
dim strEvicted as string
dim strRelateLL as string
dim strOtherInfo as string
dim strconsent as integer
strAppNum=AppNum.text
strClientSIN = ClientSIN.text
strAddress = Address.text
strCity = City.text
strPostal = Postal.text
strPhone = Phone.text
strPhone2 = Phone2.text
strDateCreated = DateCreated.text
strDateRecv = DateRecv.text
strFirstApp = FirstApp.selecteditem.valu
strFirstAppDate = FirstAppDate.text
strAgency_ID= Agency_ID.text
strAmountR = AmountR.text
strAmountF = AmountF.text
strApproved = Approved.checked
strReasonRent = ReasonRent.checked
strReasonUtil = ReasonUtil.checked
strReasonStart = ReasonStart.checked
strChqPayName = ChqPayName.text
strChqPayAdress = ChqPayAddress.text
strChqPayCity = ChqPayCity.text
strChqPayPostal = ChqPayPostal.text
strChqPayPhone = ChqPayPhone.text
strChqPayFax = ChqPayFax.text
strExplaination = Explaination.text
strOtherAsst1 = OtherAsst1.text
strOtherAsst2 = OtherAsst2.text
strOtherAsst3 = OtherAsst3.text
strMaintain = Maintain.text
strRepayment = Repayment.text
strNegotiatePay = NegotiatePay.text
strPlaceEmploy1 = PlaceEmploy1.text
strIncome1 = Income1.text
strPlaceEmploy2 = PlaceEmploy2.text
strIncome2 = Income2.text
strIncomeOW = IncomeOW.text
strIncomeChild = IncomeChild.text
strIncomeOther = IncomeOther.text
strIncomeSupport = IncomeSupport.text
strIncomeOldAge = IncomeOldAge.text
strTotalMonthIncome = TotalMonthIncome.text
strExpRentMort = ExpRentMort.text
strExpElect = ExpElec.text
strExpHeat = ExpHeat.text
strExpWaterSew = ExpWaterSew.text
strExpPhone = ExpPhone.text
strExpCable = ExpCable.text
strExpCar = ExpCar.text
strExpLoansCC = ExpLoansCC.text
strExpOther = ExpOther.text
strOweRentMort = OweRentMort.text
strOweElect = OweElec.text
strOweHeat = OweHeat.text
strOweWaterSew = OweWaterSew.text
strOwePhone = OwePhone.text
strOweCable = OweCable.text
strOweCar = OweCar.text
strOweLoansCC = OweLoansCC.text
strOweOther = OweOther.text
strTotalOwing=TotalOwing.t
strTotalMonthly =TotalMonthly.text
strTotalIncome =TotalIncome.text
strTotalExpenses =TotalExpenses.text
strMonthlyBalance =MonthlyBalance.text
strPresentAddress =PresentAddress.text
strPresentCity =PresentCity.text
strPresentPostal=PresentPo
strPresentLL =PresentLL.text
strPresLLAddress=PresLLAdd
strPresLLCity =PresLLCity.text
strPresLLPostal=PresLLPost
strPresLLPhone=PresLLPhone
strPresentUtil=PresentUtil
strPresentRent=PresentRent
strPresentTime=PresentTime
strFutureAddress=FutureAdd
strFutureCity =FutureCity.text
strFuturePostal=FuturePost
strFutureLL=FutureLL.text
strFutureLLAddress=FutureL
strFutureLLCity =FutureLLCity.text
strFutureLLPostal=FutureLL
strFutureLLPhone =FutureLLPhone.text
strFutureUtil=FutureUtil.t
strFutureRent =FutureRent.text
strPrevAddress =PrevAddress.text
strPrevCity=PrevCity.text
strPrevPostal=PrevPostal.t
strPrevLL =PrevLL.text
strPrevLLAddress=PrevLLAdd
strPrevLLCity =PrevLLCity.text
strPrevLLPostal=PrevLLPost
strPrevLLPhone =PrevLLPhone.text
strHouseholdName1=Househol
strHouseholdAge1 =HouseholdAge1.text
strHouseholdRelation1 =HouseholdRelation1.text
strHouseholdName2 =HouseholdName2.text
strHouseholdAge2 =HouseholdAge2.text
strHouseholdRelation2 =HouseholdRelation2.text
strHouseholdName3 =HouseholdName3.text
strHouseholdAge3 =HouseholdAge3.text
strHouseholdRelation3 =HouseholdRelation3.text
strHouseholdName4 =HouseholdName4.text
strHouseholdAge4 =HouseholdAge4.text
strHouseholdRelation4 =HouseholdRelation4.text
strHouseholdName5 =HouseholdName5.text
strHouseholdAge5 =HouseholdAge5.text
strHouseholdRelation5 =HouseholdRelation5.text
strHouseholdName6 =HouseholdName6.text
strHouseholdAge6 =HouseholdAge6.text
strHouseholdRelation6 =HouseholdRelation6.text
strHousingLivable = HousingLivable.text
strEvicted = Evicted.text
strRelateLL = RelateLL.text
strOtherInfo = OtherInfo.text
strconsent = consent.checked
if strreasonrent = "0n" then
strreasonrent = 1
else
strreasonrent = 0
end if
if strreasonUtil = "0n" then
strreasonutil = 1
else
strreasonutil = 0
end if
if strreasonStart = "0n" then
strreasonstart = 1
else
strreasonstart = 0
end if
dim cmd As oledbCommand
cmd = New oledbCommand("sp_FlexFund_
cmd.CommandType = CommandType.StoredProcedur
cmd.Parameters.Add("@Clien
cmd.Parameters.Add("@Clien
cmd.Parameters.Add("@Addre
cmd.Parameters.Add("@City"
cmd.Parameters.Add("@Posta
cmd.Parameters.Add("@Phone
cmd.Parameters.Add("@Phone
cmd.Parameters.Add("@DateC
cmd.Parameters.Add("@DateR
cmd.Parameters.Add("@First
cmd.Parameters.Add("@First
cmd.Parameters.Add("@Agenc
cmd.Parameters.Add("@Amoun
cmd.Parameters.Add("@Amoun
cmd.Parameters.Add("@Appro
cmd.Parameters.Add("@Reaso
cmd.Parameters.Add("@Reaso
cmd.Parameters.Add("@Reaso
cmd.Parameters.Add("@ChqPa
cmd.Parameters.Add("@ChqPa
cmd.Parameters.Add("@ChqPa
cmd.Parameters.Add("@ChqPa
cmd.Parameters.Add("@ChqPa
cmd.Parameters.Add("@ChqPa
cmd.Parameters.Add("@Expla
cmd.Parameters.Add("@Other
cmd.Parameters.Add("@Other
cmd.Parameters.Add("@Other
cmd.Parameters.Add("@Maint
cmd.Parameters.Add("@Repay
cmd.Parameters.Add("@Negot
cmd.Parameters.Add("@Place
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Place
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Incom
cmd.Parameters.Add("@Total
cmd.Parameters.Add("@ExpRe
cmd.Parameters.Add("@ExpEl
cmd.Parameters.Add("@ExpHe
cmd.Parameters.Add("@ExpWa
cmd.Parameters.Add("@ExpPh
cmd.Parameters.Add("@ExpCa
cmd.Parameters.Add("@ExpCa
cmd.Parameters.Add("@ExpLo
cmd.Parameters.Add("@ExpOt
cmd.Parameters.Add("@OweRe
cmd.Parameters.Add("@OweEl
cmd.Parameters.Add("@OweHe
cmd.Parameters.Add("@OweWa
cmd.Parameters.Add("@OwePh
cmd.Parameters.Add("@OweCa
cmd.Parameters.Add("@OweCa
cmd.Parameters.Add("@OweLo
cmd.Parameters.Add("@OweOt
cmd.Parameters.Add("@Total
cmd.Parameters.Add("@Total
cmd.Parameters.Add("@Total
cmd.Parameters.Add("@Total
cmd.Parameters.Add("@Month
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@PresL
cmd.Parameters.Add("@PresL
cmd.Parameters.Add("@PresL
cmd.Parameters.Add("@PresL
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@Prese
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@Futur
cmd.Parameters.Add("@PrevA
cmd.Parameters.Add("@PrevC
cmd.Parameters.Add("@PrevP
cmd.Parameters.Add("@PrevL
cmd.Parameters.Add("@PrevL
cmd.Parameters.Add("@PrevL
cmd.Parameters.Add("@PrevL
cmd.Parameters.Add("@PrevL
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@House
cmd.Parameters.Add("@Housi
cmd.Parameters.Add("@Evict
cmd.Parameters.Add("@Relat
cmd.Parameters.Add("@Other
cmd.Parameters.Add("@Conse
connect2.open()
cmd.ExecuteNonQuery()
connect2.close()
response.redirect("../_adm
End Sub
Sub BindDataGrid(ClientID AS Integer)
dim GetContactCommand AS OleDBcommand= New OleDBCommand("Select * FROM tblclients WHERE tblClients.ApplicationID="
Dim Adapter AS OleDBDataAdapter = new OleDBDataAdapter
Adapter.Selectcommand = getContactCommand
Adapter.SelectCommand.Conn
dim ContactDS AS DataSet = New DataSet
Adapter.Fill(ContactDS, "Contact")
ContactGrid.DataSource = ContactDS
Page.dataBind()
End Sub
and the stored procedure:
CREATE procedure dbo.sp_FlexFund_new (
@ClientAppID int,
@ClientSIN int,
@Address varchar (100),
@City char (20),
@Postal char (7),
@Phone char (12),
@Phone2 char (12),
@DateCreated datetime,
@DateRecv datetime,
@FirstApp bit,
@FirstAppDate datetime,
@Agency_ID varchar(50),
@AmountR int,
@AmountF int,
@Approved bit,
@ReasonRent bit,
@ReasonUtil bit,
@ReasonStart bit,
@ChqPayName char (20),
@ChqPayAddress varchar (50),
@ChqPayCity char (20),
@ChqPayPostal char (6),
@ChqPayPhone char (18),
@ChqPayFax char (18),
@Explaination varchar (50),
@OtherAsst1 varchar (50),
@OtherAsst2 varchar (50),
@OtherAsst3 varchar (50),
@Maintain varchar (50),
@Repayment varchar (50),
@NegotiatePay varchar (50),
@PlaceEmploy1 text,
@Income1 int,
@PlaceEmploy2 text,
@Income2 int,
@IncomeOW int,
@IncomeChild int,
@IncomeOther int,
@IncomeSupport int,
@IncomeOldAge int,
@TotalMonthlyIncome int,
@ExpRentMort int,
@ExpElec int,
@ExpHeat int,
@ExpWaterSew int,
@ExpPhone int,
@ExpCable int,
@ExpCar int,
@ExpLoansCC int,
@ExpOther int,
@OweRentMort int,
@OweElec int,
@OweHeat int,
@OweWaterSew int,
@OwePhone int,
@OweCable int,
@OweCar int,
@OweLoansCC int,
@OweOther int,
@TotalOwing int,
@TotalMonthly int,
@TotalIncome int,
@TotalExpenses int,
@MonthlyBalance int,
@PresentAddress varchar (50),
@PresentCity varchar (50),
@PresentPostal varchar (50),
@PresentLL varchar (50),
@PresLLAddress varchar (50),
@PresLLCity varchar (50),
@PresLLPostal varchar (50),
@PresLLPhone text,
@PresentUtil int,
@PresentRent int,
@PresentTime char (10),
@FutureAddress varchar (50),
@FutureCity char (10),
@FuturePostal char (10),
@FutureLL char (10),
@FutureLLAddress char (10),
@FutureLLCity char (10),
@FutureLLPostal char (10),
@FutureLLPhone char (10),
@FutureUtil int,
@FutureRent int,
@PrevAddress char (10),
@PrevCity char (10),
@PrevPostal char (10),
@PrevLL char (10),
@PrevLLAddress char (10),
@PrevLLCity char (10),
@PrevLLPostal char (10),
@PrevLLPhone char (10),
@HouseholdName1 char (10),
@HouseholdAge1 int,
@HouseholdRelation1 char (10),
@HouseholdName2 char (10),
@HouseholdAge2 int,
@HouseholdRelation2 char (10),
@HouseholdName3 char (10),
@HouseholdAge3 int,
@HouseholdRelation3 char (10),
@HouseholdName4 char (10),
@HouseholdAge4 int,
@HouseholdRelation4 char (10),
@HouseholdName5 char (10),
@HouseholdAge5 int,
@HouseholdRelation5 char (10),
@HouseholdName6 char (10),
@HouseholdAge6 int,
@HouseholdRelation6 char (10),
@HousingLivable varchar (50),
@Evicted varchar (50),
@RelateLL varchar (50),
@OtherInfo varchar (50),
@Consent bit
)
AS
SET NOCOUNT ON
insert into tblFlexFund(
ClientSIN,
ClientAppID,
Address,
City,
Postal,
Phone,
Phone2,
DateCreated,
DateRecv,
FirstApp,
FirstAppDate,
Agency_ID,
AmountR,
AmountF,
Approved,
ReasonRent,
ReasonUtil,
ReasonStart,
ChqPayName,
ChqPayAddress,
ChqPayCity,
ChqPayPostal,
ChqPayPhone,
ChqPayFax,
Explaination,
OtherAsst1,
OtherAsst2,
OtherAsst3,
Maintain,
Repayment,
NegotiatePay,
PlaceEmploy1,
Income1,
PlaceEmploy2,
Income2,
IncomeOW,
IncomeChild,
IncomeOther,
IncomeSupport,
IncomeOldAge,
TotalMonthlyIncome,
ExpRentMort,
ExpElec,
ExpHeat,
ExpWaterSew,
ExpPhone,
ExpCable,
ExpCar,
ExpLoansCC,
ExpOther,
OweRentMort,
OweElec,
OweHeat,
OweWaterSew,
OwePhone,
OweCable,
OweCar,
OweLoansCC,
OweOther,
TotalOwing,
TotalMonthly,
TotalIncome,
TotalExpenses,
MonthlyBalance,
PresentAddress,
PresentCity,
PresentPostal,
PresentLL,
PresLLAddress,
PresLLCity,
PresLLPostal,
PresLLPhone,
PresentUtil,
PresentRent,
PresentTime,
FutureAddress,
FutureCity,
FuturePostal,
FutureLL,
FutureLLAddress,
FutureLLCity,
FutureLLPostal,
FutureLLPhone,
FutureUtil,
FutureRent,
PrevAddress,
PrevCity,
PrevPostal,
PrevLL,
PrevLLAddress,
PrevLLCity,
PrevLLPostal,
PrevLLPhone,
HouseholdName1,
HouseholdAge1,
HouseholdRelation1,
HouseholdName2,
HouseholdAge2,
HouseholdRelation2,
HouseholdName3,
HouseholdAge3,
HouseholdRelation3,
HouseholdName4,
HouseholdAge4,
HouseholdRelation4,
HouseholdName5,
HouseholdAge5,
HouseholdRelation5,
HouseholdName6,
HouseholdAge6,
HouseholdRelation6,
HousingLivable,
Evicted,
RelateLL,
OtherInfo,
consent
)
values(
@ClientSIN,
@ClientAppID,
@Address,
@City,
@Postal,
@Phone,
@Phone2,
@DateCreated,
@DateRecv,
@FirstApp,
@FirstAppDate,
@Agency_ID,
@AmountR,
@AmountF,
@Approved,
@ReasonRent,
@ReasonUtil,
@ReasonStart,
@ChqPayName,
@ChqPayAddress,
@ChqPayCity,
@ChqPayPostal,
@ChqPayPhone,
@ChqPayFax,
@Explaination,
@OtherAsst1,
@OtherAsst2,
@OtherAsst3,
@Maintain,
@Repayment,
@NegotiatePay,
@PlaceEmploy1,
@Income1,
@PlaceEmploy2,
@Income2,
@IncomeOW,
@IncomeChild,
@IncomeOther,
@IncomeSupport,
@IncomeOldAge,
@TotalMonthlyIncome,
@ExpRentMort,
@ExpElec,
@ExpHeat,
@ExpWaterSew,
@ExpPhone,
@ExpCable,
@ExpCar,
@ExpLoansCC,
@ExpOther,
@OweRentMort,
@OweElec,
@OweHeat,
@OweWaterSew,
@OwePhone,
@OweCable,
@OweCar,
@OweLoansCC,
@OweOther,
@TotalOwing,
@TotalMonthly,
@TotalIncome,
@TotalExpenses,
@MonthlyBalance,
@PresentAddress,
@PresentCity,
@PresentPostal,
@PresentLL,
@PresLLAddress,
@PresLLCity,
@PresLLPostal,
@PresLLPhone,
@PresentUtil,
@PresentRent,
@PresentTime,
@FutureAddress,
@FutureCity,
@FuturePostal,
@FutureLL,
@FutureLLAddress,
@FutureLLCity,
@FutureLLPostal,
@FutureLLPhone,
@FutureUtil,
@FutureRent,
@PrevAddress,
@PrevCity,
@PrevPostal,
@PrevLL,
@PrevLLAddress,
@PrevLLCity,
@PrevLLPostal,
@PrevLLPhone,
@HouseholdName1,
@HouseholdAge1,
@HouseholdRelation1,
@HouseholdName2,
@HouseholdAge2,
@HouseholdRelation2,
@HouseholdName3,
@HouseholdAge3,
@HouseholdRelation3,
@HouseholdName4,
@HouseholdAge4,
@HouseholdRelation4,
@HouseholdName5,
@HouseholdAge5,
@HouseholdRelation5,
@HouseholdName6,
@HouseholdAge6,
@HouseholdRelation6,
@HousingLivable,
@Evicted,
@RelateLL,
@OtherInfo,
@consent
)
set nocount off
GO
Thanks in advance for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ClientID = request.querystring("id")
i guess u should say ClientID = request.querystring("id"). ToString()
i guess u should say ClientID = request.querystring("id").
again with the page.databind, lol;)
i just learnt you can use page.databind instead of datagrid.databind...
sorry about that
sorry about that
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, I tested praneetha's idea and ran the stored proc from the object browser and I was able to enter a record into the table, so I know there is nothing wrong with the sql side of things. I also tried adding in the response.write statement and it still errors out at the same spot "cmd.ExecuteNonQuery()" where the stored procedure is called.
Thanks for your help so far.
Any other ideas?
Thanks for your help so far.
Any other ideas?
ASKER
I found the problem....I was not using the correct variables when passing parameters back to the stored procedure for the last 4 in the list.
cmd.Parameters.Add("@Housi ngLivable" , HousingLivable)
cmd.Parameters.Add("@Evict ed", Evicted)
cmd.Parameters.Add("@Relat eLL", RelateLL)
cmd.Parameters.Add("@Other Info", OtherInfo)
cmd.Parameters.Add("@Conse nt", Consent)
should have been
cmd.Parameters.Add("@Housi ngLivable" , strHousingLivable)
cmd.Parameters.Add("@Evict ed", strEvicted)
cmd.Parameters.Add("@Relat eLL", strRelateLL)
cmd.Parameters.Add("@Other Info", strOtherInfo)
cmd.Parameters.Add("@Conse nt", strConsent)
cmd.Parameters.Add("@Housi
cmd.Parameters.Add("@Evict
cmd.Parameters.Add("@Relat
cmd.Parameters.Add("@Other
cmd.Parameters.Add("@Conse
should have been
cmd.Parameters.Add("@Housi
cmd.Parameters.Add("@Evict
cmd.Parameters.Add("@Relat
cmd.Parameters.Add("@Other
cmd.Parameters.Add("@Conse
wow...good job ...good luck
dim GetContactCommand AS OleDBcommand= New OleDBCommand("Select * FROM tblclients WHERE tblClients.ApplicationID="
Dim Adapter AS OleDBDataAdapter = new OleDBDataAdapter
Adapter.Selectcommand = getContactCommand
Adapter.SelectCommand.Conn
dim ContactDS AS DataSet = New DataSet
Adapter.Fill(ContactDS, "Contact")
ContactGrid.DataSource = ContactDS
Page.dataBind()// why does it say page.databind instead of contactgrid.databing
End Sub
Page.dataBind()// why does it say page.databind instead of contactgrid.databing