Quantcast
Channel: Visual C# forum
Viewing all 31927 articles
Browse latest View live

Bug in C# when concatenating very long strings or building very long strings with stringbuilder

$
0
0

While dynamically creating Create SQL Table statements I discovered C# was injecting a newline or something that appeared as a newline in my string every 1025 characters.  This caused  SQL exception error as it was breaking column names into separate lines.  To verify it was C# I created two very long strings and assigned them to variables test1 & test2 and then concatenated them to test3    String test3 = test1 + test2;  I set a breakpoint and printed test3 in the immediate window and then copied into notepad where it was painfully clear what was going on.  I then copied each block into a sql query to get the length as select len("very long string block") and it was always 1025.

I also tested with the StringBuilder Append and got the same result. 

Has anyone else come across this?

Has Microsoft acknowledged and working on a fix?

How are you working around it?

My test code of long strings:

String test1 = "SurgeryF130IEN  varchar(50) not null,   Sta3n int not null,  30DayDeath varchar(500) NULL,30DayPostopStatus varchar(500) NULL,AbsentPeripheralPulses varchar(500) NULL,ActiveEndocarditis varchar(500) NULL,ActiveHepatitis varchar(500) NULL,AcuteRenalFailure varchar(500) NULL,AddressPlate varchar(500) NULL,AdmissionTransferDate varchar(999) NULL,AdmitPacUTime Date NULL,AgentOrangeExposure varchar(500) NULL,AirwayIndex varchar(500) NULL,AnesAvailTime Date NULL,AnesCareBillableTimeFlag varchar(500) NULL,AnesCareEndTime Date NULL,AnesCareStartTime Date NULL,AnesMedicallyDirected varchar(500) NULL,AnesPersonallyPerformed varchar(500) NULL,AnesPhysicianAvailable varchar(500) NULL,AnesSuperviseCodeF132x95IEN varchar(50) NULL,AnesthesiologistSupvrF200IEN varchar(50) NULL,AnesthetistCategory varchar(500) NULL,Angina varchar(500) NULL,AnginaOneMonthPrior varchar(500) NULL,AntibioticProphylaxis varchar(500) NULL,AorticStenosis varchar(500) NULL,AorticSystolicPressure varchar(999) NULL,AorticValveProcedure varchar(500) NULL,AppropriateDvtProphylaxis varchar(500) NULL,AsaClassF132x8IEN varchar(50) NULL,Ascites varchar(500) NULL,AsdRepair varchar(500) NULL,AssessmentCompletedByF200IEN varchar(50) NULL,AssessmentStatus varchar(500) NULL,AssessmentType varchar(500) NULL,AssociatedClinicF44IEN varchar(50) NULL,AsstAnesthetistF200IEN varchar(50) NULL,AsstPerfusionistF200IEN varchar(50) NULL,AttendingCodeF132x9IEN varchar(50) NULL,AttendingCodeNotUsed varchar(500) NULL,AttendProviderF200IEN varchar(50) NULL,AttendSurgF200IEN varchar(50) NULL,AvailabilityOfSpecialEquip varchar(500) NULL,BathShampoo varchar(500) NULL,BatistaProcedureUsedYN varchar(500) NULL,BleedingDisorders varchar(500) NULL,BleedingPttTimeIn48Hrs varchar(500) NULL,BloodAvailability varchar(500) NULL,BloodLossMl int NULL,BloodSugarIn7Days varchar(500) NULL,BloodTypeXmatch varchar(500) NULL,Bnp varchar(5) NULL,BnpDate varchar(999) NULL,BridgeToTransplantDevice varchar(500) NULL,BunIn7Days varchar(500) NULL,CancelDate DateTime NULL,CancellationAvoidable varchar(500) NULL " +" ,CancellationComments varchar(50) NULL,CancelledByF200IEN varchar(50) NULL,CancelReasonF135IEN varchar(50) NULL,CardiacArrestReqCpr varchar(500) NULL,CardiacCatheterizationDate DateTime NULL,CardiacOccurrences varchar(500) NULL,CardiacResourceDataComments varchar(130) NULL,CardiacRiskPreopComments varchar(130) NULL,CardiacSurgicalPriority varchar(500) NULL,CardiacSurgPerformedNonVa varchar(500) NULL,CardiacTransplant varchar(500) NULL,CardiacYN varchar(500) NULL,Cardiomegaly varchar(500) NULL,CarePlanInChart varchar(500) NULL,CaseScheduleOrder varchar(35) NULL,CaseScheduleType varchar(500) NULL,CaseVerification varchar(500) NULL,CbcIn48Hrs varchar(500) NULL,CentralNervousSystemYN varchar(500) NULL,CerebralVascularDisease varchar(500) NULL,ChecklistConfirmedByF200IEN varchar(50) NULL,ChemotherapyInLast30Days varchar(500) NULL,ChestXrayIn7Days varchar(500) NULL,ChfWithinOneMonth varchar(500) NULL,CigMatchValRem varchar(500) NULL,CircumflexStenosis varchar(999) NULL,ClassificationEnteredYN varchar(500) NULL,CleanDressing varchar(500) NULL,CleanHospCloth varchar(500) NULL,ClerkChnDateProcedure int NULL,ClerkChnDaysBefore int NULL,ClerkChnRecForMajSurg int NULL,ClostridiumDifficileColitis varchar(500) NULL,CnsOccurrences varchar(500) NULL,CodingVerifierF200IEN varchar(50) NULL,Coma varchar(500) NULL,Coma24HoursPostop varchar(500) NULL,CombatVet varchar(500) NULL,ConcurrentCaseF130IEN varchar(50) NULL,ConfirmPatientIdentity varchar(500) NULL,ConfirmPatientPosition varchar(500) NULL,CongestiveHeartFailure varchar(500) NULL,ConsentSigWit varchar(500) NULL,ConvertFromOffPumpToCpb varchar(500) NULL,CoronariesWithStenosis int NULL,CorrectMedicalImplants varchar(500) NULL,CountVerifierF200IEN varchar(50) NULL,CptOnNurseReport varchar(500) NULL,CreateRiskAssessment varchar(500) NULL,CrossmatchScreenAutologous varchar(500) NULL,CurrentDigoxinUse varchar(500) NULL,CurrentDiureticUse varchar(500) NULL,CurrentlyOnDialysis varchar(500) NULL,CurrentPneumonia varchar(500) NULL,CurrentSmoker varchar(500) NULL,CurrentSmokerCardiac varchar(500) NULL,CvaStrokeNoNeuroDeficit varchar(500) NULL,CvaStrokeWithNeuroDeficit varchar(500) NULL,CvdRepairObstruction varchar(500) NULL,DateAssessmentCompleted Date NULL,DateOfDeath varchar(999) NULL,DateOfLastTransmission DateTime NULL,DateOfOperation DateTime NULL,DateOfProcedure DateTime NULL,DateOfTranscription DateTime NULL,DateTimeOfDictation DateTime NULL,DateTimeOrRequestMade DateTime NULL,DateTransmitted DateTime NULL,DeathUnrelatedRelated varchar(500) NULL,DeepIncisionalSsi varchar(500) NULL,DesiredProcedureDate Date NULL,DeviceS varchar(70) NULL,Diabetes varchar(500) NULL,DiabetesCardiac varchar(500) NULL,DiabetesMellitusChronic varchar(500) NULL,DiabetesMellitusPreopMgmt varchar(500) NULL,DiagnosticResultsConfirmByF200IEN varchar(50) NULL,DiagnosticTherapeuticYN varchar(500) NULL,DictatedSummaryExpected varchar(500) NULL,DischargedViaF131x01IEN varchar(50) NULL,DischargeTransferDate varchar(999) NULL,DisseminatedCancerYN varchar(500) NULL,DivisionF4IEN varchar(50) NULL,DnrStatus varchar(500) NULL,Dressing varchar(50) NULL,DressingCondition varchar(500) NULL,DrugAddiction varchar(500) NULL,DTOfDesiredProcedureDate DateTime NULL,DTOfScheduledDateEntry DateTime NULL,DTPatientDischFromIcu varchar(999) NULL,DTPatientExtubated varchar(999) NULL,DvtThrombophlebitis varchar(500) NULL,DynamedNotified varchar(500) NULL,Dyspnea varchar(500) NULL,EkgIn24Hrs varchar(500) NULL,ElectrocauteryUnit varchar(50) NULL,ElectrogroundPosition2F138IEN varchar(50) NULL,ElectrogroundPositionF138IEN varchar(50) NULL,ElectrophysiologicProcedure varchar(500) NULL,EmploymentStatusPreoperative varchar(500) NULL,EndBp varchar(10) NULL,Endocarditis varchar(500) NULL,EndovascularRepair varchar(500) NULL,EndPulse int NULL,EndResp int NULL,EnemaSIfOrd varchar(500) NULL,EsophagealVarices varchar(500) NULL,EstimatedCaseLength varchar(7) NULL,EstimateOfMortality int NULL,EstimateOfMortalityDate varchar(999) NULL,EsuCoagRange varchar(30) NULL,EsuCuttingRange varchar(30) NULL,Etoh2DrinksDay varchar(500) NULL,Fev1 varchar(999) NULL,FinalAnesthesiaTempC numeric(4,1) NULL,FinalCountsVerifyCorrect varchar(500) NULL,FirstAsstF200IEN varchar(50) NULL,FlashContamination int NULL,FlashDecontamination int NULL,FlashEmergencyCase int NULL,FlashLoanerInstrument int NULL,FlashNoBetterOption int NULL,FlashSpdOrMgtIssue int NULL,FoleyCatheterInsertedByF200IEN varchar(50) NULL,FoleyCatheterSize int NULL,ForeignBodyRemoval varchar(500) NULL,FreshlyShaved varchar(500) NULL,FunctionalHealthStatus varchar(500) NULL,GastricOutput int NULL,GastrointestinalYN varchar(500) NULL,GeneralYN varchar(500) NULL,GraftProsthesisFlapFailure varchar(500) NULL,GreatVesselRepairYN varchar(500) NULL,HairRemovalByF200IEN varchar(50) NULL,HairRemovalMethod varchar(500) NULL,HdlCardiac varchar(6) NULL,HdlDate varchar(999) NULL,HeadAndOrNeckCancer varchar(500) NULL,Height varchar(999) NULL,HeightMeasurementDate Date NULL,HemiplegiaHemiparesisYN varchar(500) NULL,HemoglobinA1c varchar(6) NULL,HemoglobinA1cDate varchar(999) NULL,HepatobiliaryYN varchar(500) NULL,Hepatomegaly varchar(500) NULL,HighAnionGapDate Date NULL,HighCpkDate Date NULL,HighCpkMbDate Date NULL,HighestAnionGap varchar(5) NULL,HighestCpk varchar(6) NULL,HighestCpkMb varchar(4) NULL,HighestGlucose numeric(5,1) NULL,HighestPotassium varchar(3) NULL,HighestSerumCreatinine varchar(4) NULL,HighestSerumSodium varchar(5) NULL,HighestSerumTroponinI varchar(5) NULL,HighestSerumTroponinT varchar(5) NULL,HighestTotalBilirubin varchar(5) NULL,HighestWbc varchar(4) NULL,HighestWbcDate Date NULL,HighGlucoseDate Date NULL,HighPotassiumDate Date NULL,HighSerumCreatinineDate Date NULL,HighSerumSodiumDate Date NULL,HighSerumTroponinIDate Date NULL,HighSerumTroponinTDate Date NULL,HighTotalBilirubinDate Date NULL,HistoryOfCopd varchar(500) NULL,HistoryOfCvd varchar(500) NULL,HistoryOfMi varchar(500) NULL,HistoryOfTiaS varchar(500) NULL,Homeless varchar(500) NULL,HospitalAdmissionDate varchar(999) NULL,HospitalDischargeDate varchar(999) NULL,Hypertension varchar(500) NULL,HypertensionRequiringMeds varchar(500) NULL,IcdOnNurseReport varchar(500) NULL,IleusBowelObstruction varchar(500) NULL,ImagTimestamp DateTime NULL,ImpairedSensorium varchar(500) NULL,IncisionType varchar(500) NULL,InductionComplete Date NULL,InOutPatientStatus varchar(500) NULL,InstCntCorrect varchar(500) NULL,InstCntVerfByF200IEN varchar(50) NULL,InstrumentCountCorrectYN varchar(500) NULL,IntraopDisseminatedCancer varchar(500) NULL,IntraoperativeAscites varchar(500) NULL,IntraoperativeXRays varchar(500) NULL,IntraopRbcUnitsTransfused varchar(999) NULL,IonizingRadiationExposure varchar(500) NULL,IvNtgWithin48Hours varchar(500) NULL,IvStartedByF200IEN varchar(50) NULL,LadStenosis varchar(999) NULL,LaserType varchar(30) NULL,LdlCardiac varchar(6) NULL,LdlDateCardiac varchar(999) NULL,LeftMainStenosis varchar(999) NULL,LengthOfPostOpStay varchar(999) NULL,LevinTubeCath varchar(500) NULL,LockCase varchar(500) NULL,LowCardiacOutput6Hours varchar(500) NULL,LowestHematocrit varchar(4) NULL,LowestSerumAlbumin numeric(3,1) NULL,LowHematocritDate Date NULL,LowPotassium varchar(3) NULL,LowPotassiumDate Date NULL,LowSerumAlbuminDate Date NULL,LowSerumSodium varchar(5) NULL,LowSodiumDate Date NULL,LvAneurysmectomy varchar(500) NULL,LvContractionScore varchar(500) NULL,Lvedpvvarchar(999) NULL,MajorMinor varchar(500) NULL,MallampatiScale varchar(500) NULL,MandibularSpace int NULL,MarkedSiteConfirmedC605 varchar(500) NULL,MarkedSiteConfirmedC73 varchar(500) NULL,MazeProcedureC482 varchar(500) NULL,MazeProcedureC512 varchar(500) NULL,Mediastinitis varchar(500) NULL,MedicalSpecialtyF723IEN varchar(50) NULL,MilitarySexualTrauma varchar(500) NULL,MinimallyInvasiveProcYN varchar(500) NULL,MinIntraopTemperatureC numeric(4,1) NULL,MiscCardiacProcedures varchar(500) NULL,MitralRegurgitation varchar(500) NULL,MitralValveProcedure varchar(500) NULL,Myectomy varchar(500) NULL,MyocardialInfarction varchar(500) NULL,MyxomaResection varchar(500) NULL,NeuroDegenerativeDisease varchar(500) NULL,NewMechanicalCirculatory varchar(500) NULL,NonOrLocationF44IEN varchar(50) NULL,NonOrProcedure varchar(500) NULL,NpoAsOrdClinMid varchar(500) NULL,NumberWithIma int NULL,NumberWithOtherArtery int NULL,NumberWithOtherConduit int NULL,NumberWithRadialArtery int NULL,NumberWithVein int NULL,NumOfConcurrentAnesCases int NULL,NumOfPriorHeartSurgeries varchar(500) NULL,NursePresentTime Date NULL,NutritionalImmuneOther varchar(500) NULL,ObservationAdmissionDate varchar(999) NULL,ObservationDischargeDate varchar(999) NULL,ObservationTreatingSpecialtyF42x4IEN varchar(50) NULL,OccurrenceNoProcedure varchar(500) NULL,OnVentilator48Hours varchar(500) NULL,OpDispositionF131x6IEN varchar(50) NULL,OpenWound varchar(500) NULL,OperatingRoomF131x7IEN varchar(50) NULL,OperationsThisAdmission int NULL,OperativeDeath varchar(500) NULL,OralHygiene varchar(500) NULL,OrCleanEndTime Date NULL,OrCleanStartTime Date NULL,OrderNumberF100IEN varchar(50) NULL,OrganSpaceSsi varchar(500) NULL,OriginalDesiredDate Date NULL,OriginalScheduledDate Date NULL,OrSetUpTime int NULL,OtherCardiacOccurrenceF80IEN varchar(50) NULL,OtherCardiacProcedures varchar(235) NULL,OtherCardiacProceduresList varchar(60) NULL,OtherCardiacProceduresYN varchar(500) NULL,OtherCnsOccurrenceF80IEN varchar(50) NULL,OtherNonCtProcedures varchar(245) NULL,OtherOccurrences varchar(500) NULL,OtherOccurrencesIcdF80IEN varchar(50) NULL,OtherProceduresYN varchar(500) NULL,OtherRespiratoryOccurrenceF80IEN varchar(50) NULL,OtherTumorResection varchar(500) NULL,OtherUrinaryTractOccurrenceF80IEN varchar(50) NULL,OtherWoundOccurrenceF80IEN varchar(50) NULL,Packing varchar(500) NULL,PackYears varchar(999) NULL,PacUAdmitScore numeric(6,2) NULL,PacUDischScore numeric(6,2) NULL,PacUDischTime Date NULL,PacuDispositionF131x6IEN varchar(50) NULL,ParaplegiaYN varchar(500) NULL,PaSystolicPressure varchar(999) NULL,PatientEducationAssessment varchar(500) NULL,PatientF2IEN varchar(50) NULL,PatientVoided varchar(500) NULL,PawMeanPressure varchar(999) NULL,Pci varchar(500) NULL,PerfusionistF200IEN varchar(50) NULL,Pericardiectomy varchar(500) NULL,PerioperativeMi varchar(500) NULL,PeripheralNerveInjury varchar(500) NULL,PeripheralVascularDisease varchar(500) NULL,PfssAccountReferenceF375IEN varchar(50) NULL,PgyOfPrimarySurgeon int NULL,PlannedPrinDiagnosisCodeF80IEN varchar(50) NULL,PlannedPrinProcedureCodeF81IEN varchar(50) NULL,Pneumonia varchar(500) NULL,PositiveDrugScreening varchar(500) NULL,PostopAnesNoteDate Date NULL,PostopAtrialFibrillation varchar(500) NULL,PostopAttendingConcurrence varchar(500) NULL,PostopBleedingTransfusions varchar(500) NULL,PostopBp varchar(10) NULL,PostopConsciousF135x4IEN varchar(50) NULL,PostopConvers varchar(500) NULL,PostopMoodF135x3IEN varchar(50) NULL,PostopPulse int NULL,PostopResp int NULL,PostopSkinColor varchar(500) NULL,PostopSkinIntegF135x2IEN varchar(50) NULL,PreAdmissionTesting varchar(500) NULL,Pregnancy varchar(500) NULL,PreopAlkPhosphataseDate Date NULL,PreopAnionGapDate Date NULL,PreopAtrialFibrillation varchar(500) NULL,PreopAttendingConcurrence varchar(500) NULL,PreopBloodPressure varchar(10) NULL,PreopCirculatoryDevice varchar(500) NULL,PreopConsciousF135x4IEN varchar(50) NULL,PreopConverse varchar(500) NULL,PreoperativeAlkPhosphatase varchar(5) NULL,PreoperativeAnionGap varchar(5) NULL,PreoperativeBun varchar(5) NULL,PreoperativeBunDate Date NULL,PreoperativeCpk int NULL,PreoperativeCpkDate Date NULL,PreoperativeGlucose int NULL,PreoperativeGlucoseDate Date NULL,PreoperativeHeartRate int NULL,PreoperativeHematocrit varchar(4) NULL,PreoperativeHemoglobin varchar(7) NULL,PreoperativeHemoglobinDate Date NULL,PreoperativeImagesConfirmed varchar(500) NULL,PreoperativeImagingConfirmed varchar(500) NULL,PreoperativeInr varchar(5) NULL,PreoperativeInrDate Date NULL,PreoperativeMbBand int NULL,PreoperativeMbBandDate Date NULL,PreoperativePlateletCount varchar(5) NULL,PreoperativePotassium numeric(3,1) NULL,PreoperativePt varchar(4) NULL,PreoperativePtControl numeric(4,1) NULL,PreoperativePtDate Date NULL,PreoperativePtt varchar(5) NULL,PreoperativePttControl numeric(4,1) NULL,PreoperativePttDate Date NULL,PreoperativeSepsis varchar(500) NULL,PreoperativeSerumAlbumin varchar(4) NULL,PreoperativeSerumCreatinine varchar(4) NULL,PreoperativeSerumSodium varchar(5) NULL,PreoperativeSgot varchar(5) NULL,PreoperativeSgpt numeric(5,1) NULL,PreoperativeSleepApnea varchar(500) NULL,PreoperativeTotalBilirubin varchar(5) NULL,PreoperativeUseOfIabp varchar(500) NULL,PreoperativeWbc varchar(4) NULL,PreoperativeWbcDate Date NULL,PreopFunctHealthStatus varchar(500) NULL,PreopHematocritDate Date NULL,PreopMedRailUp varchar(500) NULL,PreopMoodF135x3IEN varchar(50) NULL,PreopPlateletCountDate Date NULL,PreopPotassiumDate Date NULL,PreopRespiratoryRate int NULL,PreopSerumAlbuminDate Date NULL,PreopSerumCreatinineDate Date NULL,PreopSerumSodiumDate Date NULL,PreopSkinColor varchar(500) NULL,PreopSkinIntegF135x2IEN varchar(50) NULL,PreopTemperature numeric(5,1) NULL,PreopTotalBilirubinDate Date NULL,PreopWeightKg int NULL,PreviousCardiacSurgery varchar(500) NULL,PreviouslyScheduledCaseF130IEN varchar(50) NULL,PreviousPci varchar(500) NULL,PrimaryCauseForDelay varchar(500) NULL,PrincAnesthetistF200IEN varchar(50) NULL,PrincipalDiagnosis varchar(40) NULL,PrincipalPostOpDiag varchar(40) NULL,PrincipalPreOpDiagnosis varchar(40) NULL,PrincipalProcedure varchar(135) NULL,PrinPreOpIcdDiagnosisCodeF80IEN varchar(50) NULL,PriorHeartSurgeries varchar(10) NULL,PriorMi varchar(500) NULL,ProcedureCompleted varchar(500) NULL,ProcedureToBePerformed varchar(500) NULL,ProcedureType varchar(500) NULL,Proj112Shad varchar(500) NULL,ProsthesisRem varchar(500) NULL,ProviderF200IEN varchar(50) NULL,PulmonaryEdema varchar(500) NULL,PulmonaryEmbolism varchar(500) NULL,PulmonaryRales varchar(500) NULL,PulmonaryValveProcedure varchar(500) NULL,PulmonaryYN varchar(500) NULL,QuadriplegiaYN varchar(500) NULL,Race varchar(500) NULL,RadiotherapyInLast90Days varchar(500) NULL,ReadyToTransmit varchar(500) NULL,ReasonForNoAssessment varchar(500) NULL,RecXrayReady varchar(500) NULL,ReDoCircumflexStenosis varchar(999) NULL,ReDoLadStenosis varchar(999) NULL,RedoProcedure varchar(500) NULL,ReDoRtCoronaryStenosis varchar(999) NULL,ReliefAnesthetistF200IEN varchar(50) NULL,RenalFailure varchar(500) NULL,RenalInsufficiency varchar(500) NULL,RenalYN varchar(500) NULL,ReoperationForBleeding varchar(500) NULL,RepeatCardiacSurgProcedure varchar(500) NULL,RepeatVentilatorWIn30Days varchar(500) NULL,ReqAnesthesiaTechnique varchar(500) NULL,ReqBloodAvail varchar(500) NULL,ReqCleanOrContaminated varchar(500) NULL,ReqFrozSect varchar(500) NULL,ReqPhoto varchar(500) NULL,ReqPostopCareF131x6IEN varchar(50) NULL,ReqPreopXRay varchar(50) NULL,RequestBloodAvailability varchar(500) NULL,Requested int NULL,RescheduledCaseF130IEN varchar(50) NULL,RespiratoryOccurrences varchar(500) NULL,RestingStDepression varchar(500) NULL,RestPainGangreneYN varchar(500) NULL,ReTransmission int NULL,ReturnToOrWithin30Days varchar(500) NULL,RevascularizationAmputation varchar(500) NULL,RightCoronaryStenosis varchar(999) NULL,ScheduledDate Date NULL,ScheduledEndTime DateTime NULL,ScheduledProcedure varchar(135) NULL,ScheduledStartTime DateTime NULL,SecondAsstF200IEN varchar(50) NULL,SecondSkinPrepAgentF135x1IEN varchar(50) NULL,SequentialCompressionDevice varchar(500) NULL,SerologyReport varchar(500) NULL,SerumBilirubinCardiac varchar(6) NULL,SerumBilirubinDateCard varchar(999) NULL,SerumPotassiumCardiac varchar(6) NULL,SerumPotassiumDateCardiac varchar(999) NULL,SerumTriglycerideCardiac varchar(6) NULL,SerumTriglycerideDateCar varchar(999) NULL,ServiceConnected varchar(500) NULL,SevereHeadTraumaYN varchar(500) NULL,SgotDatePerformed Date NULL,SgptDatePerformed Date NULL,SharpsCountCorrectYN varchar(500) NULL,SiteMarkTimestamp DateTime NULL,SiteOfProcedure varchar(500) NULL,SkinPrepAgentsF135x1IEN varchar(50) NULL,SkinPreppedBy1F200IEN varchar(50) NULL,SkinPreppedBy2F200IEN varchar(50) NULL,SkinPreppedBy3F200IEN varchar(50) NULL,SouthwestAsiaConditions varchar(500) NULL,SpongeCountCorrectYN varchar(500) NULL,SpongeSharpsInstCounterF200IEN varchar(50) NULL,SqwmExportStatus varchar(500) NULL,Sqwuid varchar(30) NULL,StaffResident varchar(500) NULL,SteroidUseForChronicCond varchar(500) NULL,Stroke varchar(500) NULL,StrokeCva varchar(500) NULL,SuperficialIncisionalSsi varchar(500) NULL,SurgeonF200IEN varchar(50) NULL,SurgeryConsultDate varchar(999) NULL,SurgeryConsultRequested varchar(999) NULL,SurgeryPositionF132IEN varchar(50) NULL,SurgerySpecialtyF137x45IEN varchar(50) NULL,SurgicalPriorityDate DateTime NULL,SurgPresentTime Date NULL,SurgSchedPersonF200IEN varchar(50) NULL,SystemicSepsis varchar(500) NULL,TimeNurseOutOfOr Date NULL,TimeOperationBegan Date NULL,TimeOperationEnds Date NULL,TimeOutVerified varchar(500) NULL,TimePatInHoldArea Date NULL,TimePatInOr Date NULL,TimePatOutOr Date NULL,TimeProcedureBegan Date NULL,TimeProcedureEnded Date NULL,TiuAnesthesiaReportF8925IEN varchar(50) NULL,TiuNurseIntraopReportF8925IEN varchar(50) NULL,TiuOperativeSummaryF8925IEN varchar(50) NULL,TiuProcedureReportNonOrF8925IEN varchar(50) NULL,Tmr varchar(500) NULL,TobaccoUse varchar(500) NULL,TobaccoUseTimeframe varchar(500) NULL,TotalCholesterolCardiac varchar(6) NULL,TotalCholesterolDate varchar(999) NULL,TotalCpbTime int NULL,TotalIschemicTime int NULL,TotalUrineOutputMl int NULL,TovTimestamp DateTime NULL,Tracheostomy varchar(500) NULL,TransferStatus varchar(500) NULL,Transfusion4RbcUnits varchar(500) NULL,TransToOrByF131x01IEN varchar(50) NULL,TricuspidValveProcedure varchar(500) NULL,TubesAndDrains varchar(80) NULL,TumorInvolvingCnsYN varchar(500) NULL,UAIn48Hrs varchar(500) NULL,UnplannedIntubationYN varchar(500) NULL,UrinaryTractInfection varchar(500) NULL,UrinaryTractOccurrences varchar(500) NULL,ValidConsentForm varchar(500) NULL,ValuablesSecured varchar(500) NULL,ValveRepair varchar(500) NULL,VascularYN varchar(500) NULL,VentilatorDependent varchar(500) NULL,VerfifyIdTagSsn varchar(500) NULL,VerifierF200IEN varchar(50) NULL,VisitF9000010IEN varchar(50) NULL,VsdRepair varchar(500) NULL,WaitTimeStart Date NULL,Weight varchar(999) NULL,WeightLoss10 varchar(500) NULL,WoundClassification varchar(500) NULL,WoundDisruption varchar(500) NULL,WoundOccurrences varchar(500) NULL,  OpCode [char](1) NULL,  VistaCreateDate datetime NOT NULL,  VistaEditDate datetime NOT NULL  ";
            String test2 = "SurgeryF130IEN  varchar(50) not null,   Sta3n int not null,  30DayDeath varchar(500) NULL,30DayPostopStatus varchar(500) NULL,AbsentPeripheralPulses varchar(500) NULL,ActiveEndocarditis varchar(500) NULL,ActiveHepatitis varchar(500) NULL,AcuteRenalFailure varchar(500) NULL,AddressPlate varchar(500) NULL,AdmissionTransferDate varchar(999) NULL,AdmitPacUTime Date NULL,AgentOrangeExposure varchar(500) NULL,AirwayIndex varchar(500) NULL,AnesAvailTime Date NULL,AnesCareBillableTimeFlag varchar(500) NULL,AnesCareEndTime Date NULL,AnesCareStartTime Date NULL,AnesMedicallyDirected varchar(500) NULL,AnesPersonallyPerformed varchar(500) NULL,AnesPhysicianAvailable varchar(500) NULL,AnesSuperviseCodeF132x95IEN varchar(50) NULL,AnesthesiologistSupvrF200IEN varchar(50) NULL,AnesthetistCategory varchar(500) NULL,Angina varchar(500) NULL,AnginaOneMonthPrior varchar(500) NULL,AntibioticProphylaxis varchar(500) NULL,AorticStenosis varchar(500) NULL,AorticSystolicPressure varchar(999) NULL,AorticValveProcedure varchar(500) NULL,AppropriateDvtProphylaxis varchar(500) NULL,AsaClassF132x8IEN varchar(50) NULL,Ascites varchar(500) NULL,AsdRepair varchar(500) NULL,AssessmentCompletedByF200IEN varchar(50) NULL,AssessmentStatus varchar(500) NULL,AssessmentType varchar(500) NULL,AssociatedClinicF44IEN varchar(50) NULL,AsstAnesthetistF200IEN varchar(50) NULL,AsstPerfusionistF200IEN varchar(50) NULL,AttendingCodeF132x9IEN varchar(50) NULL,AttendingCodeNotUsed varchar(500) NULL,AttendProviderF200IEN varchar(50) NULL,AttendSurgF200IEN varchar(50) NULL,AvailabilityOfSpecialEquip varchar(500) NULL,BathShampoo varchar(500) NULL,BatistaProcedureUsedYN varchar(500) NULL,BleedingDisorders varchar(500) NULL,BleedingPttTimeIn48Hrs varchar(500) NULL,BloodAvailability varchar(500) NULL,BloodLossMl int NULL,BloodSugarIn7Days varchar(500) NULL,BloodTypeXmatch varchar(500) NULL,Bnp varchar(5) NULL,BnpDate varchar(999) NULL,BridgeToTransplantDevice varchar(500) NULL,BunIn7Days varchar(500) NULL,CancelDate DateTime NULL,CancellationAvoidable varchar(500) NULL " +" ,CancellationComments varchar(50) NULL,CancelledByF200IEN varchar(50) NULL,CancelReasonF135IEN varchar(50) NULL,CardiacArrestReqCpr varchar(500) NULL,CardiacCatheterizationDate DateTime NULL,CardiacOccurrences varchar(500) NULL,CardiacResourceDataComments varchar(130) NULL,CardiacRiskPreopComments varchar(130) NULL,CardiacSurgicalPriority varchar(500) NULL,CardiacSurgPerformedNonVa varchar(500) NULL,CardiacTransplant varchar(500) NULL,CardiacYN varchar(500) NULL,Cardiomegaly varchar(500) NULL,CarePlanInChart varchar(500) NULL,CaseScheduleOrder varchar(35) NULL,CaseScheduleType varchar(500) NULL,CaseVerification varchar(500) NULL,CbcIn48Hrs varchar(500) NULL,CentralNervousSystemYN varchar(500) NULL,CerebralVascularDisease varchar(500) NULL,ChecklistConfirmedByF200IEN varchar(50) NULL,ChemotherapyInLast30Days varchar(500) NULL,ChestXrayIn7Days varchar(500) NULL,ChfWithinOneMonth varchar(500) NULL,CigMatchValRem varchar(500) NULL,CircumflexStenosis varchar(999) NULL,ClassificationEnteredYN varchar(500) NULL,CleanDressing varchar(500) NULL,CleanHospCloth varchar(500) NULL,ClerkChnDateProcedure int NULL,ClerkChnDaysBefore int NULL,ClerkChnRecForMajSurg int NULL,ClostridiumDifficileColitis varchar(500) NULL,CnsOccurrences varchar(500) NULL,CodingVerifierF200IEN varchar(50) NULL,Coma varchar(500) NULL,Coma24HoursPostop varchar(500) NULL,CombatVet varchar(500) NULL,ConcurrentCaseF130IEN varchar(50) NULL,ConfirmPatientIdentity varchar(500) NULL,ConfirmPatientPosition varchar(500) NULL,CongestiveHeartFailure varchar(500) NULL,ConsentSigWit varchar(500) NULL,ConvertFromOffPumpToCpb varchar(500) NULL,CoronariesWithStenosis int NULL,CorrectMedicalImplants varchar(500) NULL,CountVerifierF200IEN varchar(50) NULL,CptOnNurseReport varchar(500) NULL,CreateRiskAssessment varchar(500) NULL,CrossmatchScreenAutologous varchar(500) NULL,CurrentDigoxinUse varchar(500) NULL,CurrentDiureticUse varchar(500) NULL,CurrentlyOnDialysis varchar(500) NULL,CurrentPneumonia varchar(500) NULL,CurrentSmoker varchar(500) NULL,CurrentSmokerCardiac varchar(500) NULL,CvaStrokeNoNeuroDeficit varchar(500) NULL,CvaStrokeWithNeuroDeficit varchar(500) NULL,CvdRepairObstruction varchar(500) NULL,DateAssessmentCompleted Date NULL,DateOfDeath varchar(999) NULL,DateOfLastTransmission DateTime NULL,DateOfOperation DateTime NULL,DateOfProcedure DateTime NULL,DateOfTranscription DateTime NULL,DateTimeOfDictation DateTime NULL,DateTimeOrRequestMade DateTime NULL,DateTransmitted DateTime NULL,DeathUnrelatedRelated varchar(500) NULL,DeepIncisionalSsi varchar(500) NULL,DesiredProcedureDate Date NULL,DeviceS varchar(70) NULL,Diabetes varchar(500) NULL,DiabetesCardiac varchar(500) NULL,DiabetesMellitusChronic varchar(500) NULL,DiabetesMellitusPreopMgmt varchar(500) NULL,DiagnosticResultsConfirmByF200IEN varchar(50) NULL,DiagnosticTherapeuticYN varchar(500) NULL,DictatedSummaryExpected varchar(500) NULL,DischargedViaF131x01IEN varchar(50) NULL,DischargeTransferDate varchar(999) NULL,DisseminatedCancerYN varchar(500) NULL,DivisionF4IEN varchar(50) NULL,DnrStatus varchar(500) NULL,Dressing varchar(50) NULL,DressingCondition varchar(500) NULL,DrugAddiction varchar(500) NULL,DTOfDesiredProcedureDate DateTime NULL,DTOfScheduledDateEntry DateTime NULL,DTPatientDischFromIcu varchar(999) NULL,DTPatientExtubated varchar(999) NULL,DvtThrombophlebitis varchar(500) NULL,DynamedNotified varchar(500) NULL,Dyspnea varchar(500) NULL,EkgIn24Hrs varchar(500) NULL,ElectrocauteryUnit varchar(50) NULL,ElectrogroundPosition2F138IEN varchar(50) NULL,ElectrogroundPositionF138IEN varchar(50) NULL,ElectrophysiologicProcedure varchar(500) NULL,EmploymentStatusPreoperative varchar(500) NULL,EndBp varchar(10) NULL,Endocarditis varchar(500) NULL,EndovascularRepair varchar(500) NULL,EndPulse int NULL,EndResp int NULL,EnemaSIfOrd varchar(500) NULL,EsophagealVarices varchar(500) NULL,EstimatedCaseLength varchar(7) NULL,EstimateOfMortality int NULL,EstimateOfMortalityDate varchar(999) NULL,EsuCoagRange varchar(30) NULL,EsuCuttingRange varchar(30) NULL,Etoh2DrinksDay varchar(500) NULL,Fev1 varchar(999) NULL,FinalAnesthesiaTempC numeric(4,1) NULL,FinalCountsVerifyCorrect varchar(500) NULL,FirstAsstF200IEN varchar(50) NULL,FlashContamination int NULL,FlashDecontamination int NULL,FlashEmergencyCase int NULL,FlashLoanerInstrument int NULL,FlashNoBetterOption int NULL,FlashSpdOrMgtIssue int NULL,FoleyCatheterInsertedByF200IEN varchar(50) NULL,FoleyCatheterSize int NULL,ForeignBodyRemoval varchar(500) NULL,FreshlyShaved varchar(500) NULL,FunctionalHealthStatus varchar(500) NULL,GastricOutput int NULL,GastrointestinalYN varchar(500) NULL,GeneralYN varchar(500) NULL,GraftProsthesisFlapFailure varchar(500) NULL,GreatVesselRepairYN varchar(500) NULL,HairRemovalByF200IEN varchar(50) NULL,HairRemovalMethod varchar(500) NULL,HdlCardiac varchar(6) NULL,HdlDate varchar(999) NULL,HeadAndOrNeckCancer varchar(500) NULL,Height varchar(999) NULL,HeightMeasurementDate Date NULL,HemiplegiaHemiparesisYN varchar(500) NULL,HemoglobinA1c varchar(6) NULL,HemoglobinA1cDate varchar(999) NULL,HepatobiliaryYN varchar(500) NULL,Hepatomegaly varchar(500) NULL,HighAnionGapDate Date NULL,HighCpkDate Date NULL,HighCpkMbDate Date NULL,HighestAnionGap varchar(5) NULL,HighestCpk varchar(6) NULL,HighestCpkMb varchar(4) NULL,HighestGlucose numeric(5,1) NULL,HighestPotassium varchar(3) NULL,HighestSerumCreatinine varchar(4) NULL,HighestSerumSodium varchar(5) NULL,HighestSerumTroponinI varchar(5) NULL,HighestSerumTroponinT varchar(5) NULL,HighestTotalBilirubin varchar(5) NULL,HighestWbc varchar(4) NULL,HighestWbcDate Date NULL,HighGlucoseDate Date NULL,HighPotassiumDate Date NULL,HighSerumCreatinineDate Date NULL,HighSerumSodiumDate Date NULL,HighSerumTroponinIDate Date NULL,HighSerumTroponinTDate Date NULL,HighTotalBilirubinDate Date NULL,HistoryOfCopd varchar(500) NULL,HistoryOfCvd varchar(500) NULL,HistoryOfMi varchar(500) NULL,HistoryOfTiaS varchar(500) NULL,Homeless varchar(500) NULL,HospitalAdmissionDate varchar(999) NULL,HospitalDischargeDate varchar(999) NULL,Hypertension varchar(500) NULL,HypertensionRequiringMeds varchar(500) NULL,IcdOnNurseReport varchar(500) NULL,IleusBowelObstruction varchar(500) NULL,ImagTimestamp DateTime NULL,ImpairedSensorium varchar(500) NULL,IncisionType varchar(500) NULL,InductionComplete Date NULL,InOutPatientStatus varchar(500) NULL,InstCntCorrect varchar(500) NULL,InstCntVerfByF200IEN varchar(50) NULL,InstrumentCountCorrectYN varchar(500) NULL,IntraopDisseminatedCancer varchar(500) NULL,IntraoperativeAscites varchar(500) NULL,IntraoperativeXRays varchar(500) NULL,IntraopRbcUnitsTransfused varchar(999) NULL,IonizingRadiationExposure varchar(500) NULL,IvNtgWithin48Hours varchar(500) NULL,IvStartedByF200IEN varchar(50) NULL,LadStenosis varchar(999) NULL,LaserType varchar(30) NULL,LdlCardiac varchar(6) NULL,LdlDateCardiac varchar(999) NULL,LeftMainStenosis varchar(999) NULL,LengthOfPostOpStay varchar(999) NULL,LevinTubeCath varchar(500) NULL,LockCase varchar(500) NULL,LowCardiacOutput6Hours varchar(500) NULL,LowestHematocrit varchar(4) NULL,LowestSerumAlbumin numeric(3,1) NULL,LowHematocritDate Date NULL,LowPotassium varchar(3) NULL,LowPotassiumDate Date NULL,LowSerumAlbuminDate Date NULL,LowSerumSodium varchar(5) NULL,LowSodiumDate Date NULL,LvAneurysmectomy varchar(500) NULL,LvContractionScore varchar(500) NULL,Lvedpvvarchar(999) NULL,MajorMinor varchar(500) NULL,MallampatiScale varchar(500) NULL,MandibularSpace int NULL,MarkedSiteConfirmedC605 varchar(500) NULL,MarkedSiteConfirmedC73 varchar(500) NULL,MazeProcedureC482 varchar(500) NULL,MazeProcedureC512 varchar(500) NULL,Mediastinitis varchar(500) NULL,MedicalSpecialtyF723IEN varchar(50) NULL,MilitarySexualTrauma varchar(500) NULL,MinimallyInvasiveProcYN varchar(500) NULL,MinIntraopTemperatureC numeric(4,1) NULL,MiscCardiacProcedures varchar(500) NULL,MitralRegurgitation varchar(500) NULL,MitralValveProcedure varchar(500) NULL,Myectomy varchar(500) NULL,MyocardialInfarction varchar(500) NULL,MyxomaResection varchar(500) NULL,NeuroDegenerativeDisease varchar(500) NULL,NewMechanicalCirculatory varchar(500) NULL,NonOrLocationF44IEN varchar(50) NULL,NonOrProcedure varchar(500) NULL,NpoAsOrdClinMid varchar(500) NULL,NumberWithIma int NULL,NumberWithOtherArtery int NULL,NumberWithOtherConduit int NULL,NumberWithRadialArtery int NULL,NumberWithVein int NULL,NumOfConcurrentAnesCases int NULL,NumOfPriorHeartSurgeries varchar(500) NULL,NursePresentTime Date NULL,NutritionalImmuneOther varchar(500) NULL,ObservationAdmissionDate varchar(999) NULL,ObservationDischargeDate varchar(999) NULL,ObservationTreatingSpecialtyF42x4IEN varchar(50) NULL,OccurrenceNoProcedure varchar(500) NULL,OnVentilator48Hours varchar(500) NULL,OpDispositionF131x6IEN varchar(50) NULL,OpenWound varchar(500) NULL,OperatingRoomF131x7IEN varchar(50) NULL,OperationsThisAdmission int NULL,OperativeDeath varchar(500) NULL,OralHygiene varchar(500) NULL,OrCleanEndTime Date NULL,OrCleanStartTime Date NULL,OrderNumberF100IEN varchar(50) NULL,OrganSpaceSsi varchar(500) NULL,OriginalDesiredDate Date NULL,OriginalScheduledDate Date NULL,OrSetUpTime int NULL,OtherCardiacOccurrenceF80IEN varchar(50) NULL,OtherCardiacProcedures varchar(235) NULL,OtherCardiacProceduresList varchar(60) NULL,OtherCardiacProceduresYN varchar(500) NULL,OtherCnsOccurrenceF80IEN varchar(50) NULL,OtherNonCtProcedures varchar(245) NULL,OtherOccurrences varchar(500) NULL,OtherOccurrencesIcdF80IEN varchar(50) NULL,OtherProceduresYN varchar(500) NULL,OtherRespiratoryOccurrenceF80IEN varchar(50) NULL,OtherTumorResection varchar(500) NULL,OtherUrinaryTractOccurrenceF80IEN varchar(50) NULL,OtherWoundOccurrenceF80IEN varchar(50) NULL,Packing varchar(500) NULL,PackYears varchar(999) NULL,PacUAdmitScore numeric(6,2) NULL,PacUDischScore numeric(6,2) NULL,PacUDischTime Date NULL,PacuDispositionF131x6IEN varchar(50) NULL,ParaplegiaYN varchar(500) NULL,PaSystolicPressure varchar(999) NULL,PatientEducationAssessment varchar(500) NULL,PatientF2IEN varchar(50) NULL,PatientVoided varchar(500) NULL,PawMeanPressure varchar(999) NULL,Pci varchar(500) NULL,PerfusionistF200IEN varchar(50) NULL,Pericardiectomy varchar(500) NULL,PerioperativeMi varchar(500) NULL,PeripheralNerveInjury varchar(500) NULL,PeripheralVascularDisease varchar(500) NULL,PfssAccountReferenceF375IEN varchar(50) NULL,PgyOfPrimarySurgeon int NULL,PlannedPrinDiagnosisCodeF80IEN varchar(50) NULL,PlannedPrinProcedureCodeF81IEN varchar(50) NULL,Pneumonia varchar(500) NULL,PositiveDrugScreening varchar(500) NULL,PostopAnesNoteDate Date NULL,PostopAtrialFibrillation varchar(500) NULL,PostopAttendingConcurrence varchar(500) NULL,PostopBleedingTransfusions varchar(500) NULL,PostopBp varchar(10) NULL,PostopConsciousF135x4IEN varchar(50) NULL,PostopConvers varchar(500) NULL,PostopMoodF135x3IEN varchar(50) NULL,PostopPulse int NULL,PostopResp int NULL,PostopSkinColor varchar(500) NULL,PostopSkinIntegF135x2IEN varchar(50) NULL,PreAdmissionTesting varchar(500) NULL,Pregnancy varchar(500) NULL,PreopAlkPhosphataseDate Date NULL,PreopAnionGapDate Date NULL,PreopAtrialFibrillation varchar(500) NULL,PreopAttendingConcurrence varchar(500) NULL,PreopBloodPressure varchar(10) NULL,PreopCirculatoryDevice varchar(500) NULL,PreopConsciousF135x4IEN varchar(50) NULL,PreopConverse varchar(500) NULL,PreoperativeAlkPhosphatase varchar(5) NULL,PreoperativeAnionGap varchar(5) NULL,PreoperativeBun varchar(5) NULL,PreoperativeBunDate Date NULL,PreoperativeCpk int NULL,PreoperativeCpkDate Date NULL,PreoperativeGlucose int NULL,PreoperativeGlucoseDate Date NULL,PreoperativeHeartRate int NULL,PreoperativeHematocrit varchar(4) NULL,PreoperativeHemoglobin varchar(7) NULL,PreoperativeHemoglobinDate Date NULL,PreoperativeImagesConfirmed varchar(500) NULL,PreoperativeImagingConfirmed varchar(500) NULL,PreoperativeInr varchar(5) NULL,PreoperativeInrDate Date NULL,PreoperativeMbBand int NULL,PreoperativeMbBandDate Date NULL,PreoperativePlateletCount varchar(5) NULL,PreoperativePotassium numeric(3,1) NULL,PreoperativePt varchar(4) NULL,PreoperativePtControl numeric(4,1) NULL,PreoperativePtDate Date NULL,PreoperativePtt varchar(5) NULL,PreoperativePttControl numeric(4,1) NULL,PreoperativePttDate Date NULL,PreoperativeSepsis varchar(500) NULL,PreoperativeSerumAlbumin varchar(4) NULL,PreoperativeSerumCreatinine varchar(4) NULL,PreoperativeSerumSodium varchar(5) NULL,PreoperativeSgot varchar(5) NULL,PreoperativeSgpt numeric(5,1) NULL,PreoperativeSleepApnea varchar(500) NULL,PreoperativeTotalBilirubin varchar(5) NULL,PreoperativeUseOfIabp varchar(500) NULL,PreoperativeWbc varchar(4) NULL,PreoperativeWbcDate Date NULL,PreopFunctHealthStatus varchar(500) NULL,PreopHematocritDate Date NULL,PreopMedRailUp varchar(500) NULL,PreopMoodF135x3IEN varchar(50) NULL,PreopPlateletCountDate Date NULL,PreopPotassiumDate Date NULL,PreopRespiratoryRate int NULL,PreopSerumAlbuminDate Date NULL,PreopSerumCreatinineDate Date NULL,PreopSerumSodiumDate Date NULL,PreopSkinColor varchar(500) NULL,PreopSkinIntegF135x2IEN varchar(50) NULL,PreopTemperature numeric(5,1) NULL,PreopTotalBilirubinDate Date NULL,PreopWeightKg int NULL,PreviousCardiacSurgery varchar(500) NULL,PreviouslyScheduledCaseF130IEN varchar(50) NULL,PreviousPci varchar(500) NULL,PrimaryCauseForDelay varchar(500) NULL,PrincAnesthetistF200IEN varchar(50) NULL,PrincipalDiagnosis varchar(40) NULL,PrincipalPostOpDiag varchar(40) NULL,PrincipalPreOpDiagnosis varchar(40) NULL,PrincipalProcedure varchar(135) NULL,PrinPreOpIcdDiagnosisCodeF80IEN varchar(50) NULL,PriorHeartSurgeries varchar(10) NULL,PriorMi varchar(500) NULL,ProcedureCompleted varchar(500) NULL,ProcedureToBePerformed varchar(500) NULL,ProcedureType varchar(500) NULL,Proj112Shad varchar(500) NULL,ProsthesisRem varchar(500) NULL,ProviderF200IEN varchar(50) NULL,PulmonaryEdema varchar(500) NULL,PulmonaryEmbolism varchar(500) NULL,PulmonaryRales varchar(500) NULL,PulmonaryValveProcedure varchar(500) NULL,PulmonaryYN varchar(500) NULL,QuadriplegiaYN varchar(500) NULL,Race varchar(500) NULL,RadiotherapyInLast90Days varchar(500) NULL,ReadyToTransmit varchar(500) NULL,ReasonForNoAssessment varchar(500) NULL,RecXrayReady varchar(500) NULL,ReDoCircumflexStenosis varchar(999) NULL,ReDoLadStenosis varchar(999) NULL,RedoProcedure varchar(500) NULL,ReDoRtCoronaryStenosis varchar(999) NULL,ReliefAnesthetistF200IEN varchar(50) NULL,RenalFailure varchar(500) NULL,RenalInsufficiency varchar(500) NULL,RenalYN varchar(500) NULL,ReoperationForBleeding varchar(500) NULL,RepeatCardiacSurgProcedure varchar(500) NULL,RepeatVentilatorWIn30Days varchar(500) NULL,ReqAnesthesiaTechnique varchar(500) NULL,ReqBloodAvail varchar(500) NULL,ReqCleanOrContaminated varchar(500) NULL,ReqFrozSect varchar(500) NULL,ReqPhoto varchar(500) NULL,ReqPostopCareF131x6IEN varchar(50) NULL,ReqPreopXRay varchar(50) NULL,RequestBloodAvailability varchar(500) NULL,Requested int NULL,RescheduledCaseF130IEN varchar(50) NULL,RespiratoryOccurrences varchar(500) NULL,RestingStDepression varchar(500) NULL,RestPainGangreneYN varchar(500) NULL,ReTransmission int NULL,ReturnToOrWithin30Days varchar(500) NULL,RevascularizationAmputation varchar(500) NULL,RightCoronaryStenosis varchar(999) NULL,ScheduledDate Date NULL,ScheduledEndTime DateTime NULL,ScheduledProcedure varchar(135) NULL,ScheduledStartTime DateTime NULL,SecondAsstF200IEN varchar(50) NULL,SecondSkinPrepAgentF135x1IEN varchar(50) NULL,SequentialCompressionDevice varchar(500) NULL,SerologyReport varchar(500) NULL,SerumBilirubinCardiac varchar(6) NULL,SerumBilirubinDateCard varchar(999) NULL,SerumPotassiumCardiac varchar(6) NULL,SerumPotassiumDateCardiac varchar(999) NULL,SerumTriglycerideCardiac varchar(6) NULL,SerumTriglycerideDateCar varchar(999) NULL,ServiceConnected varchar(500) NULL,SevereHeadTraumaYN varchar(500) NULL,SgotDatePerformed Date NULL,SgptDatePerformed Date NULL,SharpsCountCorrectYN varchar(500) NULL,SiteMarkTimestamp DateTime NULL,SiteOfProcedure varchar(500) NULL,SkinPrepAgentsF135x1IEN varchar(50) NULL,SkinPreppedBy1F200IEN varchar(50) NULL,SkinPreppedBy2F200IEN varchar(50) NULL,SkinPreppedBy3F200IEN varchar(50) NULL,SouthwestAsiaConditions varchar(500) NULL,SpongeCountCorrectYN varchar(500) NULL,SpongeSharpsInstCounterF200IEN varchar(50) NULL,SqwmExportStatus varchar(500) NULL,Sqwuid varchar(30) NULL,StaffResident varchar(500) NULL,SteroidUseForChronicCond varchar(500) NULL,Stroke varchar(500) NULL,StrokeCva varchar(500) NULL,SuperficialIncisionalSsi varchar(500) NULL,SurgeonF200IEN varchar(50) NULL,SurgeryConsultDate varchar(999) NULL,SurgeryConsultRequested varchar(999) NULL,SurgeryPositionF132IEN varchar(50) NULL,SurgerySpecialtyF137x45IEN varchar(50) NULL,SurgicalPriorityDate DateTime NULL,SurgPresentTime Date NULL,SurgSchedPersonF200IEN varchar(50) NULL,SystemicSepsis varchar(500) NULL,TimeNurseOutOfOr Date NULL,TimeOperationBegan Date NULL,TimeOperationEnds Date NULL,TimeOutVerified varchar(500) NULL,TimePatInHoldArea Date NULL,TimePatInOr Date NULL,TimePatOutOr Date NULL,TimeProcedureBegan Date NULL,TimeProcedureEnded Date NULL,TiuAnesthesiaReportF8925IEN varchar(50) NULL,TiuNurseIntraopReportF8925IEN varchar(50) NULL,TiuOperativeSummaryF8925IEN varchar(50) NULL,TiuProcedureReportNonOrF8925IEN varchar(50) NULL,Tmr varchar(500) NULL,TobaccoUse varchar(500) NULL,TobaccoUseTimeframe varchar(500) NULL,TotalCholesterolCardiac varchar(6) NULL,TotalCholesterolDate varchar(999) NULL,TotalCpbTime int NULL,TotalIschemicTime int NULL,TotalUrineOutputMl int NULL,TovTimestamp DateTime NULL,Tracheostomy varchar(500) NULL,TransferStatus varchar(500) NULL,Transfusion4RbcUnits varchar(500) NULL,TransToOrByF131x01IEN varchar(50) NULL,TricuspidValveProcedure varchar(500) NULL,TubesAndDrains varchar(80) NULL,TumorInvolvingCnsYN varchar(500) NULL,UAIn48Hrs varchar(500) NULL,UnplannedIntubationYN varchar(500) NULL,UrinaryTractInfection varchar(500) NULL,UrinaryTractOccurrences varchar(500) NULL,ValidConsentForm varchar(500) NULL,ValuablesSecured varchar(500) NULL,ValveRepair varchar(500) NULL,VascularYN varchar(500) NULL,VentilatorDependent varchar(500) NULL,VerfifyIdTagSsn varchar(500) NULL,VerifierF200IEN varchar(50) NULL,VisitF9000010IEN varchar(50) NULL,VsdRepair varchar(500) NULL,WaitTimeStart Date NULL,Weight varchar(999) NULL,WeightLoss10 varchar(500) NULL,WoundClassification varchar(500) NULL,WoundDisruption varchar(500) NULL,WoundOccurrences varchar(500) NULL,  OpCode [char](1) NULL,  VistaCreateDate datetime NOT NULL,  VistaEditDate datetime NOT NULL  ";
            string test3 = test1 + test2;


Login Interface

$
0
0

Hi,

I am not really good in programming so I really need help..how to settle this error

Error1 The type or namespace name 'UsbLibrary' could not be found (are you missing a using directive or an assembly reference?)c:\users\aniq\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs87 WindowsFormsApplication1

and how to link login interface with USB port system?

Recording Sound with a Microphone in desktop application C#

$
0
0

i want to know is there any .net dll for desktop application to record a sound and save that recording in a mp3 file.

Thanks for any help

C# - SQL - Can't find the table

$
0
0

Hi... Once again..!

I've got a new problem in my database application. When I write anything in my textBoxUser_ID or textBoxPassword and press Log in i get a runtime error (once again) that says:

"The specified table does not exist. [ UserTable ]" Note: UserTable is my database table.

Here is my source:

public partial class LoginForm : Form
    {
        SqlCeConnection con = new SqlCeConnection();

        public LoginForm()
        {
            SqlCeConnection con = new SqlCeConnection();
            con.ConnectionString = "Data Source=C:\\Users\\Gustaf\\Documents\\UserDB.sdf;Password=<Password>";
            InitializeComponent();
        }

        private void LoginForm_Load(object sender, EventArgs e)
        {
            SqlCeConnection con = new SqlCeConnection("Data Source=C:\\Users\\Gustaf\\Documents\\UserDB.sdf;Password=<Password>");
            con.Open();
        }

        private void buttonLogin_CLick(object sender, EventArgs e)
        {
            SqlCeConnection con = new SqlCeConnection();
            con.ConnectionString = "Data Source=C:\\Users\\Gustaf\\Documents\\UserDB.sdf;Password=<Password>";
            con.Open();
            string userID = textBoxUserID.Text;
            string password = textBoxPassword.Text;
            SqlCeCommand cmd = new SqlCeCommand("SELECT User_ID, Password FROM UserTable WHERE User_ID='" + textBoxUserID.Text + "' AND Password='" + textBoxPassword.Text + "'", con);
            SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt); //HERE GOES THE RUNTIME ERROR

            if (dt.Rows.Count > 0)
            {
                MessageBox.Show("Login successful!", "Login successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            else
            {
                MessageBox.Show("Invalid login", "Invalid login", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            con.Close();
        }
    }

Notice: I have checked a lot of other threads and articles but nothing i saw was in plain terms.

//Gustaf

Launcher freezes while downloading.

$
0
0

Hello all ! I'm pretty new to Visual studio and this forum :)

The problem is there when i launch my app... (its launcher for a game) It is planned when user click on start button to check if there are already those files in computer,if there isnt any of them,launcher must download them,extract them and launch game.It's working,but it freezes while downloading.Cannot move it.. even.I will be very happy if somebody give me advice ;)

Thank you!
(Sorry for my bad english)Here's the downloading code.

WebClient downloader = new WebClient();
label4.Text = "Сваляте пълния клиент. Може да отнеме време";
this.Update();
downloader.DownloadFile("link", templocation + "client_full.zip");

label4.Text = "Разопаковане...";
Shell32.Shell sc = new Shell32.Shell();
Directory.CreateDirectory(@"C:\temp\.minecraft");
Shell32.Folder output = sc.NameSpace(@"C:\temp\.minecraft\");
Shell32.Folder input = sc.NameSpace(templocation + "client_full.zip");
output.CopyHere(input.Items(), 256);

label4.Text = "Почистване...";
File.Delete(templocation + "client_full.zip");

Polymorphism

$
0
0

I have two forms.

Form 1: BookIssue

It has following textboxes:-

(a) Book No:

(b) Book Title:

(c) Search Book (button)

Form2: BooksInLibrary

(a) Datagridview to show list of books available in Library.

Problems statement:-

when i click on search book button it loads BooksInLibrary(form2) and display the list of books in the datagridview.

when i click on selected cells in the datagridview, i would like to load Book No and Book Title in BookIssue form textboxes.

Question is:-

How would i make form1 textboxes visible in form2, so that data listed in datagridview gets loaded in form1 textboxes on cells click event.

c sharp syntax question time_t

$
0
0

Hi,

I have trending data stored for decades.

It stores a timestamp in a 32-bit time-t format as used by the c runtime library function "localtime"

Now in a c sharp application I need to examine this value and determine the month.

What's the easiest/best-practice way to convert this number?

Boyd


BDM

Verify localisations have the same ID's as the default localisation?

$
0
0

How does one verify that the foreign localisation files (UserMessages.de-DE.resx, UserMessages.es-ES.resx) have the same IDs as the default localisation file (UserMessages.resx)?

UserMessages.resx:
ID_Error "You Have an Error"
ID_AnyKey "Press Any Key to Continue."
ID_Results "Summing Multiples of 3 and 5 up to {0} is {1}."

UserMessage.de-DE.resx:
<ID_Error is missing>
ID_AnyKey "Drücken Sie eine beliebige Taste, um fortzufahren."
ID_Results "Zusammenfassend Multiples von 3 und 5 bis zu {0} ist {1}."

UserMessage.es-ES.resx:
ID_Error "Usted tiene un error."
ID_AnyKey "Pulse cualquier tecla para continuar."
ID_Results "Resumiendo múltiplos de 3 y 5 hasta {0} es {1} ."
ID_Misc "Añadir un poco de texto loco." <ID_Misc is Extra>

Assuming the default, UserMessages.resx, has the correct and complete set of values; how can one determine if the foreign localisation files do not add nor omit an item?

-----

I looked at enumerating trough the items, could not determine how...

Edit: Using Visual Studio 2012, 2013 and .NET 4.5, 4.5.2


Reading From text file (datagridview)

$
0
0

Ive this program that writes 3 texts box into a text file and then another form reads the text file and shows the data in grid viewer. what it does is that it reads the first line from text file and shows is as NAME second line as PHONE And third line as address. what i want is that is there a possibility that i can skip line two and goto line three directly ?

Download Program

form 1 :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace filing
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        TextWriter tw;
        private void btn_save_Click(object sender, EventArgs e)
        {
            using (tw = new StreamWriter("file.txt" , true))
            {
                tw.WriteLine(txt_name.Text);
                tw.WriteLine(txt_phone.Text);
                tw.WriteLine(txt_address.Text);
            }

            Form2 f2 = new Form2();
            f2.Show();
        }
    }
}

form 2 :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace filing
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        TextReader tr;
        private void Form2_Load(object sender, EventArgs e)
        {

            using (tr = new StreamReader("file.txt"))
            {
                string alldata = File.ReadAllText("file.txt");
                var lines = alldata.Split(new char[] { '\n' });
                var linenumber = lines.Count();

                for (int i = 0; i < (linenumber / 3); i++)
                {
                    dataGridView1.Rows.Add(tr.ReadLine(), tr.ReadLine(), tr.ReadLine());
                }

            }
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

            using (tr = new StreamReader("file.txt"))
            {
                string line;
                while ((line = tr.ReadLine()) != null)
                {
                    if (line.Contains("faisal"))
                    {
                        string phone = tr.ReadLine();
                    }
                }
            }
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            using (tr = new StreamReader("file.txt"))
            {
                string alldata = File.ReadAllText("file.txt");
                var lines = alldata.Split(new char[] { '\n' });
                var linenumber = lines.Count();


                for (int i = 0; i < (linenumber / 3); i++)
                {
                    string name = tr.ReadLine();
                    if (name.Contains(textBox1.Text))
                    {
                        dataGridView1.Rows.Add(name, tr.ReadLine(), tr.ReadLine());
                    }


                }
            }
        }
    }
}


When invoking the "SetPassword" to the AD User

$
0
0

I have experienced the following

when invoking the "SetPassword" function using the below code

dEntry.Invoke("SetPassword", new object[] { newPassword });

then it is not checking the Password History and Age.

Is there any msdn Link which documented this?

Thanks in Advance,

Rahul R

Shell 32 Unzip Help !

$
0
0

Hi guys,yesterday i found my problem solution here,so im comming back for some help :))
Im doing a game launcher.App must dowload it,extract it to other folder,delete zip file after extracting and run the game.
Problem is there,app is creating the folders req for this process and downloading the file,but after that nothing!!!:X

I will be verry happy if somebody got a solution for that problem too :))
Peace.

else
{
Thread thread = new Thread(() =>
{
WebClient downloader = new WebClient();
downloader.DownloadProgressChanged += new DownloadProgressChangedEventHandler(downloader_DownloadProgressChanged);
downloader.DownloadFileCompleted += new AsyncCompletedEventHandler(downloader_DownloadFileCompleted);
downloader.DownloadFileAsync(new Uri("LINK!!"), templocation + "test.zip");


Shell32.Shell sc = new Shell32.Shell();
Directory.CreateDirectory("C:\\temp\\.game");
Shell32.Folder DestFolder =sc.NameSpace("C:\\Hysteria\\.game");
Shell32.Folder SrcFile = sc.NameSpace("C:\\temp\\test.zip");
Shell32.FolderItems items = SrcFile.Items();
DestFolder.CopyHere(items, 4 | 16);

new Microsoft.VisualBasic.Devices.Computer().FileSystem.CopyDirectory("C:\\temp\\.game", folderlocation, true);


});
thread.Start();



object state manager

$
0
0


I've imported a few tables from an MS ACCESS .mdb database to a new MS SQL  server database.

 I made a data entry form with a C# program code, but when I try to save the canges made in my form, the following message is appearing: "Store update, insert or delete statement affected an unexpected number of rows(0).......Refresh ObjectStateManager entries."   Where can I find the OSM, and what to do there?  

Using two threads to print numbers.---Satckoverflow exception

$
0
0

Here is the question: Write a multi threaded C# code with one thread printing all even numbers and the other all odd numbers. The output should always be in sequence. IE. 0,1,2,3,4....etc

My code does print but there are two questions.

  1. It uses one thread sometimes.
  2. There is an exception--An unhandled exception of type 'System.StackOverflowException' occurred in PrintEvenOddThreads.exe

My code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace PrintEvenOddThreads
{
    class Program
    {
        static Object obj = new Object();
        static Thread t1;
        static Thread t2;
        static LinkedList<int> a = new LinkedList<int>();
        static void Main(string[] args)
        {
            for (int i = 0; i < 10; i++)
            {
                a.AddLast(i);
            }

            t1 = new Thread(PrintOdd);
            t2 = new Thread(PrintEven);
            t1.Name = "Odd";
            t2.Name = "Even";
            t1.Start();
            t2.Start();
            t1.Join();
            t2.Join();

            Console.WriteLine("Done!");
            Console.Read();
        }

        private static void PrintOdd()
        {
            Monitor.Enter(obj);
            {
                while (a.Count > 0)
                {
                    int x = a.First();
                    a.RemoveFirst();
                    if (x % 2 != 0)
                        Console.WriteLine(Thread.CurrentThread.Name + " " + x);
                    else
                    {
                        a.AddFirst(x);
                        break;
                    }
                }
            }
            Monitor.Exit(obj);
            PrintEven();
        }

        private static void PrintEven()
        {
            Monitor.Enter(obj);
            {
                while (a.Count > 0)
                {
                    int x = a.First();
                    a.RemoveFirst();
                    if (x % 2 == 0)
                        Console.WriteLine(Thread.CurrentThread.Name + " " + x);
                    else
                    {
                        a.AddFirst(x);
                        break;
                    }
                }
            }
            Monitor.Exit(obj);
            PrintOdd();
        }
    }
}
Please help me to figure out what is wrong also what is the right queue for it? I use LinkedList here. Perhaps stack is better?

c# Is it possible to play 2 sound back to back using soudplayer ?

$
0
0

Hello,

I'm looking for a way to play multiples sound back to back asyncronously.

I actually have :

            jouerSon("_" + nbre1);
            jouerSon(operateur);
            jouerSon("_" + nbre2);
            jouerSon("equal");

public void jouerSon(String son)
        {
            System.Media.SoundPlayer player = new SoundPlayer();
            player.Stream = Properties.Resources.ResourceManager.GetStream(son);
           // player.LoadAsync();
            player.Play();
            //Thread.Sleep(500);
            //player.Stop();

}

I'd like to play the first sound, then when it's over the second one etc all while the program is still responsive.

I managed to play each sound one after another but only using a syncronous play, which prevent the user from doing anything until all sound are played.

And if I try using with an asyncronous play, only the last sound is played instead of each one.

I've looked around for a solution, but can't seem to find any.

Any help is welcome.

Thanks.

Summing the values in listview, cannot access column for value

$
0
0

I'm trying to sum the values in column 3 (Jobs) and 4 (Bids) in my listview PlotListView for a WPF application I am working on. This is what I've done so far:

C#

int jobSum = 0;
int bidSum = 0;
foreach (var item in PlotListView.ItemsSource)
{
	jobSum += int.Parse(item.SubItems.Item(3));
	bidSum += int.Parse(item.SubItems.Item(4));
}
JobBidRatioTextBlock.Text = jobSum.ToString();

XAML

<ListView x:Name="PlotListView" HorizontalAlignment="Left" Height="228" Margin="5,37,0,0" VerticalAlignment="Top" Width="424"><ListView.View><GridView AllowsColumnReorder="False"><GridViewColumn Width="99" Header="Plot" DisplayMemberBinding="{Binding PlotId}"/><GridViewColumn Width="99" Header="Area" DisplayMemberBinding="{Binding Area}"/><GridViewColumn Width="99" Header="Jobs" DisplayMemberBinding="{Binding Jobs}"/><GridViewColumn Width="99" Header="Bids" DisplayMemberBinding="{Binding Bids}"/></GridView></ListView.View></ListView>

However, I am now seeing an issue where SubItems is not recognised.

Now I can't seem to figure out how to access the exact column - am I on the right track? What do I need to do?


Is this a problem with the stack? Problem with an asyn procedure after several iterations

$
0
0

In a winform project (VS2012) I am reading content from an httpclient based on parameters that I submit in the url call -- using async.  This appears to be working fine (from the code sample below).  I can even loop/iterated call DownloadPage several times and all works well.  I retrieve data on a daily basis (each day) for 23 different parameters.  I can pick up 60 days worth of day (60 x 23 iterations) no problem.  But when I try like 300 days worth I start getting all sorts of socket exceptions (images of the error messages below).  Is this a problem with the stack?  I am getting connection closed errors (error message below).  How can I deal with this?

private async void DownloadPage(string s1, string s2, string s3, string s4)
{
   string s_url;
   DataTable tbl1 = new DataTable();
   tbl1.Columns.Add("F1")

   s_url = "http://...";
   using (HttpClient client = new HttpClient())
   using (HttpResponseMessage response = await client.GetAsync(s_url))
   using (HttpContent content = response.Content)
   {
       string result = await content.ReadAsStringAsync();

       Thread.Sleep(1000);  //--not sure if I need this delay here

       string[] arr1 = Regex.Split(result, "\n");

       tbl1.Clear();
       DataRow dr1;

       foreach (string s in arr1)  //--this loop stores the raw data from result string to a local dataTable
       {
           dr1 = tbl1.NewRow();
           dr1[0] = s;
           tbl1.Rows.Add(dr1);
       }

       ParseData(s1, s4);  //--this procedure parses the data to individual columns
   }
}

Error Message

-----------------------------------------------------------

System.Reflection.TargetInvocationException was unhandled
  HResult=-2146232828
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at myEFexample3.Program.Main() in c:\AdoNet2\WinFormStuff_myWin7\EntityFrameworkStuff\myEFexample3\myEFexample3\Program.cs:line 23
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Net.Http.HttpRequestException
       HResult=-2146233088
       Message=An error occurred while sending the request.
       Source=mscorlib
       StackTrace:
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
            at myEFexample3.Form5.<DownloadPage>d__0.MoveNext() in c:\AdoNet2\WinFormStuff_myWin7\EntityFrameworkStuff\myEFexample3\myEFexample3\Form5.cs:line 124
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)
       InnerException: System.Net.WebException
            HResult=-2146233079
            Message=The underlying connection was closed: An unexpected error occurred on a receive.
            Source=System
            StackTrace:
                 at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
                 at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
            InnerException: System.IO.IOException
                 HResult=-2146232800
                 Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
                 Source=System
                 StackTrace:
                      at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
                      at System.Net.PooledStream.EndRead(IAsyncResult asyncResult)
                      at System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
                 InnerException: System.Net.Sockets.SocketException
                      HResult=-2147467259
                      Message=An existing connection was forcibly closed by the remote host
                      Source=System
                      ErrorCode=10054
                      NativeErrorCode=10054
                      StackTrace:
                           at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
                           at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
                      InnerException:


Rich P


One of purposes of Interfaces

$
0
0

In MSDN, I've read the purposes of interfaces.

There are lots of purposes but I can't understand the following.

  • Support design by contract(an implementor must provide the entire interface)

What does design by contract mean?

Can anybody explain regarding this?

How to get data into a datatable from xlm file

$
0
0

<AddressInfo><City name="Adana" code="01"><District name="Aladağ"><Zip code="01720" /></District><District name="Ceyhan"><Zip code="01920" /><Zip code="01930" /><Zip code="01940" /><Zip code="01950" /><Zip code="01960" /></District></city><City name="Afyonkarahisar" code="03"><District name="Afyon"><Zip code="03030" /><Zip code="03040" /><Zip code="03050" /></District><District name="Başmakçı"><Zip code="03450" /><Zip code="03470" /></District><District name="Bayat"><Zip code="03780" /></District></city></AddressInfo>
Hi,
I want to read data from an xlm file and put them into a datatable. The structure like as the above. 

The datatable columns should be Cityname,Code,Districtname and Zipcode.Later the datas must be listed according to the column.
How i can do that ?

Correct datastructure for this relationship....

$
0
0

 Hi all,

I have a student list and i want to filter it based on many criteria like department, gender. i dont find any dtat structure for this relationshio. I dont want class because student list will be hard coded list. 

should i have a dict with multiple key?.

Thanks 

Adding Context Menu Item to .NET executable during compilation

$
0
0

Hello,

I have an application that, by default, will launch as a console app.  But, if I add a command line argument it will install itself as a window service.

To launch as a console, I right click it and select the context menu item "Run as administrator".  Works great.

To launch as a windows service, I create a shortcut to the executable.  I then modify the shortcut to add the command line parameter and select "Run as administrator" in the advanced properties.  Clicking the shortcut will then install it as a windows service.

I'm tired of creating the shortcut.  I want to add functionality within the application itself so that when I compile it adds an entry to the context menu, such as "Run as administrator and install as windows service".  This extra context menu item would only be for the project I want it to be in.

So, I want the context menu to accomplish both things:

1) Running as administrator

2) Adding the command line switch before launching.

Once I figure out how to accomplish it I'm going to add the functionality to my template so that it is always available.

Any assistance would be appreciated!!  Thank you very much!!!

Seasons Greetings!!!!


Viewing all 31927 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>