ติดปัญหา บันทึกรูปภาพไม่ได้ค่ะ มันบอกว่า mismatch ช่วยด้วยค่ะT_T vb.net
ไม่รู้ว่ามันผิดตรงไหน ช่วยดูให้หน่อยค่ะ
อันนี้ฐานข้อมูล
อันนี้ error
อันนี้โค้ด
Private Sub Addbtt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Addbtt.Click
Dim intnumrow As Integer
Dim sqlstr As String = "SELECT Count(*) FROM EmpProfile WHERE IdNumber = " & Me.IdNumbertxt.Text
cmd = New OleDbCommand(sqlstr, con)
intnumrow = cmd.ExecuteScalar()
If intnumrow > 0 Then
MsgBox("รหัสซ้ำกรุณากรอกใหม่")
Return
ElseIf IdNumbertxt.TextLength < 5 Then
MsgBox("กรอกรหัสพนักงานไม่ครบ 5 หลััก กรุณากรอกใหม่")
Return
ElseIf IdCardtxt.TextLength < 13 Then
MsgBox("กรอกรหัสบัตรประชาชนให้ถูกต้อง")
Return
Else
Dim sql As String = "INSERT INTO EmpProfile(IdNumber, EmpDate, EmpPicture, EmpPosition, EmpStatus, " & _
"EmpFrontName, EmpLastName, EmpDateRegister, EmpNickName, EmpIdCard, EmpBirthDay, " & _
"EmpProvinceBorn, EmpAge, EmpHeight, EmpWeight, EmpRace, " & _
"EmpNationality, EmpReligion, EmpAddress, EmpRoad, EmpDistrict, EmpArea, " & _
"EmpProvince, EmpPostalCode, EmpTelephone, EmpMobile, EmpEmail, EmpLocation, " & _
"EmpCondition, EmpMarry, EmpFatherName, EmpFatherSurname, EmpFatherAge, EmpFatherCareer, " & _
"EmpMotherName, EmpMotherSurname, EmpMotherAge, EmpMotherCareer, EmpRelativesNumber, " & _
"EmpManAmount, EmpWomanAmount, EmpNumber, EmpOneName, EmpOneSurName, EmpOneAge, EmpOneCareer, " & _
"EmpTwoName, EmpTwoSurname, EmpTwoAge, EmpTwoCareer, EmpThreeName, EmpThreeSurname, EmpThreeAge, " & _
"EmpThreeCareer, EmpMarryName, EmpMarrySurname, EmpMarryAge, EmpMarryCareer, EmpNumberChild, " & _
"EmpSonAmount, EmpDaughterAmount, EmpSchool1, EmpBranch1, EmpSince1, EmpTo1, EmpSchool2, " & _
"EmpBranch2, EmpSince2, EmpTo2, EmpSchool3, EmpBranch3, EmpSince3, EmpTo3, EmpSchool4, EmpBranch4, " & _
"EmpSince4, EmpTo4, EmpSchool5, EmpBranch5, EmpSince5, EmpTo5, EmpOffice1, EmpOfficeAddress1, " & _
"EmpBegin1, EmpEnd1, EmpSumTime1, EmpPosition1, EmpSalary1, EmpReason1, EmpJobQuality1, EmpCommanderName1, EmpPhoneOffice1, " & _
"EmpOffice2, EmpOfficeAddress2, EmpBegin2, EmpEnd2, EmpSumTime2, EmpPosition2, " & _
"EmpSalary2, EmpReason2, EmpJobQuality2, EmpCommanderName2, EmpPhoneOffice2, EmpOffice3, EmpOfficeAddress3, " & _
"EmpBegin3, EmpEnd3, EmpSumTime3, EmpPosition3, EmpSalary3, EmpReason3, EmpJobQuality3, EmpCommanderName3, " & _
"EmpPhoneOffice3, EmpTrainningName1, EmpTrainBegin1, EmpTrainEnd1, EmpTrainPosition1, EmpTrainQuality1, " & _
"EmpTrainningName2, EmpTrainBegin2, EmpTrainEnd2, EmpTrainPosition2, EmpTrainQuality2, EmpSpeakThai, " & _
"EmpWriteThai, EmpReadThai, EmpSpeakEnglish, EmpWriteEnglish, EmpReadEnglish, EmpSpeakJapan, EmpWriteJapan, " & _
"EmpReadJapan, EmpSpeakChina, EmpWriteChina, EmpReadChina, EmpProgram1, EmpClassbox1, EmpProgram2, EmpClassbox2, " & _
"EmpProgram3, EmpClassbox3, EmpTypeWriterThai, EmpTypeWriterEnglish, EmpNoDriver1, EmpHaveDriver1, EmpNoDriver2, " & _
"EmpHaveDriver2, EmpSport1, EmpSport2, EmpSport3, EmpHobby1, EmpHobby2, EmpHobby3, EmpTalent, EmpYesNo1, EmpReasonProvince, " & _
"EmpOutsiderName1, EmpOutsiderSurname1, EmpOutsiderCareer1, EmpRelation1, EmpOutsiderAddress1, EmpOutsiderPhone1, " & _
"EmpOutsiderName2, EmpOutsiderSurname2, EmpOutsiderCareer2, EmpRelation2, EmpOutsiderAddress2, EmpOutsiderPhone2, " & _
"EmpQuaranterName, EmpQuaranterSurname, EmpQuaranterCareer, EmpRelation3, EmpQuaranterAddress, EmpQuaranterPhone, " & _
"EmpQuaranterOffice, EmpQuaranterPosition, EmpQuaranterOfficeAddress, EmpQuaranterOfficeAddressPhone, EmpYesNo2, " & _
"EmpRemark1, EmpInformation, EmpYesNo3, EmpRemark2, EmpYesNo4, EmpRelativeName, EmpRelativeSurname, EmpRelativePosition, " & _
"EmpRelation4, EmpYesNo5, EmpRemark4, EmpIntroduce, EmpSalary, EmpTimeSince, EmpTimeTo, EmpBank, EmpNoAccount, EmpPoint1, " & _
"EmpPoint2, EmpPoint3, EmpPoint4, EmpPoint5, EmpPoint6, EmpPoint7, EmpAddExam, EmpTimesLoan, EmpSumLoan, EmpLoan, EmpTimesWarn, " & _
"EmpTimesFine, EmpSumFine, EmpMistake1, EmpMistake2, EmpMistake3, EmpCheckOut, EmpReasonOut) " & _
"VALUES(@idn, @edate, @pic, @eposition, @estatus, @efrontname, @elastname, @edateregister, @enickname, " & _
"@eidcard, @ebirthday, @eprovinceborn, @eage, @eheight, @eweight, @erace, @enationality, " & _
"@ereligion, @eaddress, @eroad, @edistrict, @earea, @eprovince, @epostalcode, @etelephone, " & _
"@emobile, @eemail, @elocation, @econdition, @emarry, @efathername, @efathersurname, @efatherage, @efathercareer, " & _
"@emothername, @emothersurname, @emotherage, @emothercareer, @erelativesnumber, @emanamount, @ewomanamount, @enumber, " & _
"@eonename, @eonesurname, @eoneage, @eonecareer, @etwoname, @etwosurname, @etwoage, @etwocareer, @ethreename, @ethreesurname, " & _
"@ethreeage, @ethreecareer, @emarryname, @emarrysurname, @emarryage, @emarrycareer, @enumberchild, @esonamount, @edaughteramount, " & _
"@eschool1, @ebranch1, @esince1, @eto1, @eschool2, @ebranch2, @esince2, @eto2, @eschool3, @ebranch3, @esince3, @eto3, @eschool4, " & _
"@ebranch4, @esince4, @eto4, @eschool5, @ebranch5, @esince5, @eto5, @eoffice1, @eofficeaddress1, @ebegin1, @eend1, @esumtime1, " & _
"@eposition1, @esalary1, @ereason1, @ejobquality1, @ecommandername1, @ephoneoffice1, @eoffice2, @eofficeaddress2, @ebegin2, " & _
"@eend2, @esumtime2, @eposition2, @esalary2, @ereason2, @ejobquality2, @ecommandername2, @ephoneoffice2, @eoffice3, @eofficeaddress3, " & _
"@ebegin3, @eend3, @esumtime3, @eposition3, @esalary3, @ereason3, @ejobquality3, @ecommandername3, @ephoneoffice3, @etrainningname1, " & _
"@etrainbegin1, @etrainend1, @etrainposition1, @etrainquality1, @etrainningname2, @etrainbegin2, @etrainend2, @etrainposition2, " & _
"@etrainquality2, @espeakthai, @ewritethai, @ereadthai, @espeakenglish, @ewriteenglish, @ereadenglish, @espeakjapan, @ewritejapan, " & _
"@ereadjapan, @espeakchina, @ewritechina, @ereadchina, @eprogram1, @eclassbox1, @eprogram2, @eclassbox2, @eprogram3, @eclassbox3, " & _
"@etypewriterthai, @etypewriterenglish, @enodriver1, @ehavedriver1, @enodriver2, @ehavedriver2, @esport1, @esport2, @esport3, @ehobby1, " & _
"@ehobby2, @ehobby3, @etalent, @eyesno1, @ereasonprovince, @eoutsidername1, @eoutsidersurname1, @eoutsidercareer1, @erelation1, " & _
"@eoutsideraddress1, @eoutsiderphone1, @eoutsidername2, @eoutsidersurname2, @eoutsidercareer2, @erelation2, " & _
"@eoutsideraddress2, @eoutsiderphone2, @equarantername, @equarantersurname, @equarantercareer, @erelation3, @equaranteraddress, " & _
"@equaranterphone, @equaranteroffice, @equaranterposition, @equaranterofficeaddress, @equaranterofficeaddressphone, @eyesno2, " & _
"@eremark1, @einformation, @eyesno3, @eremark2, @eyesno4, @erelativename, @erelativesurname, @erelativeposition, @erelation4, " & _
"@eyesno5 , @eremark4, @eintroduce, @esalary, @etimesince, @etimeto, @ebank, @enoaccount, @epoint1 , @epoint2, @epoint3, @epoint4, " & _
"@epoint5, @epoint6, @epoint7, @eaddexam, @etimesloan, @esumloan, @eloan, @etimeswarn, @etimesfine, @esumfine, @emistake1, @emistake2, " & _
"@emistake3, @echeckOut, @ereasonout) "
cmd = New OleDbCommand(sql, con)
cmd.Parameters.AddWithValue("idn", IdNumbertxt.Text)
cmd.Parameters.AddWithValue("edate", Datetxt.Text)
cmd.Parameters.AddWithValue("eposition", Positiontxt.Text)
cmd.Parameters.AddWithValue("estatus", StatusBox.Text)
cmd.Parameters.AddWithValue("efrontname", FrontNametxt.Text)
cmd.Parameters.AddWithValue("elastname", LastNametxt.Text)
cmd.Parameters.AddWithValue("edateregister", DateRegistertxt.Text)
cmd.Parameters.AddWithValue("enickname", NickNametxt.Text)
cmd.Parameters.AddWithValue("eidcard", IdCardtxt.Text)
cmd.Parameters.AddWithValue("ebirthday", Birthdaytxt.Text)
cmd.Parameters.AddWithValue("eprovinceborn", ProvinceBorntxt.Text)
cmd.Parameters.AddWithValue("eage", Agetxt.Text)
cmd.Parameters.AddWithValue("eheight", Heighttxt.Text)
cmd.Parameters.AddWithValue("eweight", Weighttxt.Text)
cmd.Parameters.AddWithValue("erace", Racetxt.Text)
cmd.Parameters.AddWithValue("enationality", Nationalitytxt.Text)
cmd.Parameters.AddWithValue("ereligion", Religiontxt.Text)
cmd.Parameters.AddWithValue("eaddress", Addresstxt.Text)
cmd.Parameters.AddWithValue("eroad", Roadtxt.Text)
cmd.Parameters.AddWithValue("edistrict", Districttxt.Text)
cmd.Parameters.AddWithValue("earea", Areatxt.Text)
cmd.Parameters.AddWithValue("eprovince", Provincetxt.Text)
cmd.Parameters.AddWithValue("epostalcode", PostalCodetxt.Text)
cmd.Parameters.AddWithValue("etelephone", Telephonetxt.Text)
cmd.Parameters.AddWithValue("emobile", Mobiletxt.Text)
cmd.Parameters.AddWithValue("eemail", Emailtxt.Text)
cmd.Parameters.AddWithValue("elocation", Locationbox.Text)
cmd.Parameters.AddWithValue("econdition", Conditionbox.Text)
cmd.Parameters.AddWithValue("emarry", Marrybox.Text)
cmd.Parameters.AddWithValue("efathername", FatherNametxt.Text)
cmd.Parameters.AddWithValue("efathersurname", FatherSurnametxt.Text)
cmd.Parameters.AddWithValue("efatherage", FatherAgetxt.Text)
cmd.Parameters.AddWithValue("efathercareer", FatherCareertxt.Text)
cmd.Parameters.AddWithValue("emothername", MotherNametxt.Text)
cmd.Parameters.AddWithValue("emothersurname", MotherSurnametxt.Text)
cmd.Parameters.AddWithValue("emotherage", MotherAgetxt.Text)
cmd.Parameters.AddWithValue("emothercareer", MotherCareertxt.Text)
cmd.Parameters.AddWithValue("erelativesnumber", RelativesNumbertxt.Text)
cmd.Parameters.AddWithValue("emanamount", ManAmounttxt.Text)
cmd.Parameters.AddWithValue("ewomanamount", WomanAmounttxt.Text)
cmd.Parameters.AddWithValue("enumber", Numbertxt.Text)
cmd.Parameters.AddWithValue("eonename", OneNametxt.Text)
cmd.Parameters.AddWithValue("eonesurname", OneSurNametxt.Text)
cmd.Parameters.AddWithValue("eoneage", OneAgetxt.Text)
cmd.Parameters.AddWithValue("eonecareer", OneCareertxt.Text)
cmd.Parameters.AddWithValue("etwoname", TwoNametxt.Text)
cmd.Parameters.AddWithValue("etwosurname", TwoSurnametxt.Text)
cmd.Parameters.AddWithValue("etwoage", TwoAgetxt.Text)
cmd.Parameters.AddWithValue("etwocareer", TwoCareertxt.Text)
cmd.Parameters.AddWithValue("ethreename", ThreeNametxt.Text)
cmd.Parameters.AddWithValue("ethreesurname", ThreeSurnametxt.Text)
cmd.Parameters.AddWithValue("ethreeage", ThreeAgetxt.Text)
cmd.Parameters.AddWithValue("ethreecareer", ThreeCareertxt.Text)
cmd.Parameters.AddWithValue("emarryname", MarryNametxt.Text)
cmd.Parameters.AddWithValue("emarrysurname", MarrySurnametxt.Text)
cmd.Parameters.AddWithValue("emarryage", MarryAgetxt.Text)
cmd.Parameters.AddWithValue("emarrycareer", MarryCareertxt.Text)
cmd.Parameters.AddWithValue("enumberchild", NumberChildtxt.Text)
cmd.Parameters.AddWithValue("esonamount", SonAmounttxt.Text)
cmd.Parameters.AddWithValue("edaughteramount", DaughterAmounttxt.Text)
cmd.Parameters.AddWithValue("eschool1", School1txt.Text)
cmd.Parameters.AddWithValue("ebranch1", Branch1txt.Text)
cmd.Parameters.AddWithValue("esince1", Since1txt.Text)
cmd.Parameters.AddWithValue("eto1", To1txt.Text)
cmd.Parameters.AddWithValue("eschool2", School2txt.Text)
cmd.Parameters.AddWithValue("ebranch2", Branch2txt.Text)
cmd.Parameters.AddWithValue("esince2", Since2txt.Text)
cmd.Parameters.AddWithValue("eto2", To2txt.Text)
cmd.Parameters.AddWithValue("eschool3", School3txt.Text)
cmd.Parameters.AddWithValue("ebranch3", Branch3txt.Text)
cmd.Parameters.AddWithValue("esince3", Since3txt.Text)
cmd.Parameters.AddWithValue("eto3", To3txt.Text)
cmd.Parameters.AddWithValue("eschool4", School4txt.Text)
cmd.Parameters.AddWithValue("ebranch4", Branch4txt.Text)
cmd.Parameters.AddWithValue("esince4", Since4txt.Text)
cmd.Parameters.AddWithValue("eto4", To4txt.Text)
cmd.Parameters.AddWithValue("eschool5", School5txt.Text)
cmd.Parameters.AddWithValue("ebranch5", Branch5txt.Text)
cmd.Parameters.AddWithValue("esince5", Since5txt.Text)
cmd.Parameters.AddWithValue("eto5", To5txt.Text)
cmd.Parameters.AddWithValue("eoffice1", Office1txt.Text)
cmd.Parameters.AddWithValue("eofficeaddress1", OfficeAddress1txt.Text)
cmd.Parameters.AddWithValue("ebegin1", Begin1txt.Text)
cmd.Parameters.AddWithValue("eend1", End1txt.Text)
cmd.Parameters.AddWithValue("esumtime1", SumTime1txt.Text)
cmd.Parameters.AddWithValue("eposition1", Position1txt.Text)
cmd.Parameters.AddWithValue("esalary1", Salary1txt.Text)
cmd.Parameters.AddWithValue("ereason1", Reason1txt.Text)
cmd.Parameters.AddWithValue("ejobquality1", JobQuality1txt.Text)
cmd.Parameters.AddWithValue("ecommandername1", CommanderName1txt.Text)
cmd.Parameters.AddWithValue("ephoneoffice1", PhoneOffice1txt.Text)
cmd.Parameters.AddWithValue("eoffice2", Office2txt.Text)
cmd.Parameters.AddWithValue("eofficeaddress2", OfficeAddress2txt.Text)
cmd.Parameters.AddWithValue("ebegin2", Begin2txt.Text)
cmd.Parameters.AddWithValue("eend2", End2txt.Text)
cmd.Parameters.AddWithValue("esumtime2", SumTime2txt.Text)
cmd.Parameters.AddWithValue("eposition2", Position2txt.Text)
cmd.Parameters.AddWithValue("esalary2", Salary2txt.Text)
cmd.Parameters.AddWithValue("ereason2", Reason2txt.Text)
cmd.Parameters.AddWithValue("ejobquality2", JobQuality2txt.Text)
cmd.Parameters.AddWithValue("ecommandername2", CommanderName2txt.Text)
cmd.Parameters.AddWithValue("ephoneoffice2", PhoneOffice2txt.Text)
cmd.Parameters.AddWithValue("eoffice3", Office3txt.Text)
cmd.Parameters.AddWithValue("eofficeaddress3", OfficeAddress3txt.Text)
cmd.Parameters.AddWithValue("ebegin3", Begin3txt.Text)
cmd.Parameters.AddWithValue("eend3", End3txt.Text)
cmd.Parameters.AddWithValue("esumtime3", SumTime3txt.Text)
cmd.Parameters.AddWithValue("eposition3", Position3txt.Text)
cmd.Parameters.AddWithValue("esalary3", Salary3txt.Text)
cmd.Parameters.AddWithValue("ereason3", Reason3txt.Text)
cmd.Parameters.AddWithValue("ejobquality3", JobQuality3txt.Text)
cmd.Parameters.AddWithValue("ecommandername3", CommanderName3txt.Text)
cmd.Parameters.AddWithValue("ephoneoffice3", PhoneOffice3txt.Text)
cmd.Parameters.AddWithValue("etrainningname1", TrainningName1txt.Text)
cmd.Parameters.AddWithValue("etrainbegin1", TrainBegin1txt.Text)
cmd.Parameters.AddWithValue("etrainend1", TrainEnd1txt.Text)
cmd.Parameters.AddWithValue("etrainposition1", TrainPosition1txt.Text)
cmd.Parameters.AddWithValue("etrainquality1", TrainQuality1txt.Text)
cmd.Parameters.AddWithValue("etrainningname2", TrainningName2txt.Text)
cmd.Parameters.AddWithValue("etrainbegin2", TrainBegin2txt.Text)
cmd.Parameters.AddWithValue("etrainend2", TrainEnd2txt.Text)
cmd.Parameters.AddWithValue("etrainposition2", TrainPosition2txt.Text)
cmd.Parameters.AddWithValue("etrainquality2", TrainQuality2txt.Text)
cmd.Parameters.AddWithValue("espeakthai", SpeakThaibox.Text)
cmd.Parameters.AddWithValue("ewritethai", WriteThaibox.Text)
cmd.Parameters.AddWithValue("ereadthai", ReadThaibox.Text)
cmd.Parameters.AddWithValue("espeakenglish", SpeakEnglishbox.Text)
cmd.Parameters.AddWithValue("ewriteenglish", WriteEnglishbox.Text)
cmd.Parameters.AddWithValue("ereadenglish", ReadEnglishbox.Text)
cmd.Parameters.AddWithValue("espeakjapan", SpeakJapanbox.Text)
cmd.Parameters.AddWithValue("ewritejapan", WriteJapanbox.Text)
cmd.Parameters.AddWithValue("ereadjapan", ReadJapanbox.Text)
cmd.Parameters.AddWithValue("espeakchina", SpeakChinabox.Text)
cmd.Parameters.AddWithValue("ewritechina", WriteChinabox.Text)
cmd.Parameters.AddWithValue("ereadchina", ReadChinabox.Text)
cmd.Parameters.AddWithValue("eprogram1", Program1txt.Text)
cmd.Parameters.AddWithValue("eclassbox1", Classbox1.Text)
cmd.Parameters.AddWithValue("eprogram2", Program2txt.Text)
cmd.Parameters.AddWithValue("eclassbox2", Classbox2.Text)
cmd.Parameters.AddWithValue("eprogram3", Program3txt.Text)
cmd.Parameters.AddWithValue("eclassbox3", Classbox3.Text)
cmd.Parameters.AddWithValue("etypewriterthai", TypeWriterThaitxt.Text)
cmd.Parameters.AddWithValue("etypewriterenglish", TypeWriterEnglishtxt.Text)
cmd.Parameters.AddWithValue("enodriver1", NoDriver1txt.Text)
cmd.Parameters.AddWithValue("ehavedriver1", HaveDriverbox1.Text)
cmd.Parameters.AddWithValue("enodriver2", NoDriver2txt.Text)
cmd.Parameters.AddWithValue("ehavedriver2", HaveDriverbox2.Text)
cmd.Parameters.AddWithValue("esport1", Sport1txt.Text)
cmd.Parameters.AddWithValue("esport2", Sport2txt.Text)
cmd.Parameters.AddWithValue("esport3", Sport3txt.Text)
cmd.Parameters.AddWithValue("ehobby1", Hobby1txt.Text)
cmd.Parameters.AddWithValue("ehobby2", Hobby2txt.Text)
cmd.Parameters.AddWithValue("ehobby3", Hobby3txt.Text)
cmd.Parameters.AddWithValue("etalent", Talenttxt.Text)
cmd.Parameters.AddWithValue("eyesno1", YesNo1box.Text)
cmd.Parameters.AddWithValue("ereasonprovince", ReasonProvincetxt.Text)
cmd.Parameters.AddWithValue("eoutsidername1", OutsiderName1txt.Text)
cmd.Parameters.AddWithValue("eoutsidersurname1", OutsiderSurname1txt.Text)
cmd.Parameters.AddWithValue("eoutsidercareer1", OutsiderCareer1txt.Text)
cmd.Parameters.AddWithValue("erelation1", Relation1txt.Text)
cmd.Parameters.AddWithValue("eoutsideraddress1", OutsiderAddress1txt.Text)
cmd.Parameters.AddWithValue("eoutsiderphone1", OutsiderPhone1txt.Text)
cmd.Parameters.AddWithValue("eoutsidername2", OutsiderName2txt.Text)
cmd.Parameters.AddWithValue("eoutsidersurname2", OutsiderSurname2txt.Text)
cmd.Parameters.AddWithValue("eoutsidercareer2", OutsiderCareer2txt.Text)
cmd.Parameters.AddWithValue("erelation2", Relation2txt.Text)
cmd.Parameters.AddWithValue("eoutsideraddress2", OutsiderAddress2txt.Text)
cmd.Parameters.AddWithValue("eoutsiderphone2", OutsiderPhone2txt.Text)
cmd.Parameters.AddWithValue("equarantername", QuaranterNametxt.Text)
cmd.Parameters.AddWithValue("equarantersurname", QuaranterSurNametxt.Text)
cmd.Parameters.AddWithValue("equarantercareer", QuaranterCareertxt.Text)
cmd.Parameters.AddWithValue("erelation3", Relation3txt.Text)
cmd.Parameters.AddWithValue("equaranteraddress", QuaranterAddresstxt.Text)
cmd.Parameters.AddWithValue("equaranterphone", QuaranterPhonetxt.Text)
cmd.Parameters.AddWithValue("equaranteroffice", QuaranterOfficetxt.Text)
cmd.Parameters.AddWithValue("equaranterposition", QuaranterPositiontxt.Text)
cmd.Parameters.AddWithValue("equaranterofficeaddress", QuaranterOfficeAddresstxt.Text)
cmd.Parameters.AddWithValue("equaranterofficeaddressphone", QuaranterOfficeAddressPhonetxt.Text)
cmd.Parameters.AddWithValue("eyesno2", YesNo2box.Text)
cmd.Parameters.AddWithValue("eremark1", Remark1txt.Text)
cmd.Parameters.AddWithValue("einformation", Informationtxt.Text)
cmd.Parameters.AddWithValue("eyesno3", YesNo3box.Text)
cmd.Parameters.AddWithValue("eremark2", Remark2txt.Text)
cmd.Parameters.AddWithValue("eyesno4", YesNo4box.Text)
cmd.Parameters.AddWithValue("erelativename", RelativeNametxt.Text)
cmd.Parameters.AddWithValue("erelativesurname", RelativeSurnametxt.Text)
cmd.Parameters.AddWithValue("erelativeposition", RelativePositiontxt.Text)
cmd.Parameters.AddWithValue("erelation4", Relation4txt.Text)
cmd.Parameters.AddWithValue("eyesno5", YesNo5box.Text)
cmd.Parameters.AddWithValue("eremark4", Remark3txt.Text)
cmd.Parameters.AddWithValue("eintroduce", Introducetxt.Text)
cmd.Parameters.AddWithValue("esalary", Salarytxt.Text)
cmd.Parameters.AddWithValue("etimesince", TimeSincebox.Text)
cmd.Parameters.AddWithValue("etimeto", TimeTobox.Text)
cmd.Parameters.AddWithValue("ebank", Bankbox.Text)
cmd.Parameters.AddWithValue("enoaccount", NoAccounttxt.Text)
cmd.Parameters.AddWithValue("epoint1", Point1txt.Text)
cmd.Parameters.AddWithValue("epoint2", Point2txt.Text)
cmd.Parameters.AddWithValue("epoint3", Point3txt.Text)
cmd.Parameters.AddWithValue("epoint4", Point4txt.Text)
cmd.Parameters.AddWithValue("epoint5", Point5txt.Text)
cmd.Parameters.AddWithValue("epoint6", Point6txt.Text)
cmd.Parameters.AddWithValue("epoint7", Point7txt.Text)
cmd.Parameters.AddWithValue("eaddexam", AddExamtxt.Text)
cmd.Parameters.AddWithValue("etimesloan", TimesLoantxt.Text)
cmd.Parameters.AddWithValue("esumloan", SumLoantxt.Text)
cmd.Parameters.AddWithValue("eloan", Loantxt.Text)
cmd.Parameters.AddWithValue("etimeswarn", TimesWarntxt.Text)
cmd.Parameters.AddWithValue("etimesfine", TimesFinetxt.Text)
cmd.Parameters.AddWithValue("esumfine", SumFinetxt.Text)
cmd.Parameters.AddWithValue("emistake1", Mistake1txt.Text)
cmd.Parameters.AddWithValue("emistake2", Mistake2txt.Text)
cmd.Parameters.AddWithValue("emistake3", Mistake3txt.Text)
cmd.Parameters.AddWithValue("echeckOut", OutOfficebox.Text)
cmd.Parameters.AddWithValue("ereasonout", ReasonOuttxt.Text)
Dim fiStream As New FileStream(OpenFileDialog1.FileName, _
FileMode.Open, _
FileAccess.Read)
Dim binReader As New BinaryReader(fiStream)
Dim pic() As Byte = binReader.ReadBytes(fiStream.Length)
cmd.Parameters.AddWithValue("pic", pic)
Dim affect As Integer = cmd.ExecuteNonQuery()
If (affect < 1) Then
MsgBox("เกิดข้อผิดพลาด" & vbNewLine & "ไม่สามารถเพิ่มข้อมูลได้")
Else
MsgBox("เพิ่มข้อมูลเรียบร้อยแล้ว")
End If
End If
End Sub
ลองทดสอบดูแล้ว ถ้าเปลี่ยน EmpPicture เป็น แบบ Text ไม่ใช่ Ole Object จะบันทึกได้ แต่ในตัวอย่างบอกให้ใช้ Ole Object น่ะค่ะ เลยคิดว่าผิดตรงนี้ รบกวนช่วยดูให้หน่อยค่ะ
ขอบคุณล่วงหน้าค่ะTag : .NET, Ms Access, VB.NET
Date :
2011-04-07 16:36:24
By :
mayapopy
View :
1100
Reply :
2
ตรวจสอบยากนิดหนึ่งน่ะครับ ฟิวด์เยอะครับ Error นี้เกิดจากค่าที่ Input ลงใน Parameter ไม่ถูกต้องครับ อาจจะเป็น Null หรือ เป็นตัวเลข ตัวหนังสือ ไม่ถุกกับชนิดชองฟิวด์ครับ
Date :
2011-04-07 16:50:22
By :
webmaster
ทดสอบดูแล้วมันติดที่ picturebox ค่ะ เพราะลองเอามันออกแล้ว บันทึก จะบันทึกได้ปกติ ทดสอบเปลี่ยนค่าจาก object เป็น text แล้วก็จะเซฟได้ ก็เลยคิดว่าติดที่ มันไม่เข้ากันของ picturebox น่ะค่ะ
Date :
2011-04-08 08:18:58
By :
mayapopy
Load balance : Server 01