Microsoft.Data.SqlClient.xml 1007 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>Microsoft.Data.SqlClient</name>
  5. </assembly>
  6. <members>
  7. <member name="T:Microsoft.Data.OperationAbortedException">
  8. <summary>This exception is thrown when an ongoing operation is aborted by the user.</summary><remarks>
  9. <format type="text/markdown"><![CDATA[
  10. ## Remarks
  11. This exception indicates that an operation has been aborted by the consumer of an API.
  12. For example, if the event handler of the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event sets the **Abort** property to `true` in the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs> object passed to the handler, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method stops sending rows to the server and throws an <xref:Microsoft.Data.OperationAbortedException>.
  13. ]]></format>
  14. </remarks>
  15. </member>
  16. <member name="T:Microsoft.Data.Sql.SqlNotificationRequest">
  17. <summary>Represents a request for notification for a given command.</summary><remarks>
  18. <format type="text/markdown"><![CDATA[
  19. ## Remarks
  20. This class provides low-level access to the query notification services exposed by SQL Server 2005. For most applications the <xref:Microsoft.Data.SqlClient.SqlDependency> class provides a simpler way of using query notifications. However, if you need fine control over when notifications occur, or you need to customize the message data returned as part of a notification, the <xref:Microsoft.Data.Sql.SqlNotificationRequest> class is the one to use.
  21. ]]></format>
  22. </remarks><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  23. </member>
  24. <member name="M:Microsoft.Data.Sql.SqlNotificationRequest.#ctor">
  25. <summary>Creates a new instance of the <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> class with default values.</summary><remarks>
  26. <format type="text/markdown"><![CDATA[
  27. ## Remarks
  28. If the parameterless constructor is used to create a <xref:Microsoft.Data.Sql.SqlNotificationRequest> object, that instance must have its <xref:Microsoft.Data.Sql.SqlNotificationRequest.UserData%2A> and <xref:Microsoft.Data.Sql.SqlNotificationRequest.Options%2A> properties initialized before assigning the object to a <xref:Microsoft.Data.SqlClient.SqlCommand> object's <xref:Microsoft.Data.SqlClient.SqlCommand.Notification%2A> property. The default values used by the constructor are NULL (`Nothing` in Visual Basic) for the <xref:Microsoft.Data.Sql.SqlNotificationRequest.UserData%2A>, an empty string for the <xref:Microsoft.Data.Sql.SqlNotificationRequest.Options%2A>, and zero for the <xref:Microsoft.Data.Sql.SqlNotificationRequest.Timeout%2A>.
  29. ]]></format>
  30. </remarks><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  31. </member>
  32. <member name="M:Microsoft.Data.Sql.SqlNotificationRequest.#ctor(System.String,System.String,System.Int32)">
  33. <param name="userData">A string that contains an application-specific identifier for this notification. It is not used by the notifications infrastructure, but it allows you to associate notifications with the application state. The value indicated in this parameter is included in the Service Broker queue message.</param><param name="options">A string that contains the Service Broker service name where notification messages are posted, and it must include a database name or a Service Broker instance GUID that restricts the scope of the service name lookup to a particular database. For more information about the format of the <paramref name="options" /> parameter, see <see cref="P:Microsoft.Data.Sql.SqlNotificationRequest.Options" />.</param><param name="timeout">The time, in seconds, to wait for a notification message.</param><summary>Creates a new instance of the <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> class with a user-defined string that identifies a particular notification request, the name of a predefined SQL Server 2005 Service Broker service name, and the time-out period, measured in seconds.</summary><remarks>
  34. <format type="text/markdown"><![CDATA[
  35. ## Remarks
  36. This constructor allows you to initialize a new <xref:Microsoft.Data.Sql.SqlNotificationRequest> instance, providing your own identifier, the SQL Server 2005 Service Broker service name, and a time-out value.
  37. ]]></format>
  38. </remarks><exception cref="T:System.ArgumentNullException">The value of the <paramref name="options" /> parameter is NULL.</exception><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="options" /> or <paramref name="userData" /> parameter is longer than <see langword="uint16.MaxValue" /> or the value in the <paramref name="timeout" /> parameter is less than zero.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  39. </member>
  40. <member name="P:Microsoft.Data.Sql.SqlNotificationRequest.Options">
  41. <summary>Gets or sets the SQL Server Service Broker service name where notification messages are posted.</summary><value>
  42. <see langword="string" /> that contains the SQL Server 2005 Service Broker service name where notification messages are posted and the database or service broker instance GUID to scope the server name lookup.</value><remarks>
  43. <format type="text/markdown"><![CDATA[
  44. ## Remarks
  45. The value of the <xref:Microsoft.Data.Sql.SqlNotificationRequest.Options%2A> property has the following format:
  46. `service=<service-name>{;(local database=<database>|broker instance=<broker instance>)}`
  47. For example, if you use the service "myservice" in the database "AdventureWorks" the format is:
  48. `service=myservice;local database=AdventureWorks`
  49. The SQL Server Service Broker service must be previously configured on the server. In addition, a Service Broker service and queue must be defined and security access granted as needed. See the SQL Server 2005 documentation for more information.
  50. ]]></format>
  51. </remarks><exception cref="T:System.ArgumentNullException">The value is NULL.</exception><exception cref="T:System.ArgumentException">The value is longer than <see langword="uint16.MaxValue" />.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  52. </member>
  53. <member name="P:Microsoft.Data.Sql.SqlNotificationRequest.Timeout">
  54. <summary>Gets or sets a value that specifies how long SQL Server waits for a change to occur before the operation times out.</summary><value>A signed integer value that specifies, in seconds, how long SQL Server waits for a change to occur before the operation times out.</value><remarks>
  55. <format type="text/markdown"><![CDATA[
  56. ## Remarks
  57. After the time-out period expires, the notification is sent even if no change takes place. The <xref:Microsoft.Data.Sql.SqlNotificationRequest.Timeout%2A> property defaults to the value set on the server.
  58. ]]></format>
  59. </remarks><exception cref="T:System.ArgumentOutOfRangeException">The value is less than zero.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  60. </member>
  61. <member name="P:Microsoft.Data.Sql.SqlNotificationRequest.UserData">
  62. <summary>Gets or sets an application-specific identifier for this notification.</summary><value>A <see langword="string" /> value of the application-specific identifier for this notification.</value><remarks>
  63. <format type="text/markdown"><![CDATA[
  64. ## Remarks
  65. This value is not used by the notifications infrastructure. Instead, it is a mechanism that allows an application to associate notifications with application state. The value specified in the <xref:Microsoft.Data.Sql.SqlNotificationRequest.UserData%2A> property is included in the SQL Server 2005 queue message.
  66. ]]></format>
  67. </remarks><exception cref="T:System.ArgumentException">The value is longer than <see langword="uint16.MaxValue" />.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  68. </member>
  69. <member name="T:Microsoft.Data.SqlClient.ApplicationIntent">
  70. <summary>
  71. Specifies a value for <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationIntent" />. Possible values are <see langword="ReadWrite" /> and <see langword="ReadOnly" />.
  72. </summary><remarks>To be added.</remarks>
  73. </member>
  74. <member name="F:Microsoft.Data.SqlClient.ApplicationIntent.ReadOnly">
  75. <summary>The application workload type when connecting to a server is read only.</summary><returns>1</returns><value>1</value>
  76. </member>
  77. <member name="F:Microsoft.Data.SqlClient.ApplicationIntent.ReadWrite">
  78. <summary>The application workload type when connecting to a server is read write.</summary><returns>0</returns><value>0</value>
  79. </member>
  80. <member name="T:Microsoft.Data.SqlClient.OnChangeEventHandler">
  81. <OnChangeEventHandler>
  82. <param name="sender">The source of the event.</param>
  83. <param name="e">A <see cref="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs" /> object that contains the event data.</param>
  84. <summary>Handles the <see cref="E:Microsoft.Data.SqlClient.SqlDependency.OnChange" /> event that is fired when a notification is received for any of the commands associated with a <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object.</summary>
  85. <remarks>
  86. <format type="text/markdown"><![CDATA[
  87. ## Remarks
  88. The <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange>.
  89. ]]></format>
  90. </remarks>
  91. </OnChangeEventHandler>
  92. </member>
  93. <member name="T:Microsoft.Data.SqlClient.PoolBlockingPeriod">
  94. <summary>Specifies a value for the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod" /> property. </summary><remarks>To be added.</remarks>
  95. </member>
  96. <member name="F:Microsoft.Data.SqlClient.PoolBlockingPeriod.AlwaysBlock">
  97. <summary>Blocking period ON for all SQL servers including Azure SQL servers.</summary><value>1</value>
  98. </member>
  99. <member name="F:Microsoft.Data.SqlClient.PoolBlockingPeriod.Auto">
  100. <summary>Blocking period OFF for Azure SQL servers, but ON for all other SQL servers.</summary><value>0</value>
  101. </member>
  102. <member name="F:Microsoft.Data.SqlClient.PoolBlockingPeriod.NeverBlock">
  103. <summary>Blocking period OFF for Azure SQL servers, but ON for all other SQL servers.</summary><value>2</value>
  104. </member>
  105. <member name="T:Microsoft.Data.SqlClient.SortOrder">
  106. <summary>
  107. Specifies how rows of data are sorted.
  108. </summary><remarks>To be added.</remarks>
  109. </member>
  110. <member name="F:Microsoft.Data.SqlClient.SortOrder.Unspecified">
  111. <summary>The default. No sort order is specified.</summary><value>-1</value><returns>-1</returns>
  112. </member>
  113. <member name="F:Microsoft.Data.SqlClient.SortOrder.Ascending">
  114. <summary>Rows are sorted in ascending order.</summary><value>0</value><returns>0</returns>
  115. </member>
  116. <member name="F:Microsoft.Data.SqlClient.SortOrder.Descending">
  117. <summary>Rows are sorted in descending order.</summary><value>1</value><returns>1</returns>
  118. </member>
  119. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer">
  120. <summary>Called from constructors in derived classes to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer" /> class.</summary><remarks>To be added.</remarks>
  121. </member>
  122. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.#ctor">
  123. <summary>Default Constructor to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer" /> class.</summary>
  124. </member>
  125. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.Initialize">
  126. <summary>When overridden in a derived class, initializes the authentication initializer. This method is called by the <see cref="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.#ctor" /> constructor during startup.</summary>
  127. </member>
  128. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationMethod">
  129. <summary>Describes the different SQL authentication methods that can be used by a client connecting to Azure SQL Database. For details, see <see href="https://docs.microsoft.com/azure/sql-database/sql-database-aad-authentication">Connecting to SQL Database By Using Azure Active Directory Authentication</see>.
  130. </summary><remarks>To be added.</remarks>
  131. </member>
  132. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryIntegrated">
  133. <summary>The authentication method uses Active Directory Integrated. Use Active Directory Integrated to connect to a SQL Database using integrated Windows authentication. Available for .NET Framework applications only.</summary><value>3</value>
  134. </member>
  135. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryInteractive">
  136. <summary>The authentication method uses Active Directory Interactive. Available since the .NET Framework 4.7.2 and for .NET Framework applications only.</summary><value>4</value>
  137. </member>
  138. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryPassword">
  139. <summary>The authentication method uses Active Directory Password. Use Active Directory Password to connect to a SQL Database using an Azure AD principal name and password.</summary><value>2</value>
  140. </member>
  141. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.NotSpecified">
  142. <summary>The authentication method is not specified.</summary><value>0</value>
  143. </member>
  144. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.SqlPassword">
  145. <summary>The authentication method is Sql Password.</summary><value>1</value>
  146. </member>
  147. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationParameters">
  148. <summary>Represents AD authentication parameters passed by a driver to authentication providers.</summary>
  149. </member>
  150. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationParameters.#ctor(Microsoft.Data.SqlClient.SqlAuthenticationMethod,System.String,System.String,System.String,System.String,System.String,System.String,System.Guid)">
  151. <param name="authenticationMethod">One of the enumeration values that specifies the authentication method.</param><param name="serverName">The server name.</param><param name="databaseName">The database name.</param><param name="resource">The resource URI.</param><param name="authority">The authority URI.</param><param name="userId">The user login name/ID.</param><param name="password">The user password.</param><param name="connectionId">The connection ID.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationParameters" />
  152. class using the specified authentication method, server name, database name, resource URI, authority URI, user login name/ID, user password and connection ID.</summary>
  153. </member>
  154. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.AuthenticationMethod">
  155. <summary>Gets the authentication method.</summary><value>The authentication method.</value>
  156. </member>
  157. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Authority">
  158. <summary>Gets the authority URI.</summary><value>The authority URI.</value>
  159. </member>
  160. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ConnectionId">
  161. <summary>Gets the connection ID.</summary><value>The connection ID.</value>
  162. </member>
  163. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.DatabaseName">
  164. <summary>Gets the database name.</summary><value>The database name.</value>
  165. </member>
  166. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Password">
  167. <summary>Gets the user password.</summary><value>The user password.</value>
  168. </member>
  169. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Resource">
  170. <summary>The resource URIs.</summary><value>The resource URI.</value>
  171. </member>
  172. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ServerName">
  173. <summary>Gets the server name.</summary><value>The server name.</value>
  174. </member>
  175. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.UserId">
  176. <summary>Gets the user login name/ID.</summary><value>The user login name/ID.</value>
  177. </member>
  178. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider">
  179. <summary>Defines the core behavior of authentication providers and provides a base class for derived classes. </summary><remarks>Derived classes must provide a parameterless constructor if they can be instantiated from the app.config file.</remarks>
  180. </member>
  181. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.#ctor">
  182. <summary>Called from constructors in derived classes to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider" /> class.</summary>
  183. </member>
  184. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.AcquireTokenAsync(Microsoft.Data.SqlClient.SqlAuthenticationParameters)">
  185. <param name="parameters">The Active Directory authentication parameters passed by the driver to authentication providers.</param><summary>Acquires a security token from the authority.</summary><returns>Represents an asynchronous operation that returns the AD authentication token.</returns><remarks>To be added.</remarks>
  186. </member>
  187. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.BeforeLoad(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  188. <param name="authenticationMethod">The authentication method.</param><summary>This method is called immediately before the provider is added to SQL drivers registry. </summary><remarks>Avoid performing long-waiting tasks in this method, since it can block other threads from accessing the provider registry.</remarks>
  189. </member>
  190. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.BeforeUnload(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  191. <param name="authenticationMethod">The authentication method.</param><summary>This method is called immediately before the provider is removed from the SQL drivers registry. </summary><remarks>For example, this method is called when a different provider with the same authentication method overrides this provider in the SQL drivers registry. Avoid performing long-waiting task in this method, since it can block other threads from accessing the provider registry.</remarks>
  192. </member>
  193. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.GetProvider(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  194. <param name="authenticationMethod">The authentication method.</param><summary>Gets an authentication provider by method.</summary><returns>The authentication provider or <see langword="null" /> if not found.</returns><remarks>To be added.</remarks>
  195. </member>
  196. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.IsSupported(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  197. <param name="authenticationMethod">The authentication method.</param><summary>Indicates whether the specified authentication method is supported.</summary><returns>
  198. <see langword="true" /> if the specified authentication method is supported; otherwise, <see langword="false" />.</returns><remarks>To be added.</remarks>
  199. </member>
  200. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.SetProvider(Microsoft.Data.SqlClient.SqlAuthenticationMethod,Microsoft.Data.SqlClient.SqlAuthenticationProvider)">
  201. <param name="authenticationMethod">The authentication method.</param><param name="provider">The authentication provider.</param><summary>Sets an authentication provider by method.</summary><returns>
  202. <see langword="true" /> if the operation succeeded; otherwise, <see langword="false" /> (for example, the existing provider disallows overriding).
  203. </returns><remarks>To be added.</remarks>
  204. </member>
  205. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationToken">
  206. <summary>Represents an AD authentication token.</summary>
  207. </member>
  208. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationToken.#ctor(System.String,System.DateTimeOffset)">
  209. <param name="accessToken">The access token.</param><param name="expiresOn">The token expiration time.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationToken" /> class.</summary><exception cref="T:System.ArgumentNullException">The <paramref name="accessToken" />parameter is <see langword="null" />or empty.</exception>
  210. </member>
  211. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationToken.AccessToken">
  212. <summary>Gets the token string.</summary><value>The token string.</value>
  213. </member>
  214. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationToken.ExpiresOn">
  215. <summary>Gets the token expiration time.</summary><value>The token expiration time.</value>
  216. </member>
  217. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopy">
  218. <summary>
  219. Lets you efficiently bulk load a SQL Server table with data from another source.
  220. </summary><remarks>
  221. <format ttype="text/markdown"><![CDATA[
  222. ## Remarks
  223. Microsoft SQL Server includes a popular command-prompt utility named **bcp** for moving data from one table to another, whether on a single server or between servers. The <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> class lets you write managed code solutions that provide similar functionality. There are other ways to load data into a SQL Server table (INSERT statements, for example), but <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> offers a significant performance advantage over them. The <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> class can be used to write data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a <see cref="System.Data.DataTable"/> instance or read with a <see cref="System.Data.IDataReader"/> instance. <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> will fail when bulk loading a <see cref="System.Data.DataTable"/> column of type <see cref="System.Data.SqlTypes.SqlDateTime"/> into a SQL Server column whose type is one of the date/time types added in SQL Server 2008.
  224. ## Examples
  225. The following console application demonstrates how to load data using the <xref=Microsoft.Data.SqlClient.SqlBulkCopy> class.
  226. In this example, a <xref=Microsoft.Data.SqlClient.SqlDataReader> is used to copy data from the **Production.Product** table in the SQL Server **AdventureWorks** database to a similar table in the same database.
  227. > [!IMPORTANT]
  228. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  229. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  230. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  231. [!code-csharp[BulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  232. ]]></format>
  233. </remarks>
  234. </member>
  235. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)">
  236. <param name="connection">
  237. The already open
  238. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  239. instance that will be used to perform the bulk copy operation. If your connection string does not use
  240. <see langword="Integrated Security = true" />
  241. , you can use
  242. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  243. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  244. </param><summary>
  245. Initializes a new instance of the
  246. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  247. class using the specified open instance of
  248. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  249. .
  250. </summary><remarks>
  251. <format type="text/markdown"><![CDATA[
  252. ## Remarks
  253. Because the connection is already open when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance is initialized, the connection remains open after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance is closed.
  254. If the `connection` argument is null, an <xref:System.ArgumentNullException> is thrown.
  255. ## Examples
  256. The following console application demonstrates how to bulk load data using a connection that is already open. In this example, a <xref:Microsoft.Data.SqlClient.SqlDataReader>
  257. is used to copy data from the **Production.Product** table in the SQL Server **AdventureWorks** database to a similar table in the same database. This example is for demonstration
  258. purposes only. You would not use `SqlBulkCopy` to move data from one table to another in the same database in a production application.
  259. Note that the source data does not have to be located on SQL Server; you can use any data source that can be read to an <xref:System.Data.IDataReader> or loaded to a
  260. <xref:System.Data.DataTable>.
  261. > [!IMPORTANT]
  262. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  263. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  264. Transact-SQL `INSERT … SELECT` statement to copy the data.
  265. [!code-csharp[BulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  266. ]]></format>
  267. </remarks>
  268. </member>
  269. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)">
  270. <param name="connection">
  271. The already open
  272. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  273. instance that will be used to perform the bulk copy. If your connection string does not use
  274. <see langword="Integrated Security = true" />
  275. , you can use
  276. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  277. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  278. </param><param name="copyOptions">
  279. A combination of values from the
  280. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions" />
  281. enumeration that determines which data source rows are copied to the destination table.
  282. </param><param name="externalTransaction">
  283. An existing
  284. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  285. instance under which the bulk copy will occur.
  286. </param><summary>
  287. Initializes a new instance of the
  288. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  289. class using the supplied existing open instance of
  290. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  291. . The
  292. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  293. instance behaves according to options supplied in the
  294. <paramref name="copyOptions" />
  295. parameter. If a non-null
  296. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  297. is supplied, the copy operations will be performed within that transaction.
  298. </summary><remarks>
  299. <format type="text/markdown"><![CDATA[
  300. ## Remarks
  301. If options include `UseInternalTransaction` and the `externalTransaction` argument is not null, an **InvalidArgumentException** is thrown.
  302. For examples demonstrating how to use `SqlBulkCopy` in a transaction, see [Transaction and Bulk Copy Operations](~/docs/framework/data/adonet/sql/transaction-and-bulk-copy-operations.md).
  303. ]]></format>
  304. </remarks><related type="Article" href="https://msdn.microsoft.com/library/83a7a0d2-8018-4354-97b9-0b1d99f8342b">
  305. Performing Bulk Copy Operations
  306. </related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">
  307. ADO.NET Overview
  308. </related>
  309. </member>
  310. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(System.String)">
  311. <param name="connectionString">
  312. The string defining the connection that will be opened for use by the
  313. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  314. instance.
  315. If your connection string does not use
  316. <see langword="Integrated Security = true" />
  317. , you can use
  318. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)" />
  319. or
  320. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)" />
  321. and
  322. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  323. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  324. </param><summary>
  325. Initializes and opens a new instance of
  326. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  327. based on the supplied
  328. <paramref name="connectionString" />
  329. . The constructor uses the
  330. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  331. to initialize a new instance of the
  332. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  333. class.
  334. </summary><remarks>
  335. <format type="text/markdown"><![CDATA[
  336. ## Remarks
  337. The connection is automatically closed at the end of the bulk copy operation.
  338. If `connectionString` is null, an <xref:System.ArgumentNullException> is thrown. If `connectionString` is an empty string, an <xref:System.ArgumentException> is thrown.
  339. ## Examples
  340. The following console application demonstrates how to bulk load data by using a connection specified as a string. The connection is automatically
  341. closed when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance is closed.
  342. In this example, the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  343. The source data does not have to be located on SQL Server; you can use any data source that can be read to an <xref:System.Data.IDataReader> or loaded to a <xref:System.Data.DataTable>.
  344. > [!IMPORTANT]
  345. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  346. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  347. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  348. [!code-csharp[SqlBulkCopy.ConnectionString#1](~/../sqlclient/doc/samples/SqlBulkCopy_ConnectionString.cs#1)]
  349. ]]></format>
  350. </remarks><exception cref="T:System.ArgumentException">
  351. If `connectionString` is an empty string, an
  352. <see cref="T:System.ArgumentException" />
  353. is thrown.
  354. </exception>
  355. </member>
  356. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(System.String,Microsoft.Data.SqlClient.SqlBulkCopyOptions)">
  357. <param name="connectionString">
  358. The string defining the connection that will be opened for use by the
  359. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  360. instance. If your connection string does not use
  361. <see langword="Integrated Security = true" />
  362. , you can use
  363. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)" />
  364. or
  365. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)" />
  366. and
  367. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  368. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  369. </param><param name="copyOptions">
  370. A combination of values from the
  371. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions" />
  372. enumeration that determines which data source rows are copied to the destination table.
  373. </param><summary>
  374. Initializes and opens a new instance of
  375. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  376. based on the supplied
  377. <paramref name="connectionString" />
  378. . The constructor uses that
  379. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  380. to initialize a new instance of the
  381. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  382. class. The
  383. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  384. instance behaves according to options supplied in the
  385. <paramref name="copyOptions" />
  386. parameter.
  387. </summary><remarks>
  388. <format type="text/markdown"><![CDATA[
  389. ## remarks
  390. You can obtain detailed information about all the bulk copy options in the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions> topic.
  391. ## Examples
  392. The following console application demonstrates how to perform a bulk load by using a connection specified as a string.
  393. An option is set to use the value in the identity column of the source table when you load the destination table. In this example,
  394. the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  395. The source table and destination table each include an Identity column. By default, a new value for the **Identity** column is generated in the destination table for each row added.
  396. In this example, an option is set when the connection is opened that forces the bulk load process to use the **Identity** values from the source table instead.
  397. To see how the option changes the way the bulk load works, run the sample with the **dbo.BulkCopyDemoMatchingColumns** table empty. All rows load from the source.
  398. Then run the sample again without emptying the table. An exception is thrown and the code writes a message to the console notifying you that rows weren't
  399. added because of primary key constraint violations.
  400. > [!IMPORTANT]
  401. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to
  402. demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement
  403. to copy the data.
  404. [!code-csharp[SqlBulkCopy.KeepIdentity#1](~/../sqlclient/doc/samples/SqlBulkCopy_KeepIdentity.cs#1)]
  405. ]]></format>
  406. </remarks>
  407. </member>
  408. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize">
  409. <summary>
  410. Number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server.
  411. </summary><value>
  412. The integer value of the
  413. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize" />
  414. property, or zero if no value has been set.
  415. </value><remarks>
  416. <format type="text/markdown"><![CDATA[
  417. ## Remarks
  418. A batch is complete when <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> rows have been processed or there are no more rows to send to the destination data source.
  419. Zero (the default) indicates that each <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is a single batch.
  420. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance has been declared without the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction> option in effect,
  421. rows are sent to the server <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> rows at a time, but no transaction-related action is taken.
  422. If <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction> is in effect, each batch of rows is inserted as a separate transaction.
  423. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> property can be set at any time. If a bulk copy is already in progress, the current batch is sized according to the previous batch size.
  424. Subsequent batches use the new size. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> is initially zero and changed while a <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A>
  425. operation is already in progress, that operation loads the data as a single batch. Any subsequent <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A>
  426. operations on the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance use the new <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize>.
  427. ## Examples
  428. The following console application demonstrates how to bulk load data in batches of 50 rows. For an example illustrating how <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize>
  429. works with a transaction, see [Transaction and Bulk Copy Operations](~/docs/framework/data/adonet/sql/transaction-and-bulk-copy-operations.md).
  430. > [!IMPORTANT]
  431. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  432. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  433. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  434. [!code-csharp[SqlBulkCopy.BatchSize#1](~/../sqlclient/doc/samples/SqlBulkCopy_BatchSize.cs#1)]
  435. ]]></format>
  436. </remarks>
  437. </member>
  438. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.BulkCopyTimeout">
  439. <summary>
  440. Number of seconds for the operation to complete before it times out.
  441. </summary><value>
  442. The integer value of the
  443. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.BulkCopyTimeout" />
  444. property. The default is 30 seconds. A value of 0 indicates no limit; the bulk copy will wait indefinitely.
  445. </value><remarks>
  446. <format type="text/markdown"><![CDATA[
  447. ## Remarks
  448. If the operation does time out, the transaction is not committed and all copied rows are removed from the destination table.
  449. ## Examples
  450. The following console application demonstrates how to modify the time-out to 60 seconds when bulk loading data.
  451. In this example, the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  452. The source data does not have to be located on SQL Server; you can use any data source that can be read to an <xref:System.Data.IDataReader> or loaded to a
  453. <xref:System.Data.DataTable>.
  454. > [!IMPORTANT]
  455. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  456. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  457. Transact-SQL `INSERT … SELECT` statement to copy the data.
  458. [!code-csharp[SqlBulkCopy.Timeout#1](~/../sqlclient/doc/samples/SqlBulkCopy_Timeout.cs#1)]
  459. ]]></format>
  460. </remarks>
  461. </member>
  462. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings">
  463. <summary>
  464. Returns a collection of
  465. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  466. items. Column mappings define the relationships between columns in the data source and columns in the destination.
  467. </summary><value>
  468. A collection of column mappings. By default, it is an empty collection.
  469. </value><remarks>
  470. <format type="text/markdown"><![CDATA[
  471. If the data source and the destination table have the same number of columns, and the ordinal position of each source column within the data source matches the ordinal position of
  472. the corresponding destination column, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection is unnecessary. However, if the column counts differ,
  473. or the ordinal positions are not consistent, you must use <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> to make sure that data is copied into the correct columns.
  474. During the execution of a bulk copy operation, this collection can be accessed, but it cannot be changed. Any attempt to change it will throw an <xref:System.InvalidOperationException>.
  475. ]]></format>
  476. </remarks>
  477. </member>
  478. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName">
  479. <summary>
  480. Name of the destination table on the server.
  481. </summary><value>
  482. The string value of the
  483. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  484. property, or null if none as been supplied.
  485. </value><remarks>
  486. <format type="text/markdown"><![CDATA[
  487. ## Remarks
  488. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> has not been set when <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> is called, an <xref:System.ArgumentNullException>
  489. is thrown. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> is modified while a <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is running,
  490. the change does not affect the current operation. The new <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> value is used the next time a <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method is called.
  491. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> is a three-part name (`<database>.<owningschema>.<name>`). You can qualify the table name with its database and owning schema if you choose.
  492. However, if the table name uses an underscore ("_") or any other special characters, you must escape the name using surrounding brackets as in (`[<database>.<owningschema>.<name_01>]`).
  493. You can bulk-copy data to a temporary table by using a value such as `tempdb..#table` or `tempdb.<owner>.#table` for the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> property.
  494. ## Examples
  495. The following console application demonstrates how to bulk load data using a connection that is already open. The destination table is a table in the **AdventureWorks** database.
  496. In this example, the connection is first used to read data from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance. The source data does not have to
  497. be located on SQL Server; you can use any data source that can be read to an <xref:System.Data.IDataReader> or loaded to a <xref:System.Data.DataTable>.
  498. > [!IMPORTANT]
  499. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  500. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  501. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  502. [!code-csharp[SqlBulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  503. ]]></format>
  504. </remarks>
  505. </member>
  506. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.EnableStreaming">
  507. <summary>
  508. Enables or disables a
  509. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  510. object to stream data from an
  511. <see cref="T:System.Data.IDataReader" />
  512. object
  513. </summary><value>
  514. <see langword="true" />
  515. if a
  516. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  517. object can stream data from an
  518. <see cref="T:System.Data.IDataReader" />
  519. object; otherwise, false. The default is
  520. <see langword="false" />
  521. .
  522. </value><remarks>
  523. <format type="text/markdown"><![CDATA[
  524. When <xref:Microsoft.Data.SqlClient.SqlBulkCopy.EnableStreaming> is `true`, <xref:Microsoft.Data.SqlClient.SqlBulkCopy> reads from an <xref:System.Data.IDataReader> object using <xref:System.Data.CommandBehavior.SequentialAccess>,
  525. optimizing memory usage by using the <xref:System.Data.IDataReader> streaming capabilities. When it's set to false, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> class loads all the data returned by the
  526. <xref:System.Data.IDataReader> object into memory before sending it to SQL Server or SQL Azure.
  527. ]]></format>
  528. </remarks>
  529. </member>
  530. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter">
  531. <summary>
  532. Defines the number of rows to be processed before generating a notification event.
  533. </summary><value>
  534. The integer value of the
  535. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter" />
  536. property, or zero if the property has not been set.
  537. </value><remarks>
  538. <format type="text/markdown"><![CDATA[
  539. ## Remarks
  540. This property is designed for user interface components that illustrate the progress of a bulk copy operation. It indicates the number of rows to be processed before generating a notification event.
  541. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> property can be set at any time, even while a bulk copy operation is underway. Changes made during a bulk copy operation take effect after
  542. the next notification. The new setting applies to all subsequent operations on the same instance.
  543. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> is set to a number less than zero, an <xref:System.ArgumentOutOfRangeException> is thrown.
  544. ## Examples
  545. The following console application demonstrates how to bulk load data using a connection that is already open. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> property is set so that
  546. the event handler is called after every 50 rows copied to the table.
  547. In this example, the connection is first used to read data from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance. Then a second connection is opened to bulk copy the data.
  548. Note that the source data does not have to be located on SQL Server; you can use any data source that can be read to an <xref:System.Data.IDataReader> or loaded to a <xref:System.Data.DataTable>.
  549. > [!IMPORTANT]
  550. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to
  551. demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT`
  552. statement to copy the data.
  553. [!code-csharp[SqlBulkCopy.NotifyAfter#1](~/../sqlclient/doc/samples/SqlBulkCopy_NotifyAfter.cs#1)]
  554. ]]></format>
  555. </remarks>
  556. </member>
  557. <member name="E:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied">
  558. <summary>
  559. Occurs every time that the number of rows specified by the
  560. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter" />
  561. property have been processed.
  562. </summary><remarks>
  563. <format type="text/markdown"><![CDATA[
  564. ## Remarks
  565. Note that the settings of <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> and <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> are independent. Receipt of a
  566. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event does not imply that any rows have been sent to the server or committed.
  567. You cannot call SqlBulkCopy.Close (<xref:Microsoft.Data.SqlClient.SqlBulkCopy.Close>) or SqlConnection.Close (<xref:Microsoft.Data.SqlClient.SqlConnection.Close>) from this event.
  568. Doing this will cause an <xref:System.InvalidOperationException> being thrown, and the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object state will not change. If the user wants to cancel the
  569. operation from the event, the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort> property of the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs> can be used.
  570. (See [Transaction and Bulk Copy Operations](~/docs/framework/data/adonet/sql/transaction-and-bulk-copy-operations.md) for examples that use the
  571. <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort> property.)
  572. No action, such as transaction activity, is supported in the connection during the execution of the bulk copy operation, and it is recommended that you not use the same connection used
  573. during the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event. However, you can open a different connection.
  574. ## Examples
  575. The following console application demonstrates how to bulk load data using a connection that is already open. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> property is set so that
  576. the event handler is called after every 50 rows copied to the table.
  577. In this example, the connection is first used to read data from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance. Note that the source data does not have to be located on
  578. SQL Server; you can use any data source that can be read to an <xref:System.Data.IDataReader> or loaded to a <xref:System.Data.DataTable>.
  579. > [!IMPORTANT]
  580. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  581. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier
  582. and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  583. [!code-csharp[SqlBulkCopy.NotifyAfter#1](~/../sqlclient/doc/samples/SqlBulkCopy_NotifyAfter.cs#1)]
  584. ]]></format>
  585. </remarks>
  586. </member>
  587. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.Close">
  588. <summary>
  589. Closes the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" /> instance.
  590. </summary><remarks>
  591. <format type="text/markdown"><![CDATA[
  592. ## Remarks
  593. After you call a <xref:Microsoft.Data.SqlClient.SqlBulkCopy.Close> on the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object, no other operation will succeed. Calls to the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method will throw an <xref:System.InvalidOperationException>.
  594. Calling the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.Close> method from the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event causes an <xref:System.InvalidOperationException> to be thrown.
  595. Note that open <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instances are closed implicitly at the end of a `using` block.
  596. ## Examples
  597. The following example uses the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance to add sales orders and their associated details to two destination tables. Because the **AdventureWorks** sales order tables are large, the sample reads only orders placed by a certain account number and bulk copies those orders and details to the destination tables. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.Close> method is used only after both bulk copy operations are complete.
  598. > [!IMPORTANT]
  599. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  600. [!code-csharp[SqlBulkCopy.OrdersDetails#1](~/../sqlclient/doc/samples/SqlBulkCopy_OrdersDetails.cs#1)]
  601. ]]></format>
  602. </remarks>
  603. </member>
  604. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.System#IDisposable#Dispose">
  605. <summary>
  606. Releases all resources used by the current instance of the
  607. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  608. class.
  609. </summary><remarks>
  610. <format type="text/markdown"><![CDATA[
  611. Call `Dispose` when you are finished using the <xref:Microsoft.Data.SqlClient.SqlBulkCopy>. The `Dispose` method leaves the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> in an unusable state.
  612. After calling `Dispose`, you must release all references to the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> so the garbage collector can reclaim the memory that the
  613. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> was occupying.
  614. For more information, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and
  615. [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
  616. > [!NOTE]
  617. > Always call `Dispose` before you release your last reference to the <xref:Microsoft.Data.SqlClient.SqlBulkCopy>. Otherwise, the resources it is using will not be freed until the garbage collector calls
  618. the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object's `Finalize` method.
  619. ]]></format>
  620. </remarks>
  621. </member>
  622. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.Common.DbDataReader)">
  623. <param name="reader">
  624. A
  625. <see cref="T:System.Data.Common.DbDataReader" />
  626. whose rows will be copied to the destination table.
  627. </param><summary>
  628. Copies all rows from the supplied
  629. <see cref="T:System.Data.Common.DbDataReader" />
  630. array to a destination table specified by the
  631. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  632. property of the
  633. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  634. object.
  635. </summary><remarks>
  636. To be added.
  637. </remarks>
  638. </member>
  639. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)">
  640. <param name="table">
  641. A
  642. <see cref="T:System.Data.DataTable" />
  643. whose rows will be copied to the destination table.
  644. </param><summary>
  645. Copies all rows in the supplied
  646. <see cref="T:System.Data.DataTable" />
  647. to a destination table specified by the
  648. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  649. property of the
  650. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  651. object.
  652. </summary><remarks>
  653. <format type="text/markdown"><![CDATA[
  654. ## Remarks
  655. All rows in the <xref:System.Data.DataTable> are copied to the destination table except those that have been deleted.
  656. While the bulk copy operation is in progress, the associated destination <xref:Microsoft.Data.SqlClient.SqlConnection> is busy serving it, and no other operations can be performed on the connection.
  657. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataTable> columns to the destination database table.
  658. ## Examples
  659. The following Console application demonstrates how to bulk load data from a <xref:System.Data.DataTable>. The destination table is a table in the **AdventureWorks** database.
  660. In this example, a <xref:System.Data.DataTable> is created at run time and is the source of the `SqlBulkCopy` operation.
  661. > [!IMPORTANT]
  662. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  663. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  664. [!code-csharp[SqlBulkCopy.DataTable#1](~/../sqlclient/doc/samples/SqlBulkCopy_DataTable.cs#1)]
  665. ]]></format>
  666. </remarks><related type="Article" href="https://msdn.microsoft.com/library/83a7a0d2-8018-4354-97b9-0b1d99f8342b">
  667. Performing Bulk Copy Operations
  668. </related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">
  669. ADO.NET Overview
  670. </related>
  671. </member>
  672. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)">
  673. <param name="table">
  674. A
  675. <see cref="T:System.Data.DataTable" />
  676. whose rows will be copied to the destination table.
  677. </param><param name="rowState">
  678. A value from the
  679. <see cref="T:System.Data.DataRowState" />
  680. enumeration. Only rows matching the row state are copied to the destination.
  681. </param><summary>
  682. Copies only rows that match the supplied row state in the supplied
  683. <see cref="T:System.Data.DataTable" />
  684. to a destination table specified by the
  685. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  686. property of the
  687. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  688. object.
  689. </summary><remarks>
  690. <format type="text/markdown"><![CDATA[
  691. ## Remarks
  692. Only rows in the <xref:System.Data.DataTable> that are in the states indicated in the `rowState` argument and have not been deleted are copied to the destination table.
  693. > [!NOTE]
  694. > If <xref:System.Data.DataRowState.Deleted> is specified, any <xref:System.Data.DataRowState.Unchanged>, <xref:System.Data.DataRowState.Added>, and <xref:System.Data.DataRowState.Modified>
  695. rows will also be copied to the server. No exception will be raised.
  696. While the bulk copy operation is in progress, the associated destination <xref:Microsoft.Data.SqlClient.SqlConnection> is busy serving it, and no other operations can be performed on the connection.
  697. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataTable> columns to the destination database table.
  698. ## Examples
  699. The following Console application demonstrates how to bulk load only the rows in a <xref:System.Data.DataTable> that match a specified state. In this case, only unchanged rows are added. The destination table is a table in the **AdventureWorks** database.
  700. In this example, a <xref:System.Data.DataTable> is created at run time and three rows are added to it. Before the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method is executed, one of the rows is edited.
  701. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method is called with a `DataRowState.Unchanged` `rowState` argument, so only the two unchanged rows are bulk copied to the destination.
  702. > [!IMPORTANT]
  703. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  704. [!code-csharp[SqlBulkCopy.DataRowState#1](~/../sqlclient/doc/samples/SqlBulkCopy_DataRowState.cs#1)]
  705. ]]></format>
  706. </remarks>
  707. </member>
  708. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])">
  709. <param name="rows">An array of <see cref="T:System.Data.DataRow" /> objects that will be copied to the destination table.</param><summary>Copies all rows from the supplied <see cref="T:System.Data.DataRow" /> array to a destination table specified by the <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" /> property of the <see cref="T:System.Data.SqlClient.SqlBulkCopy" /> object.</summary><remarks>
  710. <format type="text/markdown"><![CDATA[
  711. ## Remarks
  712. While the bulk copy operation is in progress, the associated destination <xref:Microsoft.Data.SqlClient.SqlConnection> is busy serving it, and no other operations can be performed on the connection.
  713. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataRow> columns to the destination database table.
  714. ## Examples
  715. The following console application demonstrates how to bulk load data from a <xref:System.Data.DataRow> array. The destination table is a table in the **AdventureWorks** database.
  716. In this example, a <xref:System.Data.DataTable> is created at run time. A single row is selected from the <xref:System.Data.DataTable> to copy to the destination table.
  717. > [!IMPORTANT]
  718. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  719. [!code-csharp[SqlBulkCopy.RowArray#1](~/../sqlclient/doc/samples/SqlBulkCopy_RowArray.cs#1)]
  720. ]]></format>
  721. </remarks>
  722. </member>
  723. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)">
  724. <param name="reader">
  725. A
  726. <see cref="T:System.Data.IDataReader" />
  727. whose rows will be copied to the destination table.
  728. </param><summary>
  729. Copies all rows in the supplied
  730. <see cref="T:System.Data.IDataReader" />
  731. to a destination table specified by the
  732. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  733. property of the
  734. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  735. object.
  736. </summary><remarks>
  737. <format type="text/markdown"><![CDATA[
  738. ## Remarks
  739. The copy operation starts at the next available row in the reader. Most of the time, the reader was just returned by <xref:System.Data.IDbCommand.ExecuteReader> or a similar call,
  740. so the next available row is the first row. To process multiple results, call <xref:System.Data.IDataReader.NextResult> on the data reader and call
  741. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> again.
  742. Note that using <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> modifies the state of the reader. The method will call <xref:System.Data.IDataReader.Read>
  743. until it returns false, the operation is aborted, or an error occurs. This means that the data reader will be in a different state, probably at the end of the result set,
  744. when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is complete.
  745. While the bulk copy operation is in progress, the associated destination <xref:Microsoft.Data.SqlClient.SqlConnection> is busy serving it, and no other operations can be performed on the connection.
  746. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the data reader columns to the destination database table.
  747. ## Examples
  748. The following console application demonstrates how to bulk load data from a <xref:Microsoft.Data.SqlClient.SqlDataReader>. The destination table is a table in the **AdventureWorks** database.
  749. > [!IMPORTANT]
  750. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided
  751. to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  752. Transact-SQL `INSERT … SELECT` statement to copy the data.
  753. [!code-csharp[SqlBulkCopy.ConnectionString#1](~/../sqlclient/doc/samples/SqlBulkCopy_ConnectionString.cs#1)]
  754. ]]></format>
  755. </remarks>
  756. </member>
  757. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader)">
  758. <param name="reader">
  759. A
  760. <see cref="T:System.Data.IDataReader" />
  761. whose rows will be copied to the destination table.
  762. </param><summary>
  763. The asynchronous version of
  764. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  765. , which copies all rows in the supplied
  766. <see cref="T:System.Data.IDataReader" />
  767. to a destination table specified by the
  768. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  769. property of the
  770. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  771. object.
  772. </summary><returns>
  773. A task representing the asynchronous operation.
  774. </returns><remarks>
  775. <format type="text/markdown"><![CDATA[
  776. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  777. ]]></format>
  778. </remarks><exception cref="T:System.InvalidOperationException">
  779. Calling
  780. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  781. multiple times for the same instance before task completion. Calling
  782. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  783. and
  784. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  785. for the same instance before task completion.
  786. The connection drops or is closed during
  787. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  788. execution.
  789. Returned in the task object, the
  790. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  791. object was closed during the method execution.
  792. Returned in the task object, there was a connection pool timeout.
  793. Returned in the task object, the
  794. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  795. object is closed before method execution.
  796. The
  797. <see cref="T:System.Data.IDataReader" />
  798. was closed before the completed
  799. <see cref="T:System.Threading.Tasks.Task" />
  800. returned.
  801. The
  802. <see cref="T:System.Data.IDataReader" />
  803. 's associated connection was closed before the completed
  804. <see cref="T:System.Threading.Tasks.Task" />
  805. returned.
  806. <see langword="Context Connection=true" />
  807. is specified in the connection string.
  808. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  809. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  810. </exception>
  811. </member>
  812. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader,System.Threading.CancellationToken)">
  813. <param name="reader">
  814. A
  815. <see cref="T:System.Data.Common.DbDataReader" />
  816. whose rows will be copied to the destination table.
  817. </param><param name="cancellationToken">
  818. The cancellation instruction. A
  819. <see cref="P:System.Threading.CancellationToken.None" />
  820. value in this parameter makes this method equivalent to
  821. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader)" />
  822. .
  823. </param><summary>
  824. The asynchronous version of
  825. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.Common.DbDataReader)" />
  826. , which copies all rows from the supplied
  827. <see cref="T:System.Data.Common.DbDataReader" />
  828. array to a destination table specified by the
  829. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  830. property of the
  831. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  832. object.
  833. </summary><returns>
  834. Returns
  835. <see cref="T:System.Threading.Tasks.Task" />
  836. .
  837. </returns><remarks>
  838. To be added.
  839. </remarks>
  840. </member>
  841. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])">
  842. <param name="rows">
  843. An array of
  844. <see cref="T:System.Data.DataRow" />
  845. objects that will be copied to the destination table.
  846. </param><summary>
  847. The asynchronous version of
  848. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  849. ,
  850. which copies all rows from the supplied
  851. <see cref="T:System.Data.DataRow" />
  852. array to a destination table specified by the
  853. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  854. property of the
  855. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  856. object.
  857. </summary><returns>
  858. A task representing the asynchronous operation.
  859. </returns><remarks>
  860. <format type="text/markdown"><![CDATA[
  861. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  862. ]]></format>
  863. </remarks><exception cref="T:System.InvalidOperationException">
  864. Calling
  865. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  866. multiple times for the same instance before task completion. Calling
  867. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  868. and
  869. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  870. for the same instance before task completion.
  871. The connection drops or is closed during
  872. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  873. execution.
  874. Returned in the task object, the
  875. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  876. object was closed during the method execution.
  877. Returned in the task object, there was a connection pool timeout.
  878. Returned in the task object, the
  879. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  880. object is closed before method execution.
  881. <see langword="Context Connection=true" />
  882. is specified in the connection string.
  883. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  884. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  885. </exception>
  886. </member>
  887. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[],System.Threading.CancellationToken)">
  888. <param name="rows">
  889. An array of
  890. <see cref="T:System.Data.DataRow" />
  891. objects that will be copied to the destination table.
  892. </param><param name="cancellationToken">
  893. The cancellation instruction. A
  894. <see cref="P:System.Threading.CancellationToken.None" />
  895. value in this parameter makes this method equivalent to
  896. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  897. .
  898. </param><summary>
  899. The asynchronous version of
  900. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  901. , which copies all rows from the supplied
  902. <see cref="T:System.Data.DataRow" />
  903. array to a destination table specified by the
  904. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  905. property of the
  906. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  907. object.
  908. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  909. </summary><returns>
  910. A task representing the asynchronous operation.
  911. </returns><remarks>
  912. <format type="text/markdown"><![CDATA[
  913. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  914. ]]></format>
  915. </remarks><exception cref="T:System.InvalidOperationException">
  916. Calling
  917. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  918. multiple times for the same instance before
  919. task completion. Calling
  920. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  921. and
  922. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  923. for the same instance before task completion. The connection drops or is closed during
  924. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  925. execution. Returned in the task object, the
  926. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  927. object was closed during the method execution. Returned in the task object, there was a connection pool timeout. Returned in the task object, the
  928. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  929. object is closed before method execution.
  930. <see langword="Context Connection=true" />
  931. is specified in the connection string.
  932. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  933. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  934. </exception>
  935. </member>
  936. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)">
  937. <param name="table">
  938. A
  939. <see cref="T:System.Data.DataTable" />
  940. whose rows will be copied to the destination table.
  941. </param><summary>
  942. The asynchronous version of
  943. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  944. , which copies all rows in the supplied
  945. <see cref="T:System.Data.DataTable" />
  946. to a destination table specified by the
  947. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  948. property of the
  949. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  950. object.
  951. </summary><returns>
  952. A task representing the asynchronous operation.
  953. </returns><remarks>
  954. <format type="text/markdown"><![CDATA[
  955. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  956. ]]></format>
  957. </remarks><exception cref="T:System.InvalidOperationException">
  958. Calling
  959. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  960. multiple times for the same instance before task completion.
  961. Calling
  962. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  963. and
  964. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  965. for the same instance before task completion.
  966. The connection drops or is closed during
  967. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  968. execution.
  969. Returned in the task object, the
  970. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  971. object was closed during the method execution.
  972. Returned in the task object, there was a connection pool timeout.
  973. Returned in the task object, the
  974. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  975. object is closed before method execution.
  976. <see langword="Context Connection=true" />
  977. is specified in the connection string.
  978. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  979. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  980. </exception>
  981. </member>
  982. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)">
  983. <param name="table">
  984. A
  985. <see cref="T:System.Data.DataTable" />
  986. whose rows will be copied to the destination table.
  987. </param><param name="rowState">
  988. A value from the
  989. <see cref="T:System.Data.DataRowState" />
  990. enumeration. Only rows matching the row state are copied to the destination.
  991. </param><summary>
  992. The asynchronous version of
  993. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  994. ,
  995. which copies only rows that match the supplied row state in the supplied
  996. <see cref="T:System.Data.DataTable" /> to a destination table specified by the <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  997. property of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" /> object.
  998. </summary><returns>
  999. A task representing the asynchronous operation.
  1000. </returns><remarks>
  1001. <format type="text/markdown"><![CDATA[
  1002. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1003. ]]></format>
  1004. </remarks><exception cref="T:System.InvalidOperationException">
  1005. Calling
  1006. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1007. multiple times for the same instance before task completion.
  1008. Calling
  1009. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1010. and
  1011. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1012. for the same instance before task completion.
  1013. The connection drops or is closed during
  1014. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1015. execution.
  1016. Returned in the task object, the
  1017. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1018. object was closed during the method execution.
  1019. Returned in the task object, there was a connection pool timeout.
  1020. Returned in the task object, the
  1021. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1022. object is closed before method execution.
  1023. <see langword="Context Connection=true" />
  1024. is specified in the connection string.
  1025. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1026. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1027. </exception>
  1028. </member>
  1029. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState,System.Threading.CancellationToken)">
  1030. <param name="table">
  1031. A
  1032. <see cref="T:System.Data.DataTable" />
  1033. whose rows will be copied to the destination table.
  1034. </param><param name="rowState">
  1035. A value from the
  1036. <see cref="T:System.Data.DataRowState" />
  1037. enumeration. Only rows matching the row state are copied to the destination.
  1038. </param><param name="cancellationToken">
  1039. The cancellation instruction. A
  1040. <see cref="P:System.Threading.CancellationToken.None" />
  1041. value in this parameter makes this method equivalent to
  1042. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1043. .
  1044. </param><summary>
  1045. The asynchronous version of
  1046. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1047. ,
  1048. which copies only rows that match the supplied row state in the supplied
  1049. <see cref="T:System.Data.DataTable" />
  1050. to a destination table specified by the
  1051. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1052. property of the
  1053. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1054. object.
  1055. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.\
  1056. </summary><returns>
  1057. A task representing the asynchronous operation.
  1058. </returns><remarks>
  1059. <format type="text/markdown"><![CDATA[
  1060. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1061. ]]></format>
  1062. </remarks><exception cref="T:System.InvalidOperationException">
  1063. Calling
  1064. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1065. multiple times for the same instance before task completion.
  1066. Calling
  1067. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1068. and
  1069. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1070. for the same instance before task completion.
  1071. The connection drops or is closed during
  1072. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1073. execution.
  1074. Returned in the task object, the
  1075. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1076. object was closed during the method execution.
  1077. Returned in the task object, there was a connection pool timeout.
  1078. Returned in the task object, the
  1079. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1080. object is closed before method execution.
  1081. <see langword="Context Connection=true" />
  1082. is specified in the connection string.
  1083. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1084. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1085. </exception>
  1086. </member>
  1087. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Threading.CancellationToken)">
  1088. <param name="table">
  1089. A
  1090. <see cref="T:System.Data.DataTable" />
  1091. whose rows will be copied to the destination table.
  1092. </param><param name="cancellationToken">
  1093. The cancellation instruction. A
  1094. <see cref="P:System.Threading.CancellationToken.None" />
  1095. value in this parameter makes this method equivalent to
  1096. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1097. .
  1098. </param><summary>
  1099. The asynchronous version of
  1100. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  1101. , which copies all rows in the supplied
  1102. <see cref="T:System.Data.DataTable" />
  1103. to a destination table specified by the
  1104. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1105. property of the
  1106. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1107. object.
  1108. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  1109. </summary><returns>
  1110. A task representing the asynchronous operation.
  1111. </returns><remarks>
  1112. <format type="text/markdown"><![CDATA[
  1113. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1114. ]]></format>
  1115. </remarks><exception cref="T:System.InvalidOperationException">
  1116. Calling
  1117. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1118. multiple times for the same instance before task completion.
  1119. Calling
  1120. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1121. and
  1122. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  1123. for the same instance before task completion.
  1124. The connection drops or is closed during
  1125. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1126. execution.
  1127. Returned in the task object, the
  1128. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1129. object was closed during the method execution.
  1130. Returned in the task object, there was a connection pool timeout.
  1131. Returned in the task object, the
  1132. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1133. object is closed before method execution.
  1134. <see langword="Context Connection=true" />
  1135. is specified in the connection string.
  1136. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1137. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1138. </exception>
  1139. </member>
  1140. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)">
  1141. <param name="reader">
  1142. A
  1143. <see cref="T:System.Data.IDataReader" />
  1144. whose rows will be copied to the destination table.
  1145. </param><summary>
  1146. The asynchronous version of
  1147. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1148. , which copies all rows in the supplied
  1149. <see cref="T:System.Data.IDataReader" />
  1150. to a destination table specified by the
  1151. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1152. property of the
  1153. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1154. object.
  1155. </summary><returns>
  1156. A task representing the asynchronous operation.
  1157. </returns><remarks>
  1158. <format type="text/markdown"><![CDATA[
  1159. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1160. ]]></format>
  1161. </remarks><exception cref="T:System.InvalidOperationException">
  1162. Calling
  1163. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1164. multiple times for the same
  1165. instance before task completion.
  1166. Calling
  1167. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1168. and
  1169. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1170. for the same instance before task completion.
  1171. The connection drops or is closed during
  1172. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1173. execution.
  1174. Returned in the task object, the
  1175. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1176. object was closed during the method execution.
  1177. Returned in the task object, there was a connection pool timeout.
  1178. Returned in the task object, the
  1179. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1180. object is closed before method execution.
  1181. The
  1182. <see cref="T:System.Data.IDataReader" />
  1183. was closed before the completed
  1184. <see cref="T:System.Threading.Tasks.Task" />
  1185. returned.
  1186. The
  1187. <see cref="T:System.Data.IDataReader" />
  1188. 's associated connection was closed before the completed
  1189. <see cref="T:System.Threading.Tasks.Task" />
  1190. returned.
  1191. <see langword="Context Connection=true" />
  1192. is specified in the connection string.
  1193. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1194. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1195. </exception>
  1196. </member>
  1197. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader,System.Threading.CancellationToken)">
  1198. <param name="reader">
  1199. A
  1200. <see cref="T:System.Data.IDataReader" />
  1201. whose rows will be copied to the destination table.
  1202. </param><param name="cancellationToken">
  1203. The cancellation instruction. A
  1204. <see cref="P:System.Threading.CancellationToken.None" />
  1205. value in this parameter makes this method equivalent to
  1206. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1207. .
  1208. </param><summary>
  1209. The asynchronous version of
  1210. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1211. , which copies all rows in the supplied
  1212. <see cref="T:System.Data.IDataReader" />
  1213. to a destination table specified by the
  1214. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1215. property of the
  1216. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1217. object.
  1218. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  1219. </summary><returns>
  1220. A task representing the asynchronous operation.
  1221. </returns><remarks>
  1222. <format type="text/markdown"><![CDATA[
  1223. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1224. ]]></format>
  1225. </remarks><exception cref="T:System.InvalidOperationException">
  1226. Calling
  1227. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1228. multiple times for the same instance before task completion.
  1229. Calling
  1230. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1231. and
  1232. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1233. for the same instance before task completion.
  1234. The connection drops or is closed during
  1235. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1236. execution.
  1237. Returned in the task object, the
  1238. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1239. object was closed during the method execution.
  1240. Returned in the task object, there was a connection pool timeout.
  1241. Returned in the task object, the
  1242. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1243. object is closed before method execution.
  1244. The
  1245. <see cref="T:System.Data.IDataReader" />
  1246. was closed before the completed
  1247. <see cref="T:System.Threading.Tasks.Task" />
  1248. returned.
  1249. The
  1250. <see cref="T:System.Data.IDataReader" />
  1251. 's associated connection was closed before the completed
  1252. <see cref="T:System.Threading.Tasks.Task" />
  1253. returned.
  1254. <see langword="Context Connection=true" />
  1255. is specified in the connection string.
  1256. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1257. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1258. </exception>
  1259. </member>
  1260. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping">
  1261. <summary>
  1262. Defines the mapping between a column in a
  1263. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1264. instance's data source and a column in the instance's destination table.
  1265. </summary><remarks>
  1266. <format type="text/markdown"><![CDATA[
  1267. ## Remarks
  1268. Column mappings define the mapping between data source and the target table.
  1269. If mappings are not defined - that is, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings%2A> collection is empty - the columns are mapped implicitly based on ordinal position.
  1270. For this to work, source and target schemas must match. If they do not, an <xref:System.InvalidOperationException> will be thrown.
  1271. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings%2A> collection is not empty, not every column present in the data source has to be specified. Those not mapped by the collection
  1272. are ignored.
  1273. You can refer to source and target columns by either name or ordinal. You can also mix by-name and by-ordinal column references in the same mappings collection.
  1274. ## Examples
  1275. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in the
  1276. destination matches the number of columns in the source, and each destination column is in the same ordinal position as its corresponding source column, the column names do not match.
  1277. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1278. > [!IMPORTANT]
  1279. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1280. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1281. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1282. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1283. ]]></format>
  1284. </remarks>
  1285. </member>
  1286. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor">
  1287. <summary>
  1288. Parameterless constructor that initializes a new
  1289. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  1290. object.
  1291. </summary><remarks>
  1292. <format type="text/markdown"><![CDATA[
  1293. ## Remarks
  1294. If you use this constructor, you must then define the source for the mapping using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn>
  1295. property or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> property, and define the destination for the mapping using the
  1296. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> property or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> property.
  1297. ## Examples
  1298. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1299. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1300. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1301. > [!IMPORTANT]
  1302. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1303. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  1304. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1305. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1306. ]]></format>
  1307. </remarks>
  1308. </member>
  1309. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.Int32,System.Int32)">
  1310. <param name="sourceColumnOrdinal">
  1311. The ordinal position of the source column within the data source.
  1312. </param><param name="destinationOrdinal">
  1313. The ordinal position of the destination column within the destination table.
  1314. </param><summary>
  1315. Creates a new column mapping, using column ordinals to refer to source and destination columns.
  1316. </summary><remarks>
  1317. <format type="text/markdown"><![CDATA[
  1318. ## Examples
  1319. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1320. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1321. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy based on the ordinal positions of the columns.
  1322. > [!IMPORTANT]
  1323. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1324. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier
  1325. and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1326. [!code-csharp[SqlBulkCopy.ColumnMappingOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdinal.cs#1)]
  1327. ]]></format>
  1328. </remarks>
  1329. </member>
  1330. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.Int32,System.String)">
  1331. <param name="sourceColumnOrdinal">
  1332. The ordinal position of the source column within the data source.
  1333. </param><param name="destinationColumn">
  1334. The name of the destination column within the destination table.
  1335. </param><summary>
  1336. Creates a new column mapping, using a column ordinal to refer to the source column and a column name for the target column.
  1337. </summary><remarks>
  1338. <format type="text/markdown"><![CDATA[
  1339. ## Examples
  1340. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in
  1341. the destination matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a
  1342. column map for the bulk copy.
  1343. > [!IMPORTANT]
  1344. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1345. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and
  1346. faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1347. [!code-csharp[SqlBulkCopy.ColumnMappingOrdinalName#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdinalName.cs#1)]
  1348. ]]></format>
  1349. </remarks>
  1350. </member>
  1351. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.String,System.Int32)">
  1352. <param name="sourceColumn">
  1353. The name of the source column within the data source.
  1354. </param><param name="destinationOrdinal">
  1355. The ordinal position of the destination column within the destination table.
  1356. </param><summary>
  1357. Creates a new column mapping, using a column name to refer to the source column and a column ordinal for the target column.
  1358. </summary><remarks>
  1359. <format type="text/markdown"><![CDATA[
  1360. ## Examples
  1361. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in
  1362. the destination matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create
  1363. a column map for the bulk copy.
  1364. > [!IMPORTANT]
  1365. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is
  1366. provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to
  1367. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1368. [!code-csharp[SqlBulkCopy.ColumnMappingNameOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingNameOrdinal.cs#1)]
  1369. ]]></format>
  1370. </remarks>
  1371. </member>
  1372. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.String,System.String)">
  1373. <param name="sourceColumn">
  1374. The name of the source column within the data source.
  1375. </param><param name="destinationColumn">
  1376. The name of the destination column within the destination table.
  1377. </param><summary>
  1378. Creates a new column mapping, using column names to refer to source and destination columns.
  1379. </summary><remarks>
  1380. <format type="text/markdown"><![CDATA[
  1381. ## Examples
  1382. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in the
  1383. destination matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a
  1384. column map for the bulk copy.
  1385. > [!IMPORTANT]
  1386. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1387. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1388. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1389. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1390. ]]></format>
  1391. </remarks>
  1392. </member>
  1393. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn">
  1394. <summary>
  1395. Name of the column being mapped in the destination database table.
  1396. </summary><value>
  1397. The string value of the
  1398. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn" />
  1399. property.
  1400. </value><remarks>
  1401. <format type="text/markdown"><![CDATA[
  1402. ## Remarks
  1403. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> properties are mutually exclusive.
  1404. The last value set takes precedence.
  1405. ## Examples
  1406. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1407. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1408. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1409. > [!IMPORTANT]
  1410. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1411. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1412. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1413. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationColumn.cs#1)]
  1414. ]]></format>
  1415. </remarks>
  1416. </member>
  1417. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal">
  1418. <summary>
  1419. Ordinal value of the destination column within the destination table.
  1420. </summary><value>
  1421. The integer value of the
  1422. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal" />
  1423. property, or -1 if the property has not been set.
  1424. </value><remarks>
  1425. <format type="text/markdown"><![CDATA[
  1426. ## Remarks
  1427. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> properties are mutually exclusive.
  1428. The last value set takes precedence.
  1429. ## Examples
  1430. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in the
  1431. destination matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a
  1432. column map for the bulk copy.
  1433. > [!IMPORTANT]
  1434. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1435. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1436. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1437. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationOrdinal.cs#1)]
  1438. ]]></format>
  1439. </remarks>
  1440. </member>
  1441. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn">
  1442. <summary>
  1443. Name of the column being mapped in the data source.
  1444. </summary><value>
  1445. The string value of the
  1446. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn" />
  1447. property.
  1448. </value><remarks>
  1449. <format type="text/markdown"><![CDATA[
  1450. ## Remarks
  1451. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> properties are mutually exclusive.
  1452. The last value set takes precedence.
  1453. ## Examples
  1454. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in the
  1455. destination matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a
  1456. column map for the bulk copy.
  1457. > [!IMPORTANT]
  1458. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1459. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1460. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1461. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationColumn.cs#1)]
  1462. ]]></format>
  1463. </remarks>
  1464. </member>
  1465. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal">
  1466. <summary>
  1467. The ordinal position of the source column within the data source.
  1468. </summary><value>
  1469. The integer value of the
  1470. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal" />
  1471. property.
  1472. </value><remarks>
  1473. <format type="text/markdown"><![CDATA[
  1474. ## Remarks
  1475. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> properties are mutually exclusive.
  1476. The last value set takes precedence.
  1477. ## Examples
  1478. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in the destination
  1479. matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the
  1480. bulk copy.
  1481. > [!IMPORTANT]
  1482. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1483. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1484. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1485. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationOrdinal.cs#1)]
  1486. ]]></format>
  1487. </remarks>
  1488. </member>
  1489. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection">
  1490. <summary>Collection of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> objects that inherits from <see cref="T:System.Collections.CollectionBase" />.</summary><remarks>
  1491. <format type="text/markdown"><![CDATA[
  1492. ## Remarks
  1493. Column mappings define the mapping between data source and the target table.
  1494. If mappings are not defined - that is, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings%2A> collection is empty - the columns are mapped implicitly based on ordinal position.
  1495. For this to work, source and target schemas must match. If they do not, an <xref:System.InvalidOperationException> is thrown.
  1496. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings%2A> collection is not empty, not every column present in the data source has to be specified. Those not mapped by the collection are
  1497. ignored.
  1498. You can refer to source and target columns by either name or ordinal. You can mix by-name and by-ordinal column references in the same mappings collection.
  1499. ## Examples
  1500. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1501. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1502. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> are added to the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection> for the
  1503. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object to create a column map for the bulk copy.
  1504. > [!IMPORTANT]
  1505. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1506. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to
  1507. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1508. [!code-csharp[SqlBulkCopy.ColumnMappingCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollection.cs#1)]
  1509. ]]></format>
  1510. </remarks>
  1511. </member>
  1512. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Item(System.Int32)">
  1513. <param name="index">The zero-based index of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> to find.</param><summary>Gets the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object at the specified index.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object.</value><remarks>To be added.</remarks>
  1514. </member>
  1515. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1516. <param name="bulkCopyColumnMapping">The <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object that describes the mapping to be added to the collection.</param><summary>Adds the specified mapping to the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" />.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object.</returns><remarks>
  1517. <format type="text/markdown"><![CDATA[
  1518. ## Examples
  1519. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1520. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1521. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1522. > [!IMPORTANT]
  1523. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1524. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  1525. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1526. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs)]
  1527. ]]>
  1528. </format>
  1529. </remarks>
  1530. </member>
  1531. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.Int32,System.Int32)">
  1532. <param name="sourceColumnIndex">The ordinal position of the source column within the data source.</param><param name="destinationColumnIndex">The ordinal position of the destination column within the destination table.</param><summary>Creates a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> and adds it to the collection, using ordinals to specify both source and destination columns.</summary><returns>A column mapping.</returns><remarks>
  1533. <format type="text/markdown"><![CDATA[
  1534. ## Remarks
  1535. Mappings in a collection must be uniform: either all integer/integer pairs, all string/string pairs, all integer/string pairs, or all string/integer pairs. If you try to add a
  1536. mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1537. ## Examples
  1538. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1539. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1540. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy using the ordinal position of the source and destination columns.
  1541. > [!IMPORTANT]
  1542. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1543. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1544. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1545. [!code-csharp[SqlBulkCopy.ColumnMappingCollectionOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollectionOrdinal.cs#1)]
  1546. ]]></format>
  1547. </remarks>
  1548. </member>
  1549. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.Int32,System.String)">
  1550. <param name="sourceColumnIndex">The ordinal position of the source column within the data source.</param><param name="destinationColumn">The name of the destination column within the destination table.</param><summary>Creates a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> and adds it to the collection, using an ordinal for the source column and a string for the destination column.</summary><returns>A column mapping.</returns><remarks>
  1551. <format type="text/markdown"><![CDATA[
  1552. ## Remarks
  1553. Mappings in a collection must be uniform: either all integer/integer pairs, all string/string pairs, all integer/string pairs, or all string/integer pairs.
  1554. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1555. ## Examples
  1556. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database. Although the number of columns in the
  1557. destination matches the number of columns in the source, the column names and ordinal positions do not match. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a
  1558. column map for the bulk copy.
  1559. > [!IMPORTANT]
  1560. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1561. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1562. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1563. [!code-csharp[SqlBulkCopy_ColumnMappingIndexColName#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingIndexColName.cs#1)]
  1564. ]]></format>
  1565. </remarks>
  1566. </member>
  1567. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.String,System.Int32)">
  1568. <param name="sourceColumn">The name of the source column within the data source.</param><param name="destinationColumnIndex">The ordinal position of the destination column within the destination table.</param><summary>Creates a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> and adds it to the collection, using a column name to describe the source column and an ordinal to specify the destination column.</summary><returns>A column mapping.</returns><remarks>
  1569. <format type="text/markdown"><![CDATA[
  1570. ## Remarks
  1571. Mappings in a collection must be uniform: either all integer/integer pairs, all string/string pairs, all integer/string pairs, or all string/integer pairs.
  1572. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1573. ## Examples
  1574. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1575. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
  1576. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1577. > [!IMPORTANT]
  1578. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1579. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  1580. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1581. [!code-csharp[SqlBulkCopy.ColumnMappingColNameIndex#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingColNameIndex.cs#1)]
  1582. ]]></format>
  1583. </remarks>
  1584. </member>
  1585. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.String,System.String)">
  1586. <param name="sourceColumn">The name of the source column within the data source.</param><param name="destinationColumn">The name of the destination column within the destination table.</param><summary>Creates a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> and adds it to the collection, using column names to specify both source and destination columns.</summary><returns>A column mapping.</returns><remarks>
  1587. <format type="text/markdown"><![CDATA[
  1588. ## Remarks
  1589. Mappings in a collection must be uniform: either all integer/integer pairs, all string/string pairs, all integer/string pairs, or all string/integer pairs.
  1590. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1591. ## Examples
  1592. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1593. Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match. The code creates a
  1594. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> object by specifying the column names.
  1595. > [!IMPORTANT]
  1596. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1597. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  1598. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1599. [!code-csharp[SqlBulkCopy.ColumnMappingCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollection.cs#1)]
  1600. ]]></format>
  1601. </remarks>
  1602. </member>
  1603. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear">
  1604. <summary>Clears the contents of the collection.</summary><remarks>
  1605. <format type="text/markdown"><![CDATA[
  1606. ## Remarks
  1607. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1608. instance to process more than one bulk copy operation. If you create column mappings for one bulk copy operation, you must clear the
  1609. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection> after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method and before processing the next bulk copy.
  1610. Performing several bulk copies using the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance will usually be more efficient from a performance point of view than using a separate
  1611. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1612. ## Examples
  1613. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1614. Although not strictly necessary in this example (because the ordinal positions of the source and destination columns do match), the example defines column mappings for each bulk copy operation.
  1615. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method must be used after the first bulk copy is performed and before the next bulk copy's column mappings are defined.
  1616. > [!IMPORTANT]
  1617. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1618. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1619. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1620. [!code-csharp[SqlBulkCopy.ColumnMappingOrdersDetails#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdersDetails.cs#1)]
  1621. ]]></format>
  1622. </remarks>
  1623. </member>
  1624. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Contains(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1625. <param name="value">A valid <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object.</param><summary>Gets a value indicating whether a specified <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object exists in the collection.</summary><returns>
  1626. <see langword="true" /> if the specified mapping exists in the collection; otherwise <see langword="false" />.</returns>
  1627. </member>
  1628. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.CopyTo(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping[],System.Int32)">
  1629. <param name="array">The one-dimensional <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> array that is the destination of the elements copied from
  1630. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" />. The array must have zero-based indexing.</param><param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param><summary>Copies the elements of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" /> to an array of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  1631. items, starting at a particular index.
  1632. </summary>
  1633. </member>
  1634. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.IndexOf(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1635. <param name="value">The <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object for which to search.</param><summary>Gets the index of the specified <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object.</summary><returns>The zero-based index of the column mapping, or -1 if the column mapping is not found in the collection.</returns><remarks>To be added.</remarks>
  1636. </member>
  1637. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1638. <param name="index">Integer value of the location within the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" /> at which to insert the new
  1639. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />.</param><param name="value">
  1640. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object to be inserted in the collection.</param><summary>Insert a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> at the index specified.</summary><remarks>To be added.</remarks>
  1641. </member>
  1642. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1643. <param name="value">
  1644. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object to be removed from the collection.</param><summary>Removes the specified <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> element from the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" />.</summary><remarks>
  1645. <format type="text/markdown"><![CDATA[
  1646. ## Remarks
  1647. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1648. instance to process more than one bulk copy operation. If you create column mappings for one bulk copy operation, you must remove mappings that no longer apply after the
  1649. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method is called and before defining mapping for the next bulk copy. You can clear the entire collection by using the
  1650. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method, or remove mappings individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A>
  1651. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method.
  1652. Performing several bulk copies using the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance will usually be more efficient from a performance point of view than using a separate
  1653. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1654. ## Examples
  1655. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1656. Although not strictly necessary in this example (because the ordinal positions of the source and destination columns do match), the example defines column mappings for each bulk copy operation.
  1657. Both bulk copies include a mapping for the **SalesOrderID**, so rather than clearing the entire collection between bulk copy operations, the example removes all mappings except for the **SalesOrderID**
  1658. mapping and then adds the appropriate mappings for the second bulk copy operation.
  1659. > [!IMPORTANT]
  1660. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1661. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1662. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1663. [!code-csharp[SqlBulkCopy.ColumnMappingRemove#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingRemove.cs#1)]
  1664. ]]></format>
  1665. </remarks>
  1666. </member>
  1667. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt(System.Int32)">
  1668. <param name="index">The zero-based index of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> object to be removed from the collection.</param><summary>Removes the mapping at the specified index from the collection.</summary><remarks>
  1669. <format type="text/markdown"><![CDATA[
  1670. ## Remarks
  1671. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1672. instance to process more than one bulk copy operation. If you create column mappings for one bulk copy operation, you must remove mappings that no longer apply after the
  1673. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method is called and before defining mapping for the next bulk copy. You can clear the entire collection by using the
  1674. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method, or remove mappings individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A>
  1675. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method.
  1676. Performing several bulk copies using the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance will usually be more efficient from a performance point of view than using a separate
  1677. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1678. ## Examples
  1679. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1680. Although not strictly necessary in this example (because the ordinal positions of the source and destination columns do match), the example defines column mappings for each bulk copy operation.
  1681. Both bulk copies include a mapping for the **SalesOrderID**, so rather than clearing the entire collection between bulk copy operations, the example removes all mappings except for the
  1682. **SalesOrderID** mapping and then adds the appropriate mappings for the second bulk copy operation.
  1683. > [!IMPORTANT]
  1684. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1685. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a
  1686. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1687. [!code-csharp[SqlBulkCopy.ColumnMappingRemoveAt#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingRemoveAt.cs#1)]
  1688. ]]></format>
  1689. </remarks>
  1690. </member>
  1691. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions">
  1692. <summary>Bitwise flag that specifies one or more options to use with an instance of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />.</summary><remarks>
  1693. <format type="text/markdown"><![CDATA[
  1694. ## Remarks
  1695. You can use the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions> enumeration when you construct a <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance to change how the
  1696. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> methods for that instance behave.
  1697. ## Examples
  1698. The following console application demonstrates how to perform a bulk load that copies the value in the identity column of the source table to the corresponding column in the destination table,
  1699. instead of generating a new value for each row's identity column.
  1700. To see how the option changes the way the bulk load works, run the sample with the **dbo.BulkCopyDemoMatchingColumns** table empty. All rows load from the source.
  1701. Next, run the sample again without emptying the table. An exception is thrown, and the code writes a message to the console window notifying you that rows were not added because of
  1702. primary key violations.
  1703. > [!IMPORTANT]
  1704. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1705. This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance,
  1706. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1707. [!code-csharp[SqlBulkCopy.KeepIdentity#1](~/../sqlclient/doc/samples/SqlBulkCopy_KeepIdentity.cs)]
  1708. ]]></format>
  1709. </remarks>
  1710. </member>
  1711. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.AllowEncryptedValueModifications">
  1712. <summary>
  1713. <format type="text/markdown"><![CDATA[
  1714. When specified, **AllowEncryptedValueModifications** enables bulk copying of encrypted data between tables or databases, without decrypting the data. Typically,
  1715. an application would select data from encrypted columns from one table without decrypting the data (the app would connect to the database with the column encryption setting keyword set
  1716. to disabled) and then would use this option to bulk insert the data, which is still encrypted.
  1717. Use caution when specifying **AllowEncryptedValueModifications** as this may lead to corrupting the database because the driver does not check if the data is indeed encrypted,
  1718. or if it is correctly encrypted using the same encryption type, algorithm and key as the target column.
  1719. ]]></format>
  1720. </summary>
  1721. </member>
  1722. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.CheckConstraints">
  1723. <summary>Check constraints while data is being inserted. By default, constraints are not checked.</summary>
  1724. </member>
  1725. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.Default">
  1726. <summary>Use the default values for all options.</summary>
  1727. </member>
  1728. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.FireTriggers">
  1729. <summary>When specified, cause the server to fire the insert triggers for the rows being inserted into the database.</summary>
  1730. </member>
  1731. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.KeepIdentity">
  1732. <summary>Preserve source identity values. When not specified, identity values are assigned by the destination.</summary>
  1733. </member>
  1734. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.KeepNulls">
  1735. <summary>Preserve null values in the destination table regardless of the settings for default values. When not specified, null values are replaced by default values where applicable.</summary>
  1736. </member>
  1737. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.TableLock">
  1738. <summary>Obtain a bulk update lock for the duration of the bulk copy operation. When not specified, row locks are used.</summary>
  1739. </member>
  1740. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction">
  1741. <summary>When specified, each batch of the bulk-copy operation will occur within a transaction. If you indicate this option and also provide a <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  1742. object to the constructor, an <see cref="T:System.ArgumentException" /> occurs.
  1743. </summary>
  1744. </member>
  1745. <member name="T:Microsoft.Data.SqlClient.SqlClientFactory">
  1746. <summary>
  1747. Represents a set of methods for creating instances of the
  1748. <see cref="N:Microsoft.Data.SqlClient" />
  1749. provider's implementation of the data source classes.
  1750. </summary><remarks>
  1751. To be added.
  1752. </remarks>
  1753. </member>
  1754. <member name="F:Microsoft.Data.SqlClient.SqlClientFactory.Instance">
  1755. <summary>
  1756. Gets an instance of the
  1757. <see cref="T:Microsoft.Data.SqlClient.SqlClientFactory" />
  1758. . This can be used to retrieve strongly typed data objects.
  1759. </summary><remarks>
  1760. <format type="text/markdown"><![CDATA[
  1761. ## Examples
  1762. The following code fragment uses the <xref:Microsoft.Data.SqlClient.SqlClientFactory.Instance> property to retrieve a **SqlClientFactory** instance, and then return a strongly typed
  1763. <xref:System.Data.Common.DbCommand> instance:
  1764. ```csharp
  1765. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1766. DbCommand cmd = newFactory.CreateCommand();
  1767. ```
  1768. ]]></format>
  1769. </remarks>
  1770. </member>
  1771. <member name="P:Microsoft.Data.SqlClient.SqlClientFactory.CanCreateDataSourceEnumerator">
  1772. <summary>
  1773. Gets a value that indicates whether a
  1774. <see cref="T:System.Data.Sql.SqlDataSourceEnumerator" />
  1775. can be created.
  1776. </summary><value>
  1777. <see langword="true" />
  1778. if a
  1779. <see cref="T:System.Data.Sql.SqlDataSourceEnumerator" />
  1780. can be created; otherwise,
  1781. <see langword="false" />
  1782. .
  1783. </value><remarks>
  1784. <format type="text/markdown"><![CDATA[
  1785. ## Remarks
  1786. The <xref:System.Data.Common.DbProviderFactory> class provides the <xref:System.Data.Common.DbProviderFactory.CanCreateDataSourceEnumerator%2A> property so that inheritors can indicate
  1787. whether they can provide a data source enumerator. The <xref:Microsoft.Data.SqlClient.SqlClientFactory> displays this property, but its value is always `true`.
  1788. ## Examples
  1789. The following example displays a list of all available SQL Server data sources, using code that could enumerate data sources for any provider.
  1790. [!code-csharp[SqlClientFactory.DataSourceEnumerator#1](~/../sqlclient/doc/samples/SqlClientFactory_DataSourceEnumerator.cs#1)]
  1791. ]]></format>
  1792. </remarks>
  1793. </member>
  1794. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateCommand">
  1795. <summary>
  1796. Returns a strongly typed
  1797. <see cref="T:System.Data.Common.DbCommand" />
  1798. instance.
  1799. </summary><returns>
  1800. A new strongly typed instance of
  1801. <see cref="T:System.Data.Common.DbCommand" />
  1802. .
  1803. </returns><remarks>
  1804. <format type="text/markdown"><![CDATA[
  1805. ## Examples
  1806. The following code fragment returns a strongly typed <xref:System.Data.Common.DbCommand> instance:
  1807. ```csharp
  1808. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1809. DbCommand cmd = newFactory.CreateCommand();
  1810. ```
  1811. ]]></format>
  1812. </remarks>
  1813. </member>
  1814. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateCommandBuilder">
  1815. <summary>
  1816. Returns a strongly typed
  1817. <see cref="T:System.Data.Common.DbCommandBuilder" />
  1818. instance.
  1819. </summary><returns>
  1820. A new strongly typed instance of
  1821. <see cref="T:System.Data.Common.DbCommandBuilder" />
  1822. .
  1823. </returns><remarks>
  1824. <format type="text/markdown"><![CDATA[
  1825. ## Examples
  1826. The following code fragment returns a strongly typed <xref:System.Data.Common.DbCommandBuilder> instance:
  1827. ```csharp
  1828. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1829. DbCommandBuilder cmd = newFactory.CreateCommandBuilder();
  1830. ```
  1831. ]]></format>
  1832. </remarks>
  1833. </member>
  1834. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateConnection">
  1835. <summary>
  1836. Returns a strongly typed
  1837. <see cref="T:System.Data.Common.DbConnection" />
  1838. instance.
  1839. </summary><returns>
  1840. A new strongly typed instance of
  1841. <see cref="T:System.Data.Common.DbConnection" />
  1842. .
  1843. </returns><remarks>
  1844. <format type="text/markdown"><![CDATA[
  1845. ## Examples
  1846. The following code fragment returns a strongly typed <xref:System.Data.Common.DbConnection> instance:
  1847. ```csharp
  1848. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1849. DbConnection cmd = newFactory.CreateConnection();
  1850. ```
  1851. ]]></format>
  1852. </remarks>
  1853. </member>
  1854. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateConnectionStringBuilder">
  1855. <summary>
  1856. Returns a strongly typed
  1857. <see cref="T:System.Data.Common.DbConnectionStringBuilder" />
  1858. instance.
  1859. </summary><returns>
  1860. A new strongly typed instance of
  1861. <see cref="T:System.Data.Common.DbConnectionStringBuilder" />
  1862. .
  1863. </returns><remarks>
  1864. <format type="text/markdown"><![CDATA[
  1865. ## Examples
  1866. The following code fragment returns a strongly typed <xref:System.Data.Common.DbConnectionStringBuilder> instance:
  1867. ```csharp
  1868. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1869. DbConnectionStringBuilder cmd =
  1870. newFactory.CreateConnectionStringBuilder();
  1871. ```
  1872. ]]></format>
  1873. </remarks>
  1874. </member>
  1875. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateDataAdapter">
  1876. <summary>
  1877. Returns a strongly typed
  1878. <see cref="T:System.Data.Common.DbDataAdapter" />
  1879. instance.
  1880. </summary><returns>
  1881. A new strongly typed instance of
  1882. <see cref="T:System.Data.Common.DbDataAdapter" />
  1883. .
  1884. </returns><remarks>
  1885. <format type="text/markdown"><![CDATA[
  1886. ## Examples
  1887. The following code fragment returns a strongly typed <xref:System.Data.Common.DbDataAdapter> instance:
  1888. ```csharp
  1889. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1890. DbDataAdapter cmd = newFactory.CreateDataAdapter();
  1891. ```
  1892. ]]></format>
  1893. </remarks>
  1894. </member>
  1895. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateDataSourceEnumerator">
  1896. <summary>
  1897. Returns a new
  1898. <see cref="T:System.Data.Sql.SqlDataSourceEnumerator" />
  1899. .
  1900. </summary><returns>
  1901. A new data source enumerator.
  1902. </returns><remarks>
  1903. <format type="text/markdown"><![CDATA[
  1904. ## Examples
  1905. The following example displays a list of all available SQL Server data sources, using code that could enumerate data sources for any provider.
  1906. [!code-csharp[SqlClientFactory_DataSourceEnumerator#1](~/../sqlclient/doc/samples/SqlClientFactory_DataSourceEnumerator.cs)]
  1907. ]]></format>
  1908. </remarks>
  1909. </member>
  1910. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateParameter">
  1911. <summary>
  1912. Returns a strongly typed
  1913. <see cref="T:System.Data.Common.DbParameter" />
  1914. instance.
  1915. </summary><returns>
  1916. A new strongly typed instance of
  1917. <see cref="T:System.Data.Common.DbParameter" />
  1918. .
  1919. </returns><remarks>
  1920. <format type="text/markdown"><![CDATA[
  1921. ## Examples
  1922. The following code fragment returns a strongly typed <xref:System.Data.Common.DbParameter> instance:
  1923. ```csharp
  1924. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1925. DbParameter cmd = newFactory.CreateParameter();
  1926. ```
  1927. ]]></format>
  1928. </remarks>
  1929. </member>
  1930. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreatePermission(System.Security.Permissions.PermissionState)">
  1931. <param name="state">
  1932. A member of the
  1933. <see cref="T:System.Security.Permissions.PermissionState" />
  1934. enumeration.
  1935. </param><summary>
  1936. Returns a new
  1937. <see cref="T:System.Security.CodeAccessPermission" />
  1938. .
  1939. </summary><returns>
  1940. A strongly typed instance of
  1941. <see cref="T:System.Security.CodeAccessPermission" />
  1942. .
  1943. </returns><remarks>
  1944. To be added.
  1945. </remarks>
  1946. </member>
  1947. <member name="T:Microsoft.Data.SqlClient.SqlClientLogger">
  1948. <summary>Represents a SQL client logger.</summary><remarks>To be added.</remarks>
  1949. </member>
  1950. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.#ctor">
  1951. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientLogger" /> class.</summary><remarks>To be added.</remarks>
  1952. </member>
  1953. <member name="P:Microsoft.Data.SqlClient.SqlClientLogger.IsLoggingEnabled">
  1954. <summary>Gets a value that indicates whether bid tracing is enabled.</summary><value>
  1955. <see langword="true" /> if bid tracing is enabled; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  1956. </member>
  1957. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogAssert(System.Boolean,System.String,System.String,System.String)">
  1958. <param name="value"><see langword="false" /> to log the message; otherwise, <see langword="true" />.</param><param name="type">The type to be logged.</param><param name="method">The logging method.</param><param name="message">The message to be logged.</param><summary>Logs the specified message if <paramref name="value" /> is <see langword="false" />.</summary><returns><see langword="true" /> if the message is not logged; otherwise, <see langword="false" />.</returns><remarks>To be added.</remarks>
  1959. </member>
  1960. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogError(System.String,System.String,System.String)">
  1961. <param name="type">The type to be logged.</param><param name="method">The logging method.</param><param name="message">The message to be logged.</param><summary>Logs an error through a specified method of the current instance type.</summary><remarks>To be added.</remarks>
  1962. </member>
  1963. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogInfo(System.String,System.String,System.String)">
  1964. <param name="type">The type to be logged.</param><param name="method">The logging method.</param><param name="message">The message to be logged.</param><summary>Logs information through a specified method of the current instance type.</summary><remarks>To be added.</remarks>
  1965. </member>
  1966. <member name="T:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames">
  1967. <summary>Provides a list of constants for use with the **GetSchema** method to retrieve metadata collections.</summary><remarks>To be added.</remarks>
  1968. </member>
  1969. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Columns">
  1970. <summary>A constant for use with the **GetSchema** method that represents the **Columns** collection.</summary><remarks>To be added.</remarks>
  1971. </member>
  1972. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Databases">
  1973. <summary>A constant for use with the **GetSchema** method that represents the **Databases** collection.</summary><remarks>To be added.</remarks>
  1974. </member>
  1975. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ForeignKeys">
  1976. <summary>A constant for use with the **GetSchema** method that represents the **ForeignKeys** collection.</summary><remarks>To be added.</remarks>
  1977. </member>
  1978. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.IndexColumns">
  1979. <summary>A constant for use with the **GetSchema** method that represents the **IndexColumns** collection.</summary><remarks>To be added.</remarks>
  1980. </member>
  1981. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Indexes">
  1982. <summary>A constant for use with the **GetSchema** method that represents the **Indexes** collection.</summary><remarks>To be added.</remarks>
  1983. </member>
  1984. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Parameters">
  1985. <summary>A constant for use with the **GetSchema** method that represents the **Parameters** collection.</summary><remarks>To be added.</remarks>
  1986. </member>
  1987. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ProcedureColumns">
  1988. <summary>A constant for use with the **GetSchema** method that represents the **ProcedureColumns** collection.</summary><remarks>To be added.</remarks>
  1989. </member>
  1990. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Procedures">
  1991. <summary>A constant for use with the **GetSchema** method that represents the **Procedures** collection.</summary><remarks>To be added.</remarks>
  1992. </member>
  1993. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Tables">
  1994. <summary>A constant for use with the **GetSchema** method that represents the **Tables** collection.</summary><remarks>To be added.</remarks>
  1995. </member>
  1996. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.UserDefinedTypes">
  1997. <summary>A constant for use with the **GetSchema** method that represents the **UserDefinedTypes** collection.</summary><remarks>To be added.</remarks>
  1998. </member>
  1999. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Users">
  2000. <summary>A constant for use with the **GetSchema** method that represents the **Users** collection.</summary><remarks>To be added.</remarks>
  2001. </member>
  2002. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ViewColumns">
  2003. <summary>A constant for use with the **GetSchema** method that represents the **ViewColumns** collection.</summary><remarks>To be added.</remarks>
  2004. </member>
  2005. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Views">
  2006. <summary>A constant for use with the **GetSchema** method that represents the **Views** collection.</summary><remarks>To be added.</remarks>
  2007. </member>
  2008. <member name="T:Microsoft.Data.SqlClient.SqlClientPermission">
  2009. <summary>Enables the .NET Framework Data Provider for SQL Server to help make sure that a user has a security level sufficient to access a data source.</summary><remarks>
  2010. <format type="text/markdown"><![CDATA[
  2011. ## Remarks
  2012. The <xref:System.Data.Common.DBDataPermission.IsUnrestricted%2A> property takes precedence over the <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> property.
  2013. Therefore, if you set <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> to `false`, you must also set <xref:System.Data.Common.DBDataPermission.IsUnrestricted%2A>
  2014. to `false` to prevent a user from making a connection using a blank password.
  2015. > [!NOTE]
  2016. > When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that
  2017. are needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then denying a specific permission,
  2018. is not secure, because there are many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection
  2019. string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are
  2020. holes in the permission set.
  2021. ]]></format>
  2022. </remarks>
  2023. </member>
  2024. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.#ctor">
  2025. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> class.</summary><remarks>To be added.</remarks>
  2026. </member>
  2027. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.#ctor(System.Security.Permissions.PermissionState)">
  2028. <param name="state">One of the <see cref="T:System.Security.Permissions.PermissionState" /> values.</param><see cref="T:System.Security.Permissions.PermissionState" /><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> class.</summary><see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /><remarks>To be added.</remarks>
  2029. </member>
  2030. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.#ctor(System.Security.Permissions.PermissionState,System.Boolean)">
  2031. <param name="state">One of the <see cref="T:System.Security.Permissions.PermissionState" /> values.</param><see cref="T:System.Security.Permissions.PermissionState" /><param name="allowBlankPassword">Indicates whether a blank password is allowed.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> class.</summary><see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /><remarks>
  2032. <format type="text/markdown"><![CDATA[
  2033. ## Remarks
  2034. The <xref:System.Security.Permissions.PermissionState> enumeration takes precedence over the <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> property.
  2035. Therefore, if you set <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> to `false`, you must also set <xref:System.Security.Permissions.PermissionState> to `None` to
  2036. prevent a user from making a connection using a blank password. For an example demonstrating how to use security demands, see [Code Access Security and
  2037. ADO.NET](~/docs/framework/data/adonet/code-access-security.md).
  2038. ]]></format>
  2039. </remarks><format type="text/markdown"><![CDATA[
  2040. ## Remarks
  2041. The <xref:System.Security.Permissions.PermissionState> enumeration takes precedence over the <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> property.
  2042. Therefore, if you set <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> to `false`, you must also set <xref:System.Security.Permissions.PermissionState> to `None` to
  2043. prevent a user from making a connection using a blank password. For an example demonstrating how to use security demands, see [Code Access Security and
  2044. ADO.NET](~/docs/framework/data/adonet/code-access-security.md).
  2045. ]]></format>
  2046. </member>
  2047. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.Add(System.String,System.String,System.Data.KeyRestrictionBehavior)">
  2048. <param name="connectionString">The connection string.</param><param name="restrictions">The key restrictions.</param><param name="behavior">One of the <see cref="T:System.Data.KeyRestrictionBehavior" /> enumerations.</param><summary>Adds a new connection string and a set of restricted keywords to the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> object.</summary><remarks>
  2049. <format type="text/markdown"><![CDATA[
  2050. ## Remarks
  2051. Use this method to configure which connection strings are allowed by a particular permission object. For example, use the following code fragment if you want to only allow a specific
  2052. connection string and nothing else:
  2053. `permission.Add("server=MyServer; database=MyDatabase; Integrated Security=true", "", KeyRestrictionBehavior.AllowOnly)`
  2054. The following example allows connection strings that use any database, but only on the server named MyServer, with any user and password combination and containing no other connection
  2055. string keywords:
  2056. `permission.Add("server=MyServer;", "database=; user id=; password=;", KeyRestrictionBehavior.AllowOnly)`
  2057. The following example uses the same scenario as above but allows for a failover partner that can be used when connecting to servers configured for mirroring:
  2058. `permission.Add("server=MyServer; failover partner=MyMirrorServer", "database=; user id=; password=;", KeyRestrictionBehavior.AllowOnly)`
  2059. > [!NOTE]
  2060. > When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are
  2061. needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then trying to deny a specific permission, is not secure, because there are
  2062. many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver",
  2063. the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.
  2064. ]]></format>
  2065. </remarks>
  2066. </member>
  2067. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.Copy">
  2068. <summary>Returns the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> as an <see cref="T:System.Security.IPermission" />.</summary><returns>A copy of the current permission object.</returns><remarks>To be added.</remarks>
  2069. </member>
  2070. <member name="T:Microsoft.Data.SqlClient.SqlClientPermissionAttribute">
  2071. <summary>Associates a security action with a custom security attribute.</summary><remarks>To be added.</remarks>
  2072. </member>
  2073. <member name="M:Microsoft.Data.SqlClient.SqlClientPermissionAttribute.#ctor(System.Security.Permissions.SecurityAction)">
  2074. <param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values representing an action that can be performed by using declarative security.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermissionAttribute" /> class.</summary><remarks>To be added.</remarks>
  2075. </member>
  2076. <member name="M:Microsoft.Data.SqlClient.SqlClientPermissionAttribute.CreatePermission">
  2077. <summary>Returns a <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> object that is configured according to the attribute properties.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> object.</returns><remarks>To be added.</remarks>
  2078. </member>
  2079. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider">
  2080. <summary>The implementation of the key store provider for Windows Certificate Store. This class enables using certificates stored in the Windows Certificate Store as column master keys.
  2081. For details, see <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
  2082. </summary><remarks>To be added.</remarks>
  2083. </member>
  2084. <member name="F:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.ProviderName">
  2085. <summary>The provider name.</summary><remarks>To be added.</remarks>
  2086. </member>
  2087. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.#ctor">
  2088. <summary>Key store provider for Windows Certificate Store.</summary><remarks>To be added.</remarks>
  2089. </member>
  2090. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2091. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm. Currently, the only valid value is: <c>RSA_OAEP</c>
  2092. </param><param name="encryptedColumnEncryptionKey">The encrypted column encryption key.</param><summary>Decrypts the specified encrypted value of a column encryption key. The encrypted value is expected to be encrypted using the certificate with the specified key path and using the specified
  2093. algorithm. The format of the key path should be "Local Machine/My/&lt;certificate_thumbprint&gt;" or "Current User/My/&lt;certificate_thumbprint&gt;".
  2094. </summary><returns>Returns <see cref="T:System.Byte" />
  2095. . The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2096. </member>
  2097. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2098. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm. Currently, the only valid value is: <c>RSA_OAEP</c>
  2099. </param><param name="columnEncryptionKey">The encrypted column encryption key.</param><summary>Encrypts a column encryption key using the certificate with the specified key path and using the specified algorithm. The format of the key path should be
  2100. "Local Machine/My/&lt;certificate_thumbprint&gt;" or "Current User/My/&lt;certificate_thumbprint&gt;".
  2101. </summary><returns>Returns <see cref="T:System.Byte" />
  2102. . The encrypted column encryption key.</returns><remarks>To be added.</remarks>
  2103. </member>
  2104. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2105. <param name="masterKeyPath">The column master key path.</param><param name="allowEnclaveComputations">
  2106. <see langword="true" />
  2107. to indicate that the column master key supports enclave computations; otherwise, <see langword="false" />
  2108. .</param><summary>Digitally signs the column master key metadata with the column master key referenced by the <paramref name="masterKeyPath" />
  2109. parameter.</summary><returns>The signature of the column master key metadata.</returns><remarks>To be added.</remarks>
  2110. </member>
  2111. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2112. <param name="masterKeyPath">The complete path of an asymmetric key. The path format is specific to a key store provider.</param><param name="allowEnclaveComputations">A Boolean that indicates if this key can be sent to the trusted enclave.</param><param name="signature">The master key metadata siognature.</param><summary>This function must be implemented by the corresponding Key Store providers. This function should use an asymmetric key identified by a key path and verify the masterkey metadata consisting of (masterKeyPath, allowEnclaveComputations, providerName).</summary><returns>A Boolean value that indicates if the master key metadata can be verified based on the provided signature.</returns><remarks>To be added.</remarks>
  2113. </member>
  2114. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider">
  2115. <summary>The CMK Store provider implementation for using the Microsoft Cryptography API: Next Generation (CNG) with
  2116. <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
  2117. </summary><remarks>
  2118. <format type="text/markdown"><![CDATA[
  2119. ## Remarks
  2120. Enables storing Always Encrypted column master key keys in a store, such as a hardware security module (HSM), that supports the Microsoft Cryptography API: Next Generation (CNG).
  2121. ]]></format>
  2122. </remarks>
  2123. </member>
  2124. <member name="F:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.ProviderName">
  2125. <summary>A constant string for the provider name 'MSSQL_CNG_STORE'.</summary><remarks>To be added.</remarks>
  2126. </member>
  2127. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.#ctor">
  2128. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider" /> class.</summary><remarks>To be added.</remarks>
  2129. </member>
  2130. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2131. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="encryptedColumnEncryptionKey">The encrypted column encryption key.</param><summary>Decrypts the given encrypted value using an asymmetric key specified by the key path and the specified algorithm. The key path will be in the format of [ProviderName]/KeyIdentifier
  2132. and should be an asymmetric key stored in the specified CNG key store provider. The valid algorithm used to encrypt/decrypt the CEK is 'RSA_OAEP'.
  2133. </summary><returns>The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2134. </member>
  2135. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2136. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="columnEncryptionKey">The encrypted column encryption key.</param><summary>Encrypts the given plain text column encryption key using an asymmetric key specified by the key path and the specified algorithm. The key path will be in the format of [ProviderName]/KeyIdentifier and should be an asymmetric key stored in the specified CNG key store provider. The valid algorithm used to encrypt/decrypt the CEK is 'RSA_OAEP'.</summary><returns>The encrypted column encryption key.</returns><remarks>To be added.</remarks>
  2137. </member>
  2138. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2139. <param name="masterKeyPath">The column master key path. The path format is specific to a key store provider.</param><param name="allowEnclaveComputations"><see langword="true" /> to indicate that the column master key supports enclave computations; otherwise, <see langword="false" />.</param><summary>Throws a <see cref="T:System.NotSupportedException" /> exception in all cases.</summary><returns>The signature of the column master key metadata.</returns><remarks>
  2140. <format type="text/markdown"><![CDATA[
  2141. ## Remarks
  2142. The <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.SignColumnMasterKeyMetadata%2A> method must be implemented by the corresponding key store providers.
  2143. <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.SignColumnMasterKeyMetadata%2A> should use an asymmetric key identified by a key path and sign the masterkey metadata consisting
  2144. of `masterKeyPath`, `allowEnclaveComputations`, and providerName.
  2145. ]]></format>
  2146. </remarks>
  2147. </member>
  2148. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2149. <param name="masterKeyPath">The complete path of an asymmetric key. The path format is specific to a key store provider.</param><param name="allowEnclaveComputations">A Boolean that indicates if this key can be sent to the trusted enclave.</param><param name="signature">The master key metadata signature.</param><summary>This function must be implemented by the corresponding Key Store providers. This function should use an asymmetric key identified by a key path and verify the masterkey metadata consisting of (masterKeyPath, allowEnclaveComputations, providerName).</summary><returns>A Boolean that indicates if the master key metadata can be verified based on the provided signature.</returns><remarks>To be added.</remarks>
  2150. </member>
  2151. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider">
  2152. <summary>The CMK Store provider implementation for using Microsoft CAPI based Cryptographic Service Providers (CSP) with
  2153. <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
  2154. </summary><remarks>
  2155. <format type="text/markdown"><![CDATA[
  2156. ## Remarks
  2157. Enables storing Always Encrypted column master key keys in a store, such as a hardware security module (HSM), that supports the Microsoft CAPI based Cryptographic Service Providers (CSP).
  2158. ]]></format>
  2159. </remarks>
  2160. </member>
  2161. <member name="F:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.ProviderName">
  2162. <summary>A constant string for the provider name 'MSSQL_CSP_PROVIDER'.</summary><remarks>To be added.</remarks>
  2163. </member>
  2164. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.#ctor">
  2165. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider" /> class.</summary><remarks>To be added.</remarks>
  2166. </member>
  2167. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2168. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="encryptedColumnEncryptionKey">The encrypted column encryption key.</param><summary>Decrypts the given encrypted value using an asymmetric key specified by the key path and algorithm. The key path will be in the format of [ProviderName]/KeyIdentifier and should be an asymmetric key stored in the specified CSP provider. The valid algorithm used to encrypt/decrypt the CEK is 'RSA_OAEP'.</summary><returns>The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2169. </member>
  2170. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2171. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="columnEncryptionKey">The encrypted column encryption key.</param><summary>Encrypts the given plain text column encryption key using an asymmetric key specified by the key path and the specified algorithm. The key path will be in the format of [ProviderName]/KeyIdentifier and should be an asymmetric key stored in the specified CSP provider. The valid algorithm used to encrypt/decrypt the CEK is 'RSA_OAEP'.</summary><returns>The encrypted column encryption key.</returns><remarks>To be added.</remarks>
  2172. </member>
  2173. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2174. <param name="masterKeyPath">The column master key path. The path format is specific to a key store provider.</param><param name="allowEnclaveComputations"><see langword="true" /> to indicate that the column master key supports enclave computations; otherwise, <see langword="false" />.</param><summary>Throws a <see cref="T:System.NotSupportedException" /> exception in all cases.</summary><returns>The signature of the column master key metadata.</returns><remarks>
  2175. <format type="text/markdown"><![CDATA[
  2176. ## Remarks
  2177. The <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.SignColumnMasterKeyMetadata%2A> method must be implemented by the corresponding key store providers.
  2178. <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.SignColumnMasterKeyMetadata%2A> should use an asymmetric key identified by a key path and sign the masterkey metadata
  2179. consisting of `masterKeyPath`, `allowEnclaveComputations`, and providerName.
  2180. ]]></format>
  2181. </remarks>
  2182. </member>
  2183. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2184. <param name="masterKeyPath">The complete path of an asymmetric key. The path format is specific to a key store provider.</param><param name="allowEnclaveComputations">A boolean that indicates if this key can be sent to the trusted enclave.</param><param name="signature">Master key metadata signature.</param><summary>This function must be implemented by the corresponding Key Store providers. This function should use an asymmetric key identified by a key path and sign the masterkey metadata consisting of (masterKeyPath, allowEnclaveComputations, providerName).</summary><returns>A Boolean that indicates if the master key metadata can be verified based on the provided signature.</returns><remarks>To be added.</remarks>
  2185. </member>
  2186. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider">
  2187. <summary>The base class that defines the interface for enclave providers for Always Encrypted.</summary><remarks>
  2188. <format type="text/markdown"><![CDATA[
  2189. ## Remarks
  2190. An enclave is a protected region of memory inside SQL Server, used for computations on encrypted columns. An enclave provider encapsulates the client-side implementation details of
  2191. the enclave attestation protocol as well as the logic for creating and caching enclave sessions.
  2192. ]]></format>
  2193. </remarks>
  2194. </member>
  2195. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider.#ctor">
  2196. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider" /> class</summary><remarks>To be added.</remarks>
  2197. </member>
  2198. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider.CreateEnclaveSession(System.Byte[],System.Security.Cryptography.ECDiffieHellmanCng,System.String,System.String,Microsoft.Data.SqlClient.SqlEnclaveSession@,System.Int64@)">
  2199. <param name="enclaveAttestationInfo">The information the provider uses to attest the enclave and generate a symmetric key for the session. The format of this information is specific to the enclave attestation protocol.</param><param name="clientDiffieHellmanKey">A Diffie-Hellman algorithm object that encapsulates a client-side key pair.</param><param name="attestationUrl">The endpoint of an attestation service for attesting the enclave.</param><param name="servername">The name of the SQL Server instance containing the enclave.</param><param name="sqlEnclaveSession">The requested enclave session or <see langword="null" /> if the provider doesn't implement session caching.</param><param name="counter">A counter that the enclave provider is expected to increment each time SqlClient retrieves the session from the cache. The purpose of this field is to prevent replay attacks.</param><summary>When overridden in a derived class, performs enclave attestation, generates a symmetric key for the session, creates a an enclave session and stores the session information in the cache.</summary><remarks>To be added.</remarks>
  2200. </member>
  2201. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider.GetAttestationParameters">
  2202. <summary>Gets the information that SqlClient subsequently uses to initiate the process of attesting the enclave and to establish a secure session with the enclave.</summary><returns>The information SqlClient subsequently uses to initiate the process of attesting the enclave and to establish a secure session with the enclave.</returns><remarks>To be added.</remarks>
  2203. </member>
  2204. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider.GetEnclaveSession(System.String,System.String,Microsoft.Data.SqlClient.SqlEnclaveSession@,System.Int64@)">
  2205. <param name="serverName">The name of the SQL Server instance containing the enclave.</param><param name="attestationUrl">The endpoint of an attestation service, SqlClient contacts to attest the enclave.</param><param name="sqlEnclaveSession">When this method returns, the requested enclave session or <see langword="null" /> if the provider doesn't implement session caching. This parameter is treated as uninitialized.</param><param name="counter">A counter that the enclave provider is expected to increment each time SqlClient retrieves the session from the cache. The purpose of this field is to prevent replay attacks.</param><summary>When overridden in a derived class, looks up an existing enclave session information in the enclave session cache. If the enclave provider doesn't implement enclave session caching, this method is expected to return <see langword="null" /> in the <paramref name="sqlEnclaveSession" /> parameter.
  2206. </summary><remarks>To be added.</remarks>
  2207. </member>
  2208. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionEnclaveProvider.InvalidateEnclaveSession(System.String,System.String,Microsoft.Data.SqlClient.SqlEnclaveSession)">
  2209. <param name="serverName">The name of the SQL Server instance containing the enclave.</param><param name="enclaveAttestationUrl">The endpoint of an attestation service, SqlClient contacts to attest the enclave.</param><param name="enclaveSession">The session to be invalidated.</param><summary>When overridden in a derived class, looks up and evicts an enclave session from the enclave session cache, if the provider implements session caching.</summary><remarks>To be added.</remarks>
  2210. </member>
  2211. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider">
  2212. <summary>Base class for all key store providers. A custom provider must derive from this class and override its member functions and then register it using SqlConnection.RegisterColumnEncryptionKeyStoreProviders(). For details see, <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine"> Always Encrypted</see>.
  2213. </summary><remarks>To be added.</remarks>
  2214. </member>
  2215. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.#ctor">
  2216. <summary>Initializes a new instance of the SqlColumnEncryptionKeyStoreProviderClass.</summary><remarks>To be added.</remarks>
  2217. </member>
  2218. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2219. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="encryptedColumnEncryptionKey">The encrypted column encryption key.</param><summary>Decrypts the specified encrypted value of a column encryption key. The encrypted value is expected to be encrypted using the column master key with the specified key path and using the specified algorithm.
  2220. </summary><returns>Returns <see cref="T:System.Byte" />. The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2221. </member>
  2222. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2223. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="columnEncryptionKey">The encrypted column encryption key.</param><summary>Encrypts a column encryption key using the column master key with the specified key path and using the specified algorithm.</summary><returns>Returns <see cref="T:System.Byte" />. The encrypted column encryption key.</returns><remarks>To be added.</remarks>
  2224. </member>
  2225. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2226. <param name="masterKeyPath">The column master key path.</param><param name="allowEnclaveComputations"><see langword="true" /> to indicate that the column master key supports enclave computations; otherwise, <see langword="false" />.</param><summary>When implemented in a derived class, digitally signs the column master key metadata with the column master key referenced by the <paramref name="masterKeyPath" /> parameter. The input values used to generate the signature should be the specified values of the <paramref name="masterKeyPath" /> and <paramref name="allowEnclaveComputations" /> parameters.
  2227. </summary><returns>The signature of the column master key metadata.</returns><remarks>
  2228. <format type="text/markdown"><![CDATA[
  2229. ## Remarks
  2230. To ensure that the <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata%2A> method doesn't break applications that rely on an old API, it throws a
  2231. <xref:System.NotImplementedException> exception by default.
  2232. The <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata%2A> method will be used by client tools that generate Column Master Keys (CMK) for customers.
  2233. <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata%2A> must be implemented by the corresponding key store providers that wish to use enclaves with
  2234. [Always Encrypted](https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine).
  2235. ]]></format>
  2236. </remarks><exception cref="T:System.NotImplementedException">In all cases.</exception>
  2237. </member>
  2238. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2239. <param name="masterKeyPath">The column master key path.</param><param name="allowEnclaveComputations">Indicates whether the column master key supports enclave computations.</param><param name="signature">The signature of the column master key metadata.</param><summary>When implemented in a derived class, this method is expected to verify the specified signature is valid for the column master key with the specified key path and the specified enclave behavior. The default implementation throws NotImplementedException.</summary><returns>When implemented in a derived class, the method is expected to return true if the specified signature is valid, or false if the specified signature is not valid. The default implementation throws NotImplementedException.</returns><remarks>To be added.</remarks>
  2240. </member>
  2241. <member name="T:Microsoft.Data.SqlClient.SqlCommand">
  2242. <summary>
  2243. Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
  2244. </summary><remarks>
  2245. <format type="text/markdown"><![CDATA[
  2246. ## Remarks
  2247. When an instance of <xref:Microsoft.Data.SqlClient.SqlCommand> is created, the read/write properties are set to their initial values. For a list of these values, see the <xref:Microsoft.Data.SqlClient.SqlCommand> constructor.
  2248. <xref:Microsoft.Data.SqlClient.SqlCommand> features the following methods for executing commands at a SQL Server database:
  2249. |Item|Description|
  2250. |----------|-----------------|
  2251. |<xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A>|Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <xref:Microsoft.Data.SqlClient.SqlCommand>, generally executing commands such as INSERT, DELETE, UPDATE, and SET statements. Each call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> must be paired with a call to <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> which finishes the operation, typically on a separate thread.|
  2252. |<xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>|Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <xref:Microsoft.Data.SqlClient.SqlCommand> and retrieves one or more results sets from the server. Each call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> must be paired with a call to <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> which finishes the operation, typically on a separate thread.|
  2253. |<xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A>|Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this <xref:Microsoft.Data.SqlClient.SqlCommand>. Each call to `BeginExecuteXmlReader` must be paired with a call to `EndExecuteXmlReader`, which finishes the operation, typically on a separate thread, and returns an <xref:System.Xml.XmlReader> object.|
  2254. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A>|Executes commands that return rows. For increased performance, <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> invokes commands using the Transact-SQL `sp_executesql` system stored procedure. Therefore, <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> might not have the effect that you want if used to execute commands such as Transact-SQL SET statements.|
  2255. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>|Executes commands such as Transact-SQL INSERT, DELETE, UPDATE, and SET statements.|
  2256. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A>|Retrieves a single value (for example, an aggregate value) from a database.|
  2257. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A>|Sends the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> to the <xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A> and builds an <xref:System.Xml.XmlReader> object.|
  2258. You can reset the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property and reuse the <xref:Microsoft.Data.SqlClient.SqlCommand> object. However, you must close the <xref:Microsoft.Data.SqlClient.SqlDataReader> before you can execute a new or previous command.
  2259. If a <xref:Microsoft.Data.SqlClient.SqlException> is generated by the method executing a <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlConnection> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the <xref:Microsoft.Data.SqlClient.SqlConnection>. However, the user can reopen the connection and continue.
  2260. > [!NOTE]
  2261. > Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
  2262. ## Examples
  2263. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, a <xref:Microsoft.Data.SqlClient.SqlCommand>, and a <xref:Microsoft.Data.SqlClient.SqlDataReader>. The example reads through the data, writing it to the console. Finally, the example closes the <xref:Microsoft.Data.SqlClient.SqlDataReader> and then the <xref:Microsoft.Data.SqlClient.SqlConnection> as it exits the `Using` code blocks.
  2264. [!code-csharp[SqlCommand Example#1](~/../sqlclient/doc/samples/SqlCommand.cs#1)]
  2265. The following sample shows how to create and execute different types of SqlCommand objects.
  2266. First you must create the sample database, by executing the following script:
  2267. [!code-sql[Setup Database](~/../sqlclient/doc/samples/SqlCommand_Setup.sql#1)]
  2268. Next, compile and execute the following:
  2269. [!code-csharp[SqlCommand Example#2](~/../sqlclient/doc/samples/SqlCommand_Intro.cs#1)]
  2270. ]]></format>
  2271. </remarks>
  2272. </member>
  2273. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor">
  2274. <summary>
  2275. Initializes a new instance of the
  2276. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2277. class.
  2278. </summary><remarks>
  2279. <format type="text/markdown"><![CDATA[
  2280. ## Remarks
  2281. The base constructor initializes all fields to their default values. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2282. |Properties|Initial value|
  2283. |----------------|-------------------|
  2284. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|empty string ("")|
  2285. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2286. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2287. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|Null|
  2288. You can change the value for any of these properties through a separate call to the property.
  2289. ## Examples
  2290. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets the `CommandTimeout` property.
  2291. [!code-csharp[Classic WebData IDbCommand_CommandTimeout.cs](~/../sqlclient/doc/samples/IDbCommand_CommandTimeout.cs)]
  2292. ]]></format>
  2293. </remarks>
  2294. </member>
  2295. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String)">
  2296. <param name="cmdText">
  2297. The text of the query.
  2298. </param><summary>
  2299. Initializes a new instance of the
  2300. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2301. class with the text of the query.
  2302. </summary><remarks>
  2303. <format type="text/markdown"><![CDATA[
  2304. ## Remarks
  2305. When an instance of <xref:Microsoft.Data.SqlClient.SqlCommand> is created, the following read/write properties are set to initial values.
  2306. |Properties|Initial value|
  2307. |----------------|-------------------|
  2308. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2309. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2310. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2311. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|null|
  2312. You can change the value for any of these properties through a separate call to the property.
  2313. ## Examples
  2314. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand>, passing in the connection string and command text.
  2315. [!code-csharp[SqlCommand_SqlCommand1](~/../sqlclient/doc/samples/SqlCommand_SqlCommand1.cs#1)]
  2316. ]]></format>
  2317. </remarks>
  2318. </member>
  2319. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)">
  2320. <param name="cmdText">
  2321. The text of the query.
  2322. </param><param name="connection">
  2323. A
  2324. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2325. that represents the connection to an instance of SQL Server.
  2326. </param><summary>
  2327. Initializes a new instance of the
  2328. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2329. class with the text of the query and a
  2330. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2331. .
  2332. </summary><remarks>
  2333. <format type="text/markdown"><![CDATA[
  2334. ## Remarks
  2335. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2336. |Properties|Initial value|
  2337. |----------------|-------------------|
  2338. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2339. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2340. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2341. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|A new <xref:Microsoft.Data.SqlClient.SqlConnection> that is the value for the `connection` parameter.|
  2342. You can change the value for any of these parameters by setting the related property.
  2343. ## Examples
  2344. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2345. [!code-csharp[SqlCommand_SqlCommand2.cs](~/../sqlclient/doc/samples/SqlCommand_SqlCommand2.cs#1)]
  2346. ]]></format>
  2347. </remarks>
  2348. </member>
  2349. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlTransaction)">
  2350. <param name="cmdText">
  2351. The text of the query.
  2352. </param><param name="connection">
  2353. A
  2354. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2355. that represents the connection to an instance of SQL Server.
  2356. </param><param name="transaction">
  2357. The
  2358. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2359. in which the
  2360. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2361. executes.
  2362. </param><summary>
  2363. Initializes a new instance of the
  2364. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2365. class with the text of the query, a
  2366. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2367. , and the
  2368. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2369. .
  2370. </summary><remarks>
  2371. <format type="text/markdown"><![CDATA[
  2372. ## Remarks
  2373. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2374. |Properties|Initial value|
  2375. |----------------|-------------------|
  2376. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2377. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2378. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2379. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|A new <xref:Microsoft.Data.SqlClient.SqlConnection> that is the value for the `connection` parameter.|
  2380. You can change the value for any of these parameters by setting the related property.
  2381. ]]></format>
  2382. </remarks>
  2383. </member>
  2384. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlTransaction,Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting)">
  2385. <param name="cmdText">
  2386. The text of the query.
  2387. </param><param name="connection">
  2388. A
  2389. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2390. that represents the connection to an instance of SQL Server.
  2391. </param><param name="transaction">
  2392. The
  2393. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2394. in which the
  2395. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2396. executes.
  2397. </param><param name="columnEncryptionSetting">
  2398. The encryption setting. For more information, see [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine).
  2399. </param><summary>
  2400. Initializes a new instance of the
  2401. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2402. class with specified command text, connection, transaction, and encryption setting.
  2403. </summary><remarks>
  2404. To be added.
  2405. </remarks>
  2406. </member>
  2407. <member name="P:Microsoft.Data.SqlClient.SqlCommand.ColumnEncryptionSetting">
  2408. <summary>
  2409. Gets or sets the column encryption setting for this command.
  2410. </summary><value>
  2411. The column encryption setting for this command.
  2412. </value><remarks>
  2413. To be added.
  2414. </remarks>
  2415. </member>
  2416. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandText">
  2417. <summary>
  2418. Gets or sets the Transact-SQL statement, table name or stored procedure to execute at the data source.
  2419. </summary><value>
  2420. The Transact-SQL statement or stored procedure to execute. The default is an empty string.
  2421. </value><remarks>
  2422. <format type="text/markdown"><![CDATA[
  2423. ## Remarks
  2424. When the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A> property is set to `StoredProcedure`, the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property should be set to the name of the stored procedure. The user may be required to use escape character syntax if the stored procedure name contains any special characters. The command executes this stored procedure when you call one of the `Execute` methods.
  2425. The Microsoft .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to a Transact-SQL statement or a stored procedure called by a command of `CommandType.Text`. In this case, named parameters must be used. For example:
  2426. ```sql
  2427. SELECT * FROM dbo.Customers WHERE CustomerID = @CustomerID
  2428. ```
  2429. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  2430. ## Examples
  2431. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2432. [!code-csharp[SqlCommand_CommandText](~/../sqlclient/doc/samples/SqlCommand_CommandText.cs)]
  2433. ]]></format>
  2434. </remarks>
  2435. </member>
  2436. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout">
  2437. <summary>
  2438. Gets or sets the wait time (in seconds) before terminating the attempt to execute a command and generating an error. The default is 30 seconds.
  2439. </summary><value>
  2440. The time in seconds to wait for the command to execute. The default is 30 seconds.
  2441. </value><remarks>
  2442. <format type="text/markdown"><![CDATA[
  2443. ## Remarks
  2444. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).
  2445. > [!NOTE]
  2446. > The <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property will be ignored during old-style asynchronous method calls such as <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>. It will be honored by the newer async methods such as <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync%2A>.
  2447. <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> has no effect when the command is executed against a context connection (a <xref:Microsoft.Data.SqlClient.SqlConnection> opened with "context connection=true" in the connection string).
  2448. > [!NOTE]
  2449. > This property is the cumulative time-out (for all network packets that are read during the invocation of a method) for all network reads during command execution or processing of the results. A time-out can still occur after the first row is returned, and does not include user processing time, only network read time.
  2450. For example, with a 30 second time out, if <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> requires two network packets, then it has 30 seconds to read both network packets. If you call <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> again, it will have another 30 seconds to read any data that it requires.
  2451. [!code-csharp[SqlCommand CommandTimeout](~/../sqlclient/doc/samples/SqlCommand_CommandTimeout.cs)]
  2452. ]]></format>
  2453. </remarks>
  2454. </member>
  2455. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandType">
  2456. <summary>
  2457. Gets or sets a value indicating how the
  2458. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  2459. property is to be interpreted.
  2460. </summary><value>
  2461. One of the
  2462. <see cref="T:System.Data.CommandType" />
  2463. values. The default is
  2464. <see langword="Text" />
  2465. .
  2466. </value><remarks>
  2467. <format type="text/markdown"><![CDATA[
  2468. ## Remarks
  2469. When you set the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A> property to `StoredProcedure`, you should set the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property to the name of the stored procedure. The command executes this stored procedure when you call one of the Execute methods.
  2470. The Microsoft .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to a SQL Statement or a stored procedure called with a <xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A> of <xref:System.Data.CommandType.Text>. In this case, named parameters must be used. For example:
  2471. SELECT * FROM Customers WHERE CustomerID = @CustomerID
  2472. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  2473. ## Examples
  2474. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2475. [!code-csharp[IDbCommand_CommandTimeout](~/../sqlclient/doc/samples/IDbCommand_CommandTimeout.cs)]
  2476. ]]></format>
  2477. </remarks>
  2478. </member>
  2479. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Connection">
  2480. <summary>
  2481. Gets or sets the
  2482. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2483. used by this instance of the
  2484. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2485. .
  2486. </summary><value>
  2487. The connection to a data source. The default value is
  2488. <see langword="null" />
  2489. .
  2490. </value><remarks>
  2491. <format type="text/markdown"><![CDATA[
  2492. ## Remarks
  2493. If the command is enlisted in an existing transaction, and the connection is changed, trying to execute the command will throw an <xref:System.InvalidOperationException>.
  2494. If the <xref:Microsoft.Data.SqlClient.SqlCommand.Transaction%2A> property is not null and the transaction has already been committed or rolled back, <xref:Microsoft.Data.SqlClient.SqlCommand.Transaction%2A> is set to null.
  2495. ## Examples
  2496. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2497. [!code-csharp[SqlCommand_Connection](~/../sqlclient/doc/samples/SqlCommand_Connection.cs)]
  2498. ]]></format>
  2499. </remarks><exception cref="T:System.InvalidOperationException">
  2500. The
  2501. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  2502. property was changed while the command was enlisted in a transaction.
  2503. </exception>
  2504. </member>
  2505. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbConnection">
  2506. <summary>
  2507. To be added.
  2508. </summary><value>
  2509. To be added.
  2510. </value><remarks>
  2511. To be added.
  2512. </remarks>
  2513. </member>
  2514. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbParameterCollection">
  2515. <summary>
  2516. To be added.
  2517. </summary><value>
  2518. To be added.
  2519. </value><remarks>
  2520. To be added.
  2521. </remarks>
  2522. </member>
  2523. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbTransaction">
  2524. <summary>
  2525. To be added.
  2526. </summary><value>
  2527. To be added.
  2528. </value><remarks>
  2529. To be added.
  2530. </remarks>
  2531. </member>
  2532. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DesignTimeVisible">
  2533. <summary>
  2534. Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.
  2535. </summary><value>
  2536. A value indicating whether the command object should be visible in a control. The default is
  2537. <see langword="true" />
  2538. .
  2539. </value><remarks>
  2540. To be added.
  2541. </remarks>
  2542. </member>
  2543. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Parameters">
  2544. <summary>
  2545. Gets the
  2546. <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />
  2547. .
  2548. </summary><value>
  2549. The parameters of the Transact-SQL statement or stored procedure. The default is an empty collection.
  2550. </value><remarks>
  2551. <format type="text/markdown"><![CDATA[
  2552. ## Remarks
  2553. The Microsoft .NET Framework Data Provider for SQL Server does not support the question mark (?) placeholder for passing parameters to a SQL Statement or a stored procedure called by a command of `CommandType.Text`. In this case, named parameters must be used. For example:
  2554. SELECT * FROM Customers WHERE CustomerID = @CustomerID
  2555. > [!NOTE]
  2556. > If the parameters in the collection do not match the requirements of the query to be executed, an error may result.
  2557. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  2558. ## Examples
  2559. The following example demonstrates how to create a <xref:Microsoft.Data.SqlClient.SqlCommand> and add parameters to the <xref:Microsoft.Data.SqlClient.SqlParameterCollection>.
  2560. [!code-csharp[SqlParameterCollection.AddWithValue#1](~/../sqlclient/doc/samples/SqlParameterCollection_AddWithValue.cs#1)]
  2561. ]]></format>
  2562. </remarks>
  2563. </member>
  2564. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Transaction">
  2565. <summary>
  2566. Gets or sets the
  2567. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2568. within which the
  2569. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2570. executes.
  2571. </summary><value>
  2572. The
  2573. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2574. . The default value is
  2575. <see langword="null" />
  2576. .
  2577. </value><remarks>
  2578. <format type="text/markdown"><![CDATA[
  2579. ## Remarks
  2580. You cannot set the <xref:Microsoft.Data.SqlClient.SqlCommand.Transaction%2A> property if it is already set to a specific value, and the command is in the process of executing. If you set the transaction property to a <xref:Microsoft.Data.SqlClient.SqlTransaction> object that is not connected to the same <xref:Microsoft.Data.SqlClient.SqlConnection> as the <xref:Microsoft.Data.SqlClient.SqlCommand> object, an exception is thrown the next time that you attempt to execute a statement.
  2581. ]]></format>
  2582. </remarks>
  2583. </member>
  2584. <member name="P:Microsoft.Data.SqlClient.SqlCommand.UpdatedRowSource">
  2585. <summary>
  2586. Gets or sets how command results are applied to the <see cref="T:System.Data.DataRow" /> when used by the **Update** method of the <see cref="T:System.Data.Common.DbDataAdapter" />.
  2587. </summary><value>
  2588. One of the <see cref="T:System.Data.UpdateRowSource" /> values.
  2589. </value><remarks>
  2590. <format type="text/markdown"><![CDATA[
  2591. ## Remarks
  2592. The default <xref:System.Data.UpdateRowSource> value is **Both** unless the command is automatically generated (as in the case of the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>), in which case the default is **None**.
  2593. For more information about using the **UpdatedRowSource** property, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md).
  2594. ]]></format>
  2595. </remarks>
  2596. </member>
  2597. <member name="E:Microsoft.Data.SqlClient.SqlCommand.StatementCompleted">
  2598. <summary>
  2599. Occurs when the execution of a Transact-SQL statement completes.
  2600. </summary><remarks>
  2601. To be added.
  2602. </remarks>
  2603. </member>
  2604. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery">
  2605. <summary>
  2606. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2607. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2608. .
  2609. </summary><returns>
  2610. An
  2611. <see cref="T:System.IAsyncResult" />
  2612. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2613. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  2614. , which returns the number of affected rows.
  2615. </returns><remarks>
  2616. <format type="text/markdown"><![CDATA[
  2617. ## Remarks
  2618. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that does not return rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method to finish the operation. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  2619. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous.
  2620. Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the <xref:System.IAsyncResult.IsCompleted%2A> property of the <xref:System.IAsyncResult> returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method; or wait for the completion of one or more commands using the <xref:System.IAsyncResult.AsyncWaitHandle%2A> property of the returned <xref:System.IAsyncResult>.
  2621. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2622. ## Examples
  2623. The following console application creates updates data within the **AdventureWorks** sample database, doing its work asynchronously. In order to emulate a long-running process, this example inserts a WAITFOR statement in the command text. Normally, you would not take efforts to make your commands run slower, but doing this in this case makes it easier to demonstrate the asynchronous behavior.
  2624. [!code-csharp[SqlCommand_BeginExecuteNonQuery](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteNonQuery.cs)]
  2625. ]]></format>
  2626. </remarks><exception cref="T:System.InvalidCastException">
  2627. A
  2628. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2629. other than **Binary** or **VarBinary** was used when
  2630. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2631. was set to
  2632. <see cref="T:System.IO.Stream" />
  2633. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2634. -or-
  2635. A
  2636. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2637. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2638. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2639. was set to
  2640. <see cref="T:System.IO.TextReader" />
  2641. .
  2642. -or-
  2643. A
  2644. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2645. other than **Xml** was used when
  2646. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2647. was set to
  2648. <see cref="T:System.Xml.XmlReader" />
  2649. .
  2650. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2651. Any error that occurred while executing the command text.
  2652. -or-
  2653. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2654. </exception><exception cref="T:System.InvalidOperationException">
  2655. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2656. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2657. .
  2658. -or-
  2659. The
  2660. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2661. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2662. </exception><exception cref="T:System.IO.IOException">
  2663. An error occurred in a
  2664. <see cref="T:System.IO.Stream" />
  2665. ,
  2666. <see cref="T:System.Xml.XmlReader" />
  2667. or
  2668. <see cref="T:System.IO.TextReader" />
  2669. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2670. </exception><exception cref="T:System.ObjectDisposedException">
  2671. The
  2672. <see cref="T:System.IO.Stream" />
  2673. ,
  2674. <see cref="T:System.Xml.XmlReader" />
  2675. or
  2676. <see cref="T:System.IO.TextReader" />
  2677. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2678. </exception>
  2679. </member>
  2680. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(System.AsyncCallback,System.Object)">
  2681. <param name="callback">
  2682. An
  2683. <see cref="T:System.AsyncCallback" />
  2684. delegate that is invoked when the command's execution has completed. Pass
  2685. <see langword="null" />
  2686. (
  2687. <see langword="Nothing" />
  2688. in Microsoft Visual Basic) to indicate that no callback is required.
  2689. </param><param name="stateObject">
  2690. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2691. <see cref="P:System.IAsyncResult.AsyncState" />
  2692. property.
  2693. </param><summary>
  2694. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2695. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2696. , given a callback procedure and state information.
  2697. </summary><returns>
  2698. An
  2699. <see cref="T:System.IAsyncResult" />
  2700. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2701. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  2702. , which returns the number of affected rows.
  2703. </returns><remarks>
  2704. <format type="text/markdown"><![CDATA[
  2705. ## Remarks
  2706. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that does not return rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method to finish the operation. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  2707. The `callback` parameter lets you specify an <xref:System.AsyncCallback> delegate that is called when the statement has completed. You can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the `asyncStateObject` parameter, and your callback procedure can retrieve this information using the <xref:System.IAsyncResult.AsyncState%2A> property.
  2708. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous.
  2709. Because the callback procedure executes from within a background thread supplied by the Microsoft .NET common language runtime, it is very important that you take a rigorous approach to handling cross-thread interactions from within your applications. For example, you must not interact with a form's contents from within your callback procedure; should you have to update the form, you must switch back to the form's thread in order to do your work. The example in this topic demonstrates this behavior.
  2710. All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.
  2711. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2712. ## Examples
  2713. The following Windows application demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method, executing a Transact-SQL statement that includes a delay of several seconds (emulating a long-running command).
  2714. This example demonstrates many important techniques. This includes calling a method that interacts with the form from a separate thread. In addition, this example demonstrates how you must block users from executing a command multiple times concurrently, and how you must make sure that the form does not close before the callback procedure is called.
  2715. To set up this example, create a new Windows application. Put a <xref:System.Windows.Forms.Button> control and a <xref:System.Windows.Forms.Label> control on the form (accepting the default name for each control). Add the following code to the form's class, modifying the connection string as needed for your environment.
  2716. [!code-csharp[DataWorks SqlCommand_BeginExecuteNonQueryForm#1](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteNonQueryForm.cs)]
  2717. ]]></format>
  2718. </remarks><exception cref="T:System.InvalidCastException">
  2719. A
  2720. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2721. other than **Binary** or **VarBinary** was used when
  2722. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2723. was set to
  2724. <see cref="T:System.IO.Stream" />
  2725. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2726. -or-
  2727. A
  2728. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2729. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2730. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2731. was set to
  2732. <see cref="T:System.IO.TextReader" />
  2733. .
  2734. -or-
  2735. A
  2736. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2737. other than **Xml** was used when
  2738. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2739. was set to
  2740. <see cref="T:System.Xml.XmlReader" />
  2741. .
  2742. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2743. Any error that occurred while executing the command text.
  2744. -or-
  2745. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2746. </exception><exception cref="T:System.InvalidOperationException">
  2747. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2748. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2749. .
  2750. -or-
  2751. The
  2752. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2753. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2754. </exception>
  2755. </member>
  2756. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader">
  2757. <summary>
  2758. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2759. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2760. , and retrieves one or more result sets from the server.
  2761. </summary><returns>
  2762. An
  2763. <see cref="T:System.IAsyncResult" />
  2764. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2765. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2766. , which returns a
  2767. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2768. instance that can be used to retrieve the returned rows.
  2769. </returns><remarks>
  2770. <format type="text/markdown"><![CDATA[
  2771. ## Remarks
  2772. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method to finish the operation and retrieve the <xref:Microsoft.Data.SqlClient.SqlDataReader> returned by the command. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  2773. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> may block if more data is required and the underlying network's read operation blocks.
  2774. Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the <xref:System.IAsyncResult.IsCompleted%2A> property of the <xref:System.IAsyncResult> returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method; or wait for the completion of one or more commands using the <xref:System.IAsyncResult.AsyncWaitHandle%2A> property of the returned <xref:System.IAsyncResult>.
  2775. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  2776. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2777. ## Examples
  2778. The following console application starts the process of retrieving a data reader asynchronously. While waiting for the results, this simple application sits in a loop, investigating the <xref:System.IAsyncResult.IsCompleted%2A> property value. As soon as the process has completed, the code retrieves the <xref:Microsoft.Data.SqlClient.SqlDataReader> and displays its contents.
  2779. [!code-csharp[SqlCommand_BeginExecuteReader#1](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReader.cs)]
  2780. ]]></format>
  2781. </remarks><exception cref="T:System.InvalidCastException">
  2782. A
  2783. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2784. other than **Binary** or **VarBinary** was used when
  2785. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2786. was set to
  2787. <see cref="T:System.IO.Stream" />
  2788. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2789. -or-
  2790. A
  2791. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2792. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2793. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2794. was set to
  2795. <see cref="T:System.IO.TextReader" />
  2796. .
  2797. -or-
  2798. A
  2799. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2800. other than **Xml** was used when
  2801. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2802. was set to
  2803. <see cref="T:System.Xml.XmlReader" />
  2804. .
  2805. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2806. Any error that occurred while executing the command text.
  2807. -or-
  2808. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2809. </exception><exception cref="T:System.InvalidOperationException">
  2810. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2811. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2812. .
  2813. -or-
  2814. The
  2815. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2816. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2817. </exception><exception cref="T:System.IO.IOException">
  2818. An error occurred in a
  2819. <see cref="T:System.IO.Stream" />
  2820. ,
  2821. <see cref="T:System.Xml.XmlReader" />
  2822. or
  2823. <see cref="T:System.IO.TextReader" />
  2824. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2825. </exception><exception cref="T:System.ObjectDisposedException">
  2826. The
  2827. <see cref="T:System.IO.Stream" />
  2828. ,
  2829. <see cref="T:System.Xml.XmlReader" />
  2830. or
  2831. <see cref="T:System.IO.TextReader" />
  2832. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2833. </exception>
  2834. </member>
  2835. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.AsyncCallback,System.Object)">
  2836. <param name="callback">
  2837. An
  2838. <see cref="T:System.AsyncCallback" />
  2839. delegate that is invoked when the command's execution has completed. Pass
  2840. <see langword="null" />
  2841. (
  2842. <see langword="Nothing" />
  2843. in Microsoft Visual Basic) to indicate that no callback is required.
  2844. </param><param name="stateObject">
  2845. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2846. <see cref="P:System.IAsyncResult.AsyncState" />
  2847. property.
  2848. </param><summary>
  2849. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2850. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2851. and retrieves one or more result sets from the server, given a callback procedure and state information.
  2852. </summary><returns>
  2853. An
  2854. <see cref="T:System.IAsyncResult" />
  2855. that can be used to poll, wait for results, or both; this value is also needed when invoking
  2856. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2857. , which returns a
  2858. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2859. instance which can be used to retrieve the returned rows.
  2860. </returns><remarks>
  2861. <format type="text/markdown"><![CDATA[
  2862. ## Remarks
  2863. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method to finish the operation and retrieve the <xref:Microsoft.Data.SqlClient.SqlDataReader> returned by the command. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> before the command's execution is completed cause the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  2864. The `callback` parameter lets you specify an <xref:System.AsyncCallback> delegate that is called when the statement has completed. You can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the `stateObject` parameter, and your callback procedure can retrieve this information using the <xref:System.IAsyncResult.AsyncState%2A> property.
  2865. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> may block if more data is required and the underlying network's read operation blocks.
  2866. Because the callback procedure executes from within a background thread supplied by the Microsoft .NET runtime, it is very important that you take a rigorous approach to handling cross-thread interactions from within your applications. For example, you must not interact with a form's contents from within your callback procedure; should you have to update the form, you must switch back to the form's thread in order to do your work. The example in this topic demonstrates this behavior.
  2867. All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.
  2868. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server returns any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  2869. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2870. ## Examples
  2871. The following Windows application demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method, executing a Transact-SQL statement that includes a delay of a few seconds (emulating a long-running command). Because the sample executes the command asynchronously, the form remains responsive while awaiting the results. This example passes the executing <xref:Microsoft.Data.SqlClient.SqlCommand> object as the `stateObject` parameter; doing so makes it simple to retrieve the <xref:Microsoft.Data.SqlClient.SqlCommand> object from within the callback procedure, so that the code can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method corresponding to the initial call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>.
  2872. This example demonstrates many important techniques. This includes calling a method that interacts with the form from a separate thread. In addition, this example demonstrates how you must block users from executing a command multiple times concurrently, and how you must make sure that the form does not close before the callback procedure is called.
  2873. To set up this example, create a new Windows application. Put a <xref:System.Windows.Forms.Button> control, a <xref:System.Windows.Forms.DataGridView> control, and a <xref:System.Windows.Forms.Label> control on the form (accepting the default name for each control). Add the following code to the form's class, modifying the connection string as needed for your environment.
  2874. [!code-csharp[SqlCommand_BeginExecuteReaderAsync.cs](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsync.cs)]
  2875. ]]></format>
  2876. </remarks><exception cref="T:System.InvalidCastException">
  2877. A
  2878. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2879. other than **Binary** or **VarBinary** was used when
  2880. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2881. was set to
  2882. <see cref="T:System.IO.Stream" />
  2883. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2884. -or-
  2885. A
  2886. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2887. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2888. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2889. was set to
  2890. <see cref="T:System.IO.TextReader" />
  2891. .
  2892. -or-
  2893. A
  2894. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2895. other than **Xml** was used when
  2896. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2897. was set to
  2898. <see cref="T:System.Xml.XmlReader" />
  2899. .
  2900. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2901. Any error that occurred while executing the command text.
  2902. -or-
  2903. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2904. </exception><exception cref="T:System.InvalidOperationException">
  2905. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2906. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2907. .
  2908. -or-
  2909. The
  2910. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2911. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2912. </exception><exception cref="T:System.IO.IOException">
  2913. An error occurred in a
  2914. <see cref="T:System.IO.Stream" />
  2915. ,
  2916. <see cref="T:System.Xml.XmlReader" />
  2917. or
  2918. <see cref="T:System.IO.TextReader" />
  2919. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2920. </exception><exception cref="T:System.ObjectDisposedException">
  2921. The
  2922. <see cref="T:System.IO.Stream" />
  2923. ,
  2924. <see cref="T:System.Xml.XmlReader" />
  2925. or
  2926. <see cref="T:System.IO.TextReader" />
  2927. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2928. </exception>
  2929. </member>
  2930. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.AsyncCallback,System.Object,System.Data.CommandBehavior)">
  2931. <param name="callback">
  2932. An
  2933. <see cref="T:System.AsyncCallback" />
  2934. delegate that is invoked when the command's execution has completed. Pass
  2935. <see langword="null" />
  2936. (
  2937. <see langword="Nothing" />
  2938. in Microsoft Visual Basic) to indicate that no callback is required.
  2939. </param><param name="stateObject">
  2940. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2941. <see cref="P:System.IAsyncResult.AsyncState" />
  2942. property.
  2943. </param><param name="behavior">
  2944. One of the
  2945. <see cref="T:System.Data.CommandBehavior" />
  2946. values, indicating options for statement execution and data retrieval.
  2947. </param><summary>
  2948. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2949. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2950. , using one of the
  2951. <see langword="CommandBehavior" />
  2952. values, and retrieving one or more result sets from the server, given a callback procedure and state information.
  2953. </summary><returns>
  2954. An
  2955. <see cref="T:System.IAsyncResult" />
  2956. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2957. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2958. , which returns a
  2959. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2960. instance which can be used to retrieve the returned rows.
  2961. </returns><remarks>
  2962. <format type="text/markdown"><![CDATA[
  2963. ## Remarks
  2964. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method to finish the operation and retrieve the <xref:Microsoft.Data.SqlClient.SqlDataReader> returned by the command. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  2965. The `callback` parameter lets you specify an <xref:System.AsyncCallback> delegate that is called when the statement has completed. You can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the `stateObject` parameter, and your callback procedure can retrieve this information using the <xref:System.IAsyncResult.AsyncState%2A> property.
  2966. The `behavior` parameter lets you specify options that control the behavior of the command and its connection. These values can be combined together (using the programming language's `Or` operator); generally, developers use the `CloseConnection` value to make sure that the connection is closed by the runtime when the <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed. Developers can also optimize the behavior of the <xref:Microsoft.Data.SqlClient.SqlDataReader> by specifying the `SingleRow` value when it is known in advance that the Transact-SQL statement or stored procedure only returns a single row.
  2967. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> may block if more data is required and the underlying network's read operation blocks.
  2968. Because the callback procedure executes from within a background thread supplied by the Microsoft .NET common language runtime, it is very important that you take a rigorous approach to handling cross-thread interactions from within your applications. For example, you must not interact with a form's contents from within your callback procedure--should you have to update the form, you must switch back to the form's thread in order to do your work. The example in this topic demonstrates this behavior.
  2969. All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.
  2970. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  2971. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2972. ## Examples
  2973. The following Windows application demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method, executing a Transact-SQL statement that includes a delay of a few seconds (emulating a long-running command). Because the sample executes the command asynchronously, the form remains responsive while awaiting the results. This example passes the executing <xref:Microsoft.Data.SqlClient.SqlCommand> object as the `stateObject` parameter; doing so makes it simple to retrieve the <xref:Microsoft.Data.SqlClient.SqlCommand> object from within the callback procedure, so that the code can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method corresponding to the initial call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>.
  2974. This example demonstrates many important techniques. This includes calling a method that interacts with the form from a separate thread. In addition, this example demonstrates how you must block users from executing a command multiple times concurrently, and how you must make sure that the form does not close before the callback procedure is called.
  2975. To set up this example, create a new Windows application. Put a <xref:System.Windows.Forms.Button> control, a <xref:System.Windows.Forms.DataGridView> control, and a <xref:System.Windows.Forms.Label> control on the form (accepting the default name for each control). Add the following code to the form's class, modifying the connection string as needed for your environment.
  2976. This example passes the `CommandBehavior.CloseConnection` value in the `behavior` parameter, causing the returned <xref:Microsoft.Data.SqlClient.SqlDataReader> to automatically close its connection when it is closed.
  2977. [!code-csharp[SqlCommand_BeginExecuteReaderAsyncBehavior](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs)]
  2978. ]]></format>
  2979. </remarks><exception cref="T:System.InvalidCastException">
  2980. A
  2981. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2982. other than **Binary** or **VarBinary** was used when
  2983. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2984. was set to
  2985. <see cref="T:System.IO.Stream" />
  2986. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2987. -or-
  2988. A
  2989. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2990. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2991. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2992. was set to
  2993. <see cref="T:System.IO.TextReader" />
  2994. .
  2995. -or-
  2996. A
  2997. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2998. other than **Xml** was used when
  2999. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3000. was set to
  3001. <see cref="T:System.Xml.XmlReader" />
  3002. .
  3003. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3004. Any error that occurred while executing the command text.
  3005. -or-
  3006. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3007. </exception><exception cref="T:System.InvalidOperationException">
  3008. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  3009. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3010. .
  3011. -or-
  3012. The
  3013. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3014. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3015. </exception><exception cref="T:System.IO.IOException">
  3016. An error occurred in a
  3017. <see cref="T:System.IO.Stream" />
  3018. ,
  3019. <see cref="T:System.Xml.XmlReader" />
  3020. or
  3021. <see cref="T:System.IO.TextReader" />
  3022. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3023. </exception><exception cref="T:System.ObjectDisposedException">
  3024. The
  3025. <see cref="T:System.IO.Stream" />
  3026. ,
  3027. <see cref="T:System.Xml.XmlReader" />
  3028. or
  3029. <see cref="T:System.IO.TextReader" />
  3030. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3031. </exception>
  3032. </member>
  3033. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.Data.CommandBehavior)">
  3034. <param name="behavior">
  3035. One of the
  3036. <see cref="T:System.Data.CommandBehavior" />
  3037. values, indicating options for statement execution and data retrieval.
  3038. </param><summary>
  3039. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3040. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3041. using one of the
  3042. <see cref="T:System.Data.CommandBehavior" />
  3043. values.
  3044. </summary><returns>
  3045. An
  3046. <see cref="T:System.IAsyncResult" />
  3047. that can be used to poll, wait for results, or both; this value is also needed when invoking
  3048. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3049. , which returns a
  3050. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3051. instance that can be used to retrieve the returned rows.
  3052. </returns><remarks>
  3053. <format type="text/markdown"><![CDATA[
  3054. ## Remarks
  3055. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method to finish the operation and retrieve the <xref:Microsoft.Data.SqlClient.SqlDataReader> returned by the command. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  3056. The `behavior` parameter lets you specify options that control the behavior of the command and its connection. These values can be combined together (using the programming language's `OR` operator); generally, developers use the `CommandBehavior.CloseConnection` value to make sure that the connection is closed by the runtime when the <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed.
  3057. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous. This means that calls to <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> may block if more data is required and the underlying network's read operation blocks.
  3058. Because this overload does not support a callback procedure, developers must either poll to determine whether the command has completed, using the <xref:System.IAsyncResult.IsCompleted%2A> property of the <xref:System.IAsyncResult> returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery%2A> method; or wait for the completion of one or more commands using the <xref:System.IAsyncResult.AsyncWaitHandle%2A> property of the returned <xref:System.IAsyncResult>.
  3059. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server returns any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  3060. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3061. ## Examples
  3062. The following console application starts the process of retrieving a data reader asynchronously. While waiting for the results, this simple application sits in a loop, investigating the <xref:System.IAsyncResult.IsCompleted%2A> property value. Once the process has completed, the code retrieves the <xref:Microsoft.Data.SqlClient.SqlDataReader> and displays its contents.
  3063. This example also passes the `CommandBehavior.CloseConnection` and `CommandBehavior.SingleRow` values in the behavior parameter, causing the connection to be closed with the returned <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed, and to optimize for a single row result.
  3064. [!code-csharp[SqlCommand_BeginExecuteReaderAsyncSimple](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsyncSimple.cs)]
  3065. ]]></format>
  3066. </remarks><exception cref="T:System.InvalidCastException">
  3067. A
  3068. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3069. other than **Binary** or **VarBinary** was used when
  3070. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3071. was set to
  3072. <see cref="T:System.IO.Stream" />
  3073. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3074. -or-
  3075. A
  3076. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3077. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3078. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3079. was set to
  3080. <see cref="T:System.IO.TextReader" />
  3081. .
  3082. -or-
  3083. A
  3084. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3085. other than **Xml** was used when
  3086. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3087. was set to
  3088. <see cref="T:System.Xml.XmlReader" />
  3089. .
  3090. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3091. Any error that occurred while executing the command text.
  3092. -or-
  3093. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3094. </exception><exception cref="T:System.InvalidOperationException">
  3095. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  3096. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3097. .
  3098. -or-
  3099. The
  3100. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3101. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3102. </exception><exception cref="T:System.IO.IOException">
  3103. An error occurred in a
  3104. <see cref="T:System.IO.Stream" />
  3105. ,
  3106. <see cref="T:System.Xml.XmlReader" />
  3107. or
  3108. <see cref="T:System.IO.TextReader" />
  3109. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3110. </exception><exception cref="T:System.ObjectDisposedException">
  3111. The
  3112. <see cref="T:System.IO.Stream" />
  3113. ,
  3114. <see cref="T:System.Xml.XmlReader" />
  3115. or
  3116. <see cref="T:System.IO.TextReader" />
  3117. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3118. </exception>
  3119. </member>
  3120. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader">
  3121. <summary>
  3122. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3123. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3124. and returns results as an
  3125. <see cref="T:System.Xml.XmlReader" />
  3126. object.
  3127. </summary><returns>
  3128. An
  3129. <see cref="T:System.IAsyncResult" />
  3130. that can be used to poll or wait for results, or both; this value is also needed when invoking
  3131. <see langword="EndExecuteXmlReader" />
  3132. , which returns a single XML value.
  3133. </returns><remarks>
  3134. <format type="text/markdown"><![CDATA[
  3135. ## Remarks
  3136. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method starts the process of asynchronously executing a Transact-SQL statement that returns rows as XML, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the `EndExecuteXmlReader` method to finish the operation and retrieve the XML returned by the command. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method returns immediately, but until the code executes the corresponding `EndExecuteXmlReader` method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the `EndExecuteXmlReader` before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  3137. The <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property ordinarily specifies a Transact-SQL statement with a valid FOR XML clause. However, `CommandText` can also specify a statement that returns `ntext` data that contains valid XML.
  3138. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> query can be formatted as in the following C# example:
  3139. ```csharp
  3140. SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM dbo.Contact FOR XML AUTO, XMLDATA", SqlConn);
  3141. ```
  3142. This method can also be used to retrieve a single-row, single-column result set. In this case, if more than one row is returned, the `EndExecuteXmlReader` method attaches the <xref:System.Xml.XmlReader> to the value on the first row, and discards the rest of the result set.
  3143. The multiple active result set (MARS) feature lets multiple actions use the same connection.
  3144. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters are sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous. Although command execution is asynchronous, value fetching is still synchronous.
  3145. Because this overload does not support a callback procedure, developers need to either poll to determine whether the command has completed, using the <xref:System.IAsyncResult.IsCompleted%2A> property of the <xref:System.IAsyncResult> returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method; or wait for the completion of one or more commands using the <xref:System.IAsyncResult.AsyncWaitHandle%2A> property of the returned <xref:System.IAsyncResult>.
  3146. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server returns any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  3147. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3148. ## Examples
  3149. The following console application starts the process of retrieving XML data asynchronously. While waiting for the results, this simple application sits in a loop, investigating the <xref:System.IAsyncResult.IsCompleted%2A> property value. Once the process has completed, the code retrieves the XML and displays its contents.
  3150. [!code-csharp[SqlCommand_BeginExecuteXmlReader#1]((~/../sqlclient/doc/samples/SqlCommand_BeginExecuteXmlReader.cs)]
  3151. ]]></format>
  3152. </remarks><exception cref="T:System.InvalidCastException">
  3153. A
  3154. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3155. other than **Binary** or **VarBinary** was used when
  3156. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3157. was set to
  3158. <see cref="T:System.IO.Stream" />
  3159. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3160. -or-
  3161. A
  3162. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3163. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3164. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3165. was set to
  3166. <see cref="T:System.IO.TextReader" />
  3167. .
  3168. -or-
  3169. A
  3170. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3171. other than **Xml** was used when
  3172. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3173. was set to
  3174. <see cref="T:System.Xml.XmlReader" />
  3175. .
  3176. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3177. Any error that occurred while executing the command text.
  3178. -or-
  3179. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3180. </exception><exception cref="T:System.InvalidOperationException">
  3181. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  3182. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3183. .
  3184. -or-
  3185. The
  3186. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3187. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3188. </exception><exception cref="T:System.IO.IOException">
  3189. An error occurred in a
  3190. <see cref="T:System.IO.Stream" />
  3191. ,
  3192. <see cref="T:System.Xml.XmlReader" />
  3193. or
  3194. <see cref="T:System.IO.TextReader" />
  3195. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3196. </exception><exception cref="T:System.ObjectDisposedException">
  3197. The
  3198. <see cref="T:System.IO.Stream" />
  3199. ,
  3200. <see cref="T:System.Xml.XmlReader" />
  3201. or
  3202. <see cref="T:System.IO.TextReader" />
  3203. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3204. </exception>
  3205. </member>
  3206. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader(System.AsyncCallback,System.Object)">
  3207. <param name="callback">
  3208. An
  3209. <see cref="T:System.AsyncCallback" />
  3210. delegate that is invoked when the command's execution has completed. Pass
  3211. <see langword="null" />
  3212. (
  3213. <see langword="Nothing" />
  3214. in Microsoft Visual Basic) to indicate that no callback is required.
  3215. </param><param name="stateObject">
  3216. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  3217. <see cref="P:System.IAsyncResult.AsyncState" />
  3218. property.
  3219. </param><summary>
  3220. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3221. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3222. and returns results as an
  3223. <see cref="T:System.Xml.XmlReader" />
  3224. object, using a callback procedure.
  3225. </summary><returns>
  3226. An
  3227. <see cref="T:System.IAsyncResult" />
  3228. that can be used to poll, wait for results, or both; this value is also needed when the
  3229. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3230. is called, which returns the results of the command as XML.
  3231. </returns><remarks>
  3232. <format type="text/markdown"><![CDATA[
  3233. ## Remarks
  3234. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method starts the process of asynchronously executing a Transact-SQL statement or stored procedure that returns rows as XML, so that other tasks can run concurrently while the statement is executing. When the statement has completed, developers must call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method to finish the operation and retrieve the requested XML data. The <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method returns immediately, but until the code executes the corresponding <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method call, it must not execute any other calls that start a synchronous or asynchronous execution against the same <xref:Microsoft.Data.SqlClient.SqlCommand> object. Calling the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> before the command's execution is completed causes the <xref:Microsoft.Data.SqlClient.SqlCommand> object to block until the execution is finished.
  3235. The <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property ordinarily specifies a Transact-SQL statement with a valid FOR XML clause. However, `CommandText` can also specify a statement that returns data that contains valid XML. This method can also be used to retrieve a single-row, single-column result set. In this case, if more than one row is returned, the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method attaches the <xref:System.Xml.XmlReader> to the value on the first row, and discards the rest of the result set.
  3236. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> query can be formatted as in the following C# example:
  3237. ```csharp
  3238. SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM Contact FOR XML AUTO, XMLDATA", SqlConn);
  3239. ```
  3240. This method can also be used to retrieve a single-row, single-column result set. In this case, if more than one row is returned, the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method attaches the <xref:System.Xml.XmlReader> to the value on the first row, and discards the rest of the result set.
  3241. The multiple active result set (MARS) feature lets multiple actions use the same connection.
  3242. The `callback` parameter lets you specify an <xref:System.AsyncCallback> delegate that is called when the statement has completed. You can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method from within this delegate procedure, or from any other location within your application. In addition, you can pass any object in the `stateObject` parameter, and your callback procedure can retrieve this information using the <xref:System.IAsyncResult.AsyncState%2A> property.
  3243. Note that the command text and parameters are sent to the server synchronously. If a large command or many parameters is sent, this method may block during writes. After the command is sent, the method returns immediately without waiting for an answer from the server--that is, reads are asynchronous.
  3244. All errors that occur during the execution of the operation are thrown as exceptions in the callback procedure. You must handle the exception in the callback procedure, not in the main application. See the example in this topic for additional information on handling exceptions in the callback procedure.
  3245. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  3246. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3247. ## Examples
  3248. The following Windows application demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method, executing a Transact-SQL statement that includes a delay of a few seconds (emulating a long-running command). This example passes the executing <xref:Microsoft.Data.SqlClient.SqlCommand> object as the `stateObject` parameter--doing so makes it simple to retrieve the <xref:Microsoft.Data.SqlClient.SqlCommand> object from within the callback procedure, so that the code can call the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method corresponding to the initial call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A>.
  3249. This example demonstrates many important techniques. This includes calling a method that interacts with the form from a separate thread. In addition, this example demonstrates how you must block users from executing a command multiple times concurrently, and how you must make sure that the form does not close before the callback procedure is called.
  3250. To set up this example, create a new Windows application. Put a <xref:System.Windows.Forms.Button> control, a <xref:System.Windows.Forms.ListBox> control, and a <xref:System.Windows.Forms.Label> control on the form (accepting the default name for each control). Add the following code to the form's class, modifying the connection string as needed for your environment.
  3251. [!code-csharp[SqlCommand_BeginExecuteXmlReaderAsync](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteXmlReaderAsync.cs)]
  3252. ]]></format>
  3253. </remarks><exception cref="T:System.InvalidCastException">
  3254. A
  3255. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3256. other than **Binary** or **VarBinary** was used when
  3257. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3258. was set to
  3259. <see cref="T:System.IO.Stream" />
  3260. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3261. -or-
  3262. A
  3263. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3264. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3265. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3266. was set to
  3267. <see cref="T:System.IO.TextReader" />
  3268. .
  3269. -or-
  3270. A
  3271. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3272. other than **Xml** was used when
  3273. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3274. was set to
  3275. <see cref="T:System.Xml.XmlReader" />
  3276. .
  3277. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3278. Any error that occurred while executing the command text.
  3279. -or-
  3280. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3281. </exception><exception cref="T:System.InvalidOperationException">
  3282. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  3283. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3284. .
  3285. -or-
  3286. The
  3287. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3288. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3289. </exception><exception cref="T:System.IO.IOException">
  3290. An error occurred in a
  3291. <see cref="T:System.IO.Stream" />
  3292. ,
  3293. <see cref="T:System.Xml.XmlReader" />
  3294. or
  3295. <see cref="T:System.IO.TextReader" />
  3296. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3297. </exception><exception cref="T:System.ObjectDisposedException">
  3298. The
  3299. <see cref="T:System.IO.Stream" />
  3300. ,
  3301. <see cref="T:System.Xml.XmlReader" />
  3302. or
  3303. <see cref="T:System.IO.TextReader" />
  3304. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3305. </exception><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  3306. </member>
  3307. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Cancel">
  3308. <summary>
  3309. Tries to cancel the execution of a
  3310. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3311. .
  3312. </summary><remarks>
  3313. <format type="text/markdown"><![CDATA[
  3314. ## Remarks
  3315. If there is nothing to cancel, nothing occurs. However, if there is a command in process, and the attempt to cancel fails, no exception is generated.
  3316. In some rare cases, if you call <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A>, then call <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A> (implicitly or explicitly) before calling <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A>, and then call <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A>, the cancel command will not be sent to SQL Server and the result set can continue to stream after you call <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A>. To avoid this, make sure that you call <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> before closing the reader or connection.
  3317. ## Examples
  3318. The following example demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
  3319. [!code-csharp[SqlCommand_Cancel](~/../sqlclient/doc/samples/WebData SqlCommand_Cancel.cs)]
  3320. ]]></format>
  3321. </remarks>
  3322. </member>
  3323. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Clone">
  3324. <summary>
  3325. Creates a new
  3326. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3327. object that is a copy of the current instance.
  3328. </summary><returns>
  3329. A new
  3330. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3331. object that is a copy of this instance.
  3332. </returns><remarks>
  3333. To be added.
  3334. </remarks>
  3335. </member>
  3336. <member name="M:Microsoft.Data.SqlClient.SqlCommand.CreateDbParameter">
  3337. <summary>
  3338. To be added.
  3339. </summary><returns>
  3340. To be added.
  3341. </returns><remarks>
  3342. To be added.
  3343. </remarks>
  3344. </member>
  3345. <member name="M:Microsoft.Data.SqlClient.SqlCommand.CreateParameter">
  3346. <summary>
  3347. Creates a new instance of a
  3348. <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />
  3349. object.
  3350. </summary><returns>
  3351. A
  3352. <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />
  3353. object.
  3354. </returns><remarks>
  3355. <format type="text/markdown"><![CDATA[
  3356. ## Remarks
  3357. The <xref:Microsoft.Data.SqlClient.SqlCommand.CreateParameter%2A> method is a strongly-typed version of <xref:System.Data.IDbCommand.CreateParameter%2A>.
  3358. ]]></format>
  3359. </remarks><summary>
  3360. Creates a new instance of a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  3361. </summary><returns>
  3362. A <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  3363. </returns><remarks>
  3364. To be added.
  3365. </remarks>
  3366. </member>
  3367. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Dispose(System.Boolean)">
  3368. <param name="disposing">
  3369. To be added.
  3370. </param><summary>
  3371. To be added.
  3372. </summary><remarks>
  3373. To be added.
  3374. </remarks>
  3375. </member>
  3376. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)">
  3377. <param name="asyncResult">
  3378. The
  3379. <see cref="T:System.IAsyncResult" />
  3380. returned by the call to
  3381. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3382. .
  3383. </param><summary>
  3384. Finishes asynchronous execution of a Transact-SQL statement.
  3385. </summary><returns>
  3386. The number of rows affected (the same behavior as
  3387. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery" />
  3388. ).
  3389. </returns><remarks>
  3390. <format type="text/markdown"><![CDATA[
  3391. ## Remarks
  3392. When you call <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery> to execute a Transact-SQL statement, you must call <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the <xref:System.IAsyncResult> instance returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery> method. If a callback procedure was specified in the call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery>, this method must be called.
  3393. ## Examples
  3394. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery>.
  3395. ]]></format>
  3396. </remarks><exception cref="T:System.ArgumentException">
  3397. <paramref name="asyncResult" />
  3398. parameter is null (
  3399. <see langword="Nothing" />
  3400. in Microsoft Visual Basic)
  3401. </exception><exception cref="T:System.InvalidOperationException">
  3402. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3403. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3404. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3405. to complete execution of a call to
  3406. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3407. .
  3408. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3409. The amount of time specified in
  3410. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" />
  3411. elapsed and the asynchronous operation specified with
  3412. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3413. is not complete.
  3414. -or-
  3415. In some situations,
  3416. <see cref="T:System.IAsyncResult" />
  3417. can be set to
  3418. <see langword="IsCompleted" />
  3419. incorrectly. If this occurs and
  3420. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3421. is called, EndExecuteNonQuery could raise a SqlException error if the amount of time specified in
  3422. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" />
  3423. elapsed and the asynchronous operation specified with
  3424. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3425. is not complete. To correct this situation, you should either increase the value of CommandTimeout or reduce the work being done by the asynchronous operation.
  3426. </exception>
  3427. </member>
  3428. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)">
  3429. <param name="asyncResult">
  3430. The
  3431. <see cref="T:System.IAsyncResult" />
  3432. returned by the call to
  3433. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader" />
  3434. .
  3435. </param><summary>
  3436. Finishes asynchronous execution of a Transact-SQL statement, returning the requested
  3437. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3438. .
  3439. </summary><returns>
  3440. A
  3441. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3442. object that can be used to retrieve the requested rows.
  3443. </returns><remarks>
  3444. <format type="text/markdown"><![CDATA[
  3445. ## Remarks
  3446. When you call <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to execute a Transact-SQL statement, you must call <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the <xref:System.IAsyncResult> instance returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> method. If a callback procedure was specified in the call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>, this method must be called.
  3447. ## Examples
  3448. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>.
  3449. ]]></format>
  3450. </remarks><exception cref="T:System.ArgumentException">
  3451. <paramref name="asyncResult" />
  3452. parameter is null (
  3453. <see langword="Nothing" />
  3454. in Microsoft Visual Basic)
  3455. </exception><exception cref="T:System.InvalidOperationException">
  3456. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3457. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3458. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3459. to complete execution of a call to
  3460. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3461. .
  3462. </exception>
  3463. </member>
  3464. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)">
  3465. <param name="asyncResult">
  3466. The
  3467. <see cref="T:System.IAsyncResult" />
  3468. returned by the call to
  3469. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3470. .
  3471. </param><summary>
  3472. Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.
  3473. </summary><returns>
  3474. An
  3475. <see cref="T:System.Xml.XmlReader" />
  3476. object that can be used to fetch the resulting XML data.
  3477. </returns><remarks>
  3478. <format type="text/markdown"><![CDATA[
  3479. ## Remarks
  3480. When you call <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to execute a Transact-SQL statement, you must call <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the <xref:System.IAsyncResult> instance returned by the <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> method. If a callback procedure was specified in the call to <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A>, this method must be called.
  3481. ## Examples
  3482. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A>.
  3483. ]]></format>
  3484. </remarks><exception cref="T:System.ArgumentException">
  3485. <paramref name="asyncResult" />
  3486. parameter is null (
  3487. <see langword="Nothing" />
  3488. in Microsoft Visual Basic)
  3489. </exception><exception cref="T:System.InvalidOperationException">
  3490. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3491. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3492. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3493. to complete execution of a call to
  3494. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3495. .
  3496. </exception>
  3497. </member>
  3498. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(System.Data.CommandBehavior)">
  3499. <param name="behavior">
  3500. To be added.
  3501. </param><summary>
  3502. To be added.
  3503. </summary><returns>
  3504. To be added.
  3505. </returns><remarks>
  3506. To be added.
  3507. </remarks>
  3508. </member>
  3509. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)">
  3510. <param name="behavior">
  3511. To be added.
  3512. </param><param name="cancellationToken">
  3513. To be added.
  3514. </param><summary>
  3515. To be added.
  3516. </summary><returns>
  3517. To be added.
  3518. </returns><remarks>
  3519. To be added.
  3520. </remarks>
  3521. </member>
  3522. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery">
  3523. <summary>
  3524. Executes a Transact-SQL statement against the connection and returns the number of rows affected.
  3525. </summary><returns>
  3526. The number of rows affected.
  3527. </returns><remarks>
  3528. <format type="text/markdown"><![CDATA[
  3529. ## Remarks
  3530. You can use the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> to perform catalog operations (for example, querying the structure of a database or creating database objects such as tables), or to change the data in a database without using a <xref:System.Data.DataSet> by executing UPDATE, INSERT, or DELETE statements.
  3531. Although the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> returns no rows, any output parameters or return values mapped to parameters are populated with data.
  3532. For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1.
  3533. When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers.
  3534. When SET NOCOUNT ON is set on the connection (before or as part of executing the command, or as part of a trigger initiated by the execution of the command) the rows affected by individual statements stop contributing to the count of rows affected that is returned by this method.
  3535. If no statements are detected that contribute to the count, the return value is -1. If a rollback occurs, the return value is also -1.
  3536. ## Examples
  3537. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and then executes it using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>. The example is passed a string that is a Transact-SQL statement (such as UPDATE, INSERT, or DELETE) and a string to use to connect to the data source.
  3538. [!code-csharp[SqlCommand_ExecuteNonQuery](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs)]
  3539. ]]></format>
  3540. </remarks><exception cref="T:System.InvalidCastException">
  3541. A
  3542. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3543. other than **Binary** or **VarBinary** was used when
  3544. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3545. was set to
  3546. <see cref="T:System.IO.Stream" />
  3547. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3548. -or-
  3549. A
  3550. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3551. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3552. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3553. was set to
  3554. <see cref="T:System.IO.TextReader" />
  3555. .
  3556. -or-
  3557. A
  3558. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3559. other than **Xml** was used when
  3560. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3561. was set to
  3562. <see cref="T:System.Xml.XmlReader" />
  3563. .
  3564. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3565. An exception occurred while executing the command against a locked row. This exception is not generated when you are using Microsoft .NET Framework version 1.0.
  3566. -or-
  3567. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3568. </exception><exception cref="T:System.IO.IOException">
  3569. An error occurred in a
  3570. <see cref="T:System.IO.Stream" />
  3571. ,
  3572. <see cref="T:System.Xml.XmlReader" />
  3573. or
  3574. <see cref="T:System.IO.TextReader" />
  3575. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3576. </exception><exception cref="T:System.InvalidOperationException">
  3577. The
  3578. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3579. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3580. </exception><exception cref="T:System.ObjectDisposedException">
  3581. The
  3582. <see cref="T:System.IO.Stream" />
  3583. ,
  3584. <see cref="T:System.Xml.XmlReader" />
  3585. or
  3586. <see cref="T:System.IO.TextReader" />
  3587. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3588. </exception>
  3589. </member>
  3590. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(System.Threading.CancellationToken)">
  3591. <param name="cancellationToken">
  3592. The cancellation instruction.
  3593. </param><summary>
  3594. An asynchronous version of
  3595. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery" />
  3596. , which executes a Transact-SQL statement against the connection and returns the number of rows affected. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  3597. </summary><returns>
  3598. A task representing the asynchronous operation.
  3599. </returns><remarks>
  3600. <format type="text/markdown"><![CDATA[
  3601. ## Remarks
  3602. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3603. ]]></format>
  3604. </remarks><exception cref="T:System.InvalidCastException">
  3605. A
  3606. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3607. other than **Binary** or **VarBinary** was used when
  3608. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3609. was set to
  3610. <see cref="T:System.IO.Stream" />
  3611. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3612. -or-
  3613. A
  3614. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3615. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3616. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3617. was set to
  3618. <see cref="T:System.IO.TextReader" />
  3619. .
  3620. -or-
  3621. A
  3622. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3623. other than **Xml** was used when
  3624. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3625. was set to
  3626. <see cref="T:System.Xml.XmlReader" />
  3627. .
  3628. </exception><exception cref="T:System.InvalidOperationException">
  3629. Calling
  3630. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(System.Threading.CancellationToken)" />
  3631. more than once for the same instance before task completion.
  3632. -or-
  3633. The
  3634. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3635. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3636. -or-
  3637. <see langword="Context Connection=true" />
  3638. is specified in the connection string.
  3639. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3640. SQL Server returned an error while executing the command text.
  3641. -or-
  3642. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3643. </exception><exception cref="T:System.IO.IOException">
  3644. An error occurred in a
  3645. <see cref="T:System.IO.Stream" />
  3646. ,
  3647. <see cref="T:System.Xml.XmlReader" />
  3648. or
  3649. <see cref="T:System.IO.TextReader" />
  3650. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3651. </exception><exception cref="T:System.ObjectDisposedException">
  3652. The
  3653. <see cref="T:System.IO.Stream" />
  3654. ,
  3655. <see cref="T:System.Xml.XmlReader" />
  3656. or
  3657. <see cref="T:System.IO.TextReader" />
  3658. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3659. </exception>
  3660. </member>
  3661. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader">
  3662. <summary>
  3663. Sends the
  3664. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3665. to the
  3666. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3667. and builds a
  3668. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3669. .
  3670. </summary><returns>
  3671. A
  3672. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3673. object.
  3674. </returns><remarks>
  3675. <format type="text/markdown"><![CDATA[
  3676. ## Remarks
  3677. When the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A> property is set to `StoredProcedure`, the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property should be set to the name of the stored procedure. The command executes this stored procedure when you call <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A>.
  3678. > [!NOTE]
  3679. > If a transaction is deadlocked, an exception may not be thrown until <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> is called.
  3680. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  3681. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  3682. ## Examples
  3683. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand>, and then executes it by passing a string that is a Transact-SQL SELECT statement, and a string to use to connect to the data source.
  3684. [!code-csharp[SqlCommand_ExecuteReader](~/../sqlclient/doc/samples/SqlCommand_ExecuteReader.cs)]
  3685. ]]></format>
  3686. </remarks><exception cref="T:System.InvalidCastException">
  3687. A
  3688. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3689. other than **Binary** or **VarBinary** was used when
  3690. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3691. was set to
  3692. <see cref="T:System.IO.Stream" />
  3693. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3694. -or-
  3695. A
  3696. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3697. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3698. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3699. was set to
  3700. <see cref="T:System.IO.TextReader" />
  3701. .
  3702. -or-
  3703. A
  3704. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3705. other than **Xml** was used when
  3706. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3707. was set to
  3708. <see cref="T:System.Xml.XmlReader" />
  3709. .
  3710. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3711. An exception occurred while executing the command against a locked row. This exception is not generated when you are using Microsoft .NET Framework version 1.0.
  3712. -or-
  3713. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3714. </exception><exception cref="T:System.InvalidOperationException">
  3715. The current state of the connection is closed.
  3716. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  3717. requires an open
  3718. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3719. .
  3720. -or-
  3721. The
  3722. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3723. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3724. </exception><exception cref="T:System.IO.IOException">
  3725. An error occurred in a
  3726. <see cref="T:System.IO.Stream" />
  3727. ,
  3728. <see cref="T:System.Xml.XmlReader" />
  3729. or
  3730. <see cref="T:System.IO.TextReader" />
  3731. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3732. </exception><exception cref="T:System.ObjectDisposedException">
  3733. The
  3734. <see cref="T:System.IO.Stream" />
  3735. ,
  3736. <see cref="T:System.Xml.XmlReader" />
  3737. or
  3738. <see cref="T:System.IO.TextReader" />
  3739. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3740. </exception>
  3741. </member>
  3742. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)">
  3743. <param name="behavior">
  3744. One of the
  3745. <see cref="T:System.Data.CommandBehavior" />
  3746. values.
  3747. </param><summary>
  3748. Sends the
  3749. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3750. to the
  3751. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3752. , and builds a
  3753. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3754. using one of the
  3755. <see cref="T:System.Data.CommandBehavior" />
  3756. values.
  3757. </summary><returns>
  3758. A
  3759. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3760. object.
  3761. </returns><remarks>
  3762. <format type="text/markdown"><![CDATA[
  3763. ## Remarks
  3764. When the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A> property is set to `StoredProcedure`, the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property should be set to the name of the stored procedure. The command executes this stored procedure when you call <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A>.
  3765. > [!NOTE]
  3766. > Use <xref:System.Data.CommandBehavior.SequentialAccess> to retrieve large values and binary data. Otherwise, an <xref:System.OutOfMemoryException> might occur and the connection will be closed.
  3767. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  3768. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  3769. ## Examples
  3770. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand>, and then executes it by passing a string that is a Transact-SQL SELECT statement, and a string to use to connect to the data source. <xref:System.Data.CommandBehavior> is set to <xref:System.Data.CommandBehavior.CloseConnection>.
  3771. [!code-csharp[SqlCommand_ExecuteReader2](~/../sqlclient/doc/samples/SqlCommand_ExecuteReader2.cs#1)]
  3772. ]]></format>
  3773. </remarks><exception cref="T:System.InvalidCastException">
  3774. A
  3775. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3776. other than **Binary** or **VarBinary** was used when
  3777. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3778. was set to
  3779. <see cref="T:System.IO.Stream" />
  3780. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3781. -or-
  3782. A
  3783. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3784. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3785. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3786. was set to
  3787. <see cref="T:System.IO.TextReader" />
  3788. .
  3789. -or-
  3790. A
  3791. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3792. other than **Xml** was used when
  3793. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3794. was set to
  3795. <see cref="T:System.Xml.XmlReader" />
  3796. .
  3797. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3798. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3799. </exception><exception cref="T:System.IO.IOException">
  3800. An error occurred in a
  3801. <see cref="T:System.IO.Stream" />
  3802. ,
  3803. <see cref="T:System.Xml.XmlReader" />
  3804. or
  3805. <see cref="T:System.IO.TextReader" />
  3806. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3807. </exception><exception cref="T:System.InvalidOperationException">
  3808. The
  3809. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3810. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3811. </exception><exception cref="T:System.ObjectDisposedException">
  3812. The
  3813. <see cref="T:System.IO.Stream" />
  3814. ,
  3815. <see cref="T:System.Xml.XmlReader" />
  3816. or
  3817. <see cref="T:System.IO.TextReader" />
  3818. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3819. </exception>
  3820. </member>
  3821. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync">
  3822. <summary>
  3823. An asynchronous version of
  3824. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  3825. , which sends the
  3826. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3827. to the
  3828. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3829. and builds a
  3830. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3831. . Exceptions will be reported via the returned Task object.
  3832. </summary><returns>
  3833. A task representing the asynchronous operation.
  3834. </returns><remarks>
  3835. <format type="text/markdown"><![CDATA[
  3836. ## Remarks
  3837. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3838. ]]></format>
  3839. </remarks><exception cref="T:System.InvalidCastException">
  3840. A
  3841. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3842. other than **Binary** or **VarBinary** was used when
  3843. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3844. was set to
  3845. <see cref="T:System.IO.Stream" />
  3846. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3847. -or-
  3848. A
  3849. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3850. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3851. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3852. was set to
  3853. <see cref="T:System.IO.TextReader" />
  3854. .
  3855. -or-
  3856. A
  3857. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3858. other than **Xml** was used when
  3859. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3860. was set to
  3861. <see cref="T:System.Xml.XmlReader" />
  3862. .
  3863. </exception><exception cref="T:System.ArgumentException">
  3864. An invalid
  3865. <see cref="T:System.Data.CommandBehavior" />
  3866. value.
  3867. </exception><exception cref="T:System.InvalidOperationException">
  3868. Calling
  3869. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync" />
  3870. more than once for the same instance before task completion.
  3871. -or-
  3872. The
  3873. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3874. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3875. -or-
  3876. <see langword="Context Connection=true" />
  3877. is specified in the connection string.
  3878. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3879. SQL Server returned an error while executing the command text.
  3880. -or-
  3881. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3882. </exception><exception cref="T:System.IO.IOException">
  3883. An error occurred in a
  3884. <see cref="T:System.IO.Stream" />
  3885. ,
  3886. <see cref="T:System.Xml.XmlReader" />
  3887. or
  3888. <see cref="T:System.IO.TextReader" />
  3889. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3890. </exception><exception cref="T:System.ObjectDisposedException">
  3891. The
  3892. <see cref="T:System.IO.Stream" />
  3893. ,
  3894. <see cref="T:System.Xml.XmlReader" />
  3895. or
  3896. <see cref="T:System.IO.TextReader" />
  3897. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3898. </exception>
  3899. </member>
  3900. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior)">
  3901. <param name="behavior">
  3902. Options for statement execution and data retrieval. When is set to
  3903. <see langword="Default" />
  3904. ,
  3905. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" />
  3906. reads the entire row before returning a complete Task.
  3907. </param><summary>
  3908. An asynchronous version of
  3909. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)" />
  3910. , which sends the
  3911. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3912. to the
  3913. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3914. , and builds a
  3915. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3916. . Exceptions will be reported via the returned Task object.
  3917. </summary><returns>
  3918. A task representing the asynchronous operation.
  3919. </returns><remarks>
  3920. <format type="text/markdown"><![CDATA[
  3921. ## Remarks
  3922. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3923. ]]></format>
  3924. </remarks><exception cref="T:System.InvalidCastException">
  3925. A
  3926. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3927. other than **Binary** or **VarBinary** was used when
  3928. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3929. was set to
  3930. <see cref="T:System.IO.Stream" />
  3931. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3932. -or-
  3933. A
  3934. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3935. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3936. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3937. was set to
  3938. <see cref="T:System.IO.TextReader" />
  3939. .
  3940. -or-
  3941. A
  3942. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3943. other than **Xml** was used when
  3944. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3945. was set to
  3946. <see cref="T:System.Xml.XmlReader" />
  3947. .
  3948. </exception><exception cref="T:System.ArgumentException">
  3949. An invalid
  3950. <see cref="T:System.Data.CommandBehavior" />
  3951. value.
  3952. </exception><exception cref="T:System.InvalidOperationException">
  3953. Calling
  3954. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior)" />
  3955. more than once for the same instance before task completion.
  3956. -or-
  3957. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3958. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3959. -or-
  3960. <see langword="Context Connection=true" />
  3961. is specified in the connection string.
  3962. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3963. SQL Server returned an error while executing the command text.
  3964. -or-
  3965. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3966. </exception><exception cref="T:System.IO.IOException">
  3967. An error occurred in a
  3968. <see cref="T:System.IO.Stream" />
  3969. ,
  3970. <see cref="T:System.Xml.XmlReader" />
  3971. or
  3972. <see cref="T:System.IO.TextReader" />
  3973. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3974. </exception><exception cref="T:System.ObjectDisposedException">
  3975. The
  3976. <see cref="T:System.IO.Stream" />
  3977. ,
  3978. <see cref="T:System.Xml.XmlReader" />
  3979. or
  3980. <see cref="T:System.IO.TextReader" />
  3981. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3982. </exception>
  3983. </member>
  3984. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)">
  3985. <param name="behavior">
  3986. Options for statement execution and data retrieval. When is set to
  3987. <see langword="Default" />
  3988. ,
  3989. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" />
  3990. reads the entire row before returning a complete Task.
  3991. </param><param name="cancellationToken">
  3992. The cancellation instruction.
  3993. </param><summary>
  3994. An asynchronous version of
  3995. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)" />
  3996. , which sends the
  3997. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3998. to the
  3999. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4000. , and builds a
  4001. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4002. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  4003. </summary><returns>
  4004. A task representing the asynchronous operation.
  4005. </returns><remarks>
  4006. <format type="text/markdown"><![CDATA[
  4007. ## Remarks
  4008. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4009. ]]></format>
  4010. </remarks><exception cref="T:System.InvalidCastException">
  4011. A
  4012. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4013. other than **Binary** or **VarBinary** was used when
  4014. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4015. was set to
  4016. <see cref="T:System.IO.Stream" />
  4017. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4018. -or-
  4019. A
  4020. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4021. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4022. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4023. was set to
  4024. <see cref="T:System.IO.TextReader" />
  4025. .
  4026. -or-
  4027. A
  4028. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4029. other than **Xml** was used when
  4030. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4031. was set to
  4032. <see cref="T:System.Xml.XmlReader" />
  4033. .
  4034. </exception><exception cref="T:System.ArgumentException">
  4035. An invalid
  4036. <see cref="T:System.Data.CommandBehavior" />
  4037. value.
  4038. </exception><exception cref="T:System.InvalidOperationException">
  4039. Calling
  4040. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)" />
  4041. more than once for the same instance before task completion.
  4042. -or-
  4043. The
  4044. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4045. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4046. -or-
  4047. <see langword="Context Connection=true" />
  4048. is specified in the connection string.
  4049. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4050. SQL Server returned an error while executing the command text.
  4051. -or-
  4052. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4053. </exception><exception cref="T:System.IO.IOException">
  4054. An error occurred in a
  4055. <see cref="T:System.IO.Stream" />
  4056. ,
  4057. <see cref="T:System.Xml.XmlReader" />
  4058. or
  4059. <see cref="T:System.IO.TextReader" />
  4060. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4061. </exception><exception cref="T:System.ObjectDisposedException">
  4062. The
  4063. <see cref="T:System.IO.Stream" />
  4064. ,
  4065. <see cref="T:System.Xml.XmlReader" />
  4066. or
  4067. <see cref="T:System.IO.TextReader" />
  4068. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4069. </exception>
  4070. </member>
  4071. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Threading.CancellationToken)">
  4072. <param name="cancellationToken">
  4073. The cancellation instruction.
  4074. </param><summary>
  4075. An asynchronous version of
  4076. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  4077. , which sends the
  4078. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4079. to the
  4080. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4081. and builds a
  4082. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4083. .
  4084. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  4085. </summary><returns>
  4086. A task representing the asynchronous operation.
  4087. </returns><remarks>
  4088. <format type="text/markdown">
  4089. <![CDATA[
  4090. ## Remarks
  4091. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4092. ]]>
  4093. </format>
  4094. </remarks><exception cref="T:System.InvalidCastException">
  4095. A
  4096. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4097. other than **Binary** or **VarBinary** was used when
  4098. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4099. was set to
  4100. <see cref="T:System.IO.Stream" />
  4101. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4102. -or-
  4103. A
  4104. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4105. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4106. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4107. was set to
  4108. <see cref="T:System.IO.TextReader" />
  4109. .
  4110. -or-
  4111. A
  4112. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4113. other than **Xml** was used when
  4114. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4115. was set to
  4116. <see cref="T:System.Xml.XmlReader" />
  4117. .
  4118. </exception><exception cref="T:System.ArgumentException">
  4119. An invalid
  4120. <see cref="T:System.Data.CommandBehavior" />
  4121. value.
  4122. </exception><exception cref="T:System.InvalidOperationException">
  4123. Calling
  4124. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)" />
  4125. more than once for the same instance before task completion.
  4126. -or-
  4127. The
  4128. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4129. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4130. -or-
  4131. <see langword="Context Connection=true" />
  4132. is specified in the connection string.
  4133. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4134. SQL Server returned an error while executing the command text.
  4135. -or-
  4136. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4137. </exception><exception cref="T:System.IO.IOException">
  4138. An error occurred in a
  4139. <see cref="T:System.IO.Stream" />
  4140. ,
  4141. <see cref="T:System.Xml.XmlReader" />
  4142. or
  4143. <see cref="T:System.IO.TextReader" />
  4144. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4145. </exception><exception cref="T:System.ObjectDisposedException">
  4146. The
  4147. <see cref="T:System.IO.Stream" />
  4148. ,
  4149. <see cref="T:System.Xml.XmlReader" />
  4150. or
  4151. <see cref="T:System.IO.TextReader" />
  4152. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4153. </exception>
  4154. </member>
  4155. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar">
  4156. <summary>
  4157. Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
  4158. </summary><returns>
  4159. The first column of the first row in the result set, or a null reference (
  4160. <see langword="Nothing" />
  4161. in Visual Basic) if the result set is empty. Returns a maximum of 2033 characters.
  4162. </returns><remarks>
  4163. <format type="text/markdown"><![CDATA[
  4164. ## Remarks
  4165. Use the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A> method to retrieve a single value (for example, an aggregate value) from a database. This requires less code than using the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> method, and then performing the operations that you need to generate the single value using the data returned by a <xref:Microsoft.Data.SqlClient.SqlDataReader>.
  4166. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A> query can be formatted as in the following C# example:
  4167. ```csharp
  4168. cmd.CommandText = "SELECT COUNT(*) FROM dbo.region";
  4169. Int32 count = (Int32) cmd.ExecuteScalar();
  4170. ```
  4171. ## Examples
  4172. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and then executes it using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A>. The example is passed a string representing a new value to be inserted into a table, and a string to use to connect to the data source. The function returns the new **Identity** column value if a new row was inserted, 0 on failure.
  4173. [!code-csharp[SqlCommand.ExecuteScalar#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteScalar.cs#1)]
  4174. ]]></format>
  4175. </remarks><exception cref="T:System.InvalidCastException">
  4176. A
  4177. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4178. other than **Binary** or **VarBinary** was used when
  4179. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4180. was set to
  4181. <see cref="T:System.IO.Stream" />
  4182. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4183. -or-
  4184. A
  4185. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4186. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4187. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4188. was set to
  4189. <see cref="T:System.IO.TextReader" />
  4190. .
  4191. -or-
  4192. A
  4193. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4194. other than **Xml** was used when
  4195. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4196. was set to
  4197. <see cref="T:System.Xml.XmlReader" />
  4198. .
  4199. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4200. An exception occurred while executing the command against a locked row. This exception is not generated when you are using Microsoft .NET Framework version 1.0.
  4201. -or-
  4202. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4203. </exception><exception cref="T:System.InvalidOperationException">
  4204. The
  4205. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4206. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4207. </exception><exception cref="T:System.IO.IOException">
  4208. An error occurred in a
  4209. <see cref="T:System.IO.Stream" />
  4210. ,
  4211. <see cref="T:System.Xml.XmlReader" />
  4212. or
  4213. <see cref="T:System.IO.TextReader" />
  4214. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4215. </exception><exception cref="T:System.ObjectDisposedException">
  4216. The
  4217. <see cref="T:System.IO.Stream" />
  4218. ,
  4219. <see cref="T:System.Xml.XmlReader" />
  4220. or
  4221. <see cref="T:System.IO.TextReader" />
  4222. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4223. </exception>
  4224. </member>
  4225. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)">
  4226. <param name="cancellationToken">
  4227. The cancellation instruction.
  4228. </param><summary>
  4229. An asynchronous version of
  4230. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar" />
  4231. , which executes the query asynchronously and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
  4232. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  4233. </summary><returns>
  4234. A task representing the asynchronous operation.
  4235. </returns><remarks>
  4236. <format type="text/markdown"><![CDATA[
  4237. ## Remarks
  4238. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4239. ]]></format>
  4240. </remarks><exception cref="T:System.InvalidCastException">
  4241. A
  4242. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4243. other than **Binary** or **VarBinary** was used when
  4244. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4245. was set to
  4246. <see cref="T:System.IO.Stream" />
  4247. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4248. -or-
  4249. A
  4250. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4251. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4252. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4253. was set to
  4254. <see cref="T:System.IO.TextReader" />
  4255. .
  4256. -or-
  4257. A
  4258. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4259. other than **Xml** was used when
  4260. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4261. was set to
  4262. <see cref="T:System.Xml.XmlReader" />
  4263. .
  4264. </exception><exception cref="T:System.InvalidOperationException">
  4265. Calling
  4266. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4267. more than once for the same instance before task completion.
  4268. -or-
  4269. The
  4270. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4271. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4272. -or-
  4273. <see langword="Context Connection=true" />
  4274. is specified in the connection string.
  4275. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4276. SQL Server returned an error while executing the command text.
  4277. -or-
  4278. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4279. </exception><exception cref="T:System.IO.IOException">
  4280. An error occurred in a
  4281. <see cref="T:System.IO.Stream" />
  4282. ,
  4283. <see cref="T:System.Xml.XmlReader" />
  4284. or
  4285. <see cref="T:System.IO.TextReader" />
  4286. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4287. </exception><exception cref="T:System.ObjectDisposedException">
  4288. The
  4289. <see cref="T:System.IO.Stream" />
  4290. ,
  4291. <see cref="T:System.Xml.XmlReader" />
  4292. or
  4293. <see cref="T:System.IO.TextReader" />
  4294. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4295. </exception>
  4296. </member>
  4297. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader">
  4298. <summary>
  4299. Sends the
  4300. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4301. to the
  4302. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4303. and builds an
  4304. <see cref="T:System.Xml.XmlReader" />
  4305. object.
  4306. </summary><returns>
  4307. An
  4308. <see cref="T:System.Xml.XmlReader" />
  4309. object.
  4310. </returns><remarks>
  4311. <format type="text/markdown"><![CDATA[
  4312. ## Remarks
  4313. The **XmlReader** returned by this method does not support asynchronous operations.
  4314. The <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> property ordinarily specifies a Transact-SQL statement with a valid FOR XML clause. However, <xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A> can also specify a statement that returns `ntext` or `nvarchar` data that contains valid XML, or the contents of a column defined with the `xml` data type.
  4315. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> query can be formatted as in the following Microsoft Visual C# example:
  4316. ```csharp
  4317. SqlCommand command = new SqlCommand("SELECT * FROM dbo.Customers FOR XML AUTO, XMLDATA", SqlConn);
  4318. ```
  4319. This method can also be used to retrieve a single-row, single-column result set that contains XML data. In this case, if more than one row is returned, the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> method attaches the <xref:System.Xml.XmlReader> to the value on the first row, and discards the rest of the result set.
  4320. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  4321. If you use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A> to access XML data, SQL Server will return any XML results greater than 2,033 characters in length in multiple rows of 2,033 characters each. To avoid this behavior, use <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> or <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> to read FOR XML queries.
  4322. ## Examples
  4323. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and then executes it using <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A>. The example is passed a string that is a Transact-SQL FOR XML SELECT statement, and a string to use to connect to the data source.
  4324. [!code-csharp[SqlCommand_ExecuteXmlReader#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteXmlReader.cs#1)]
  4325. ]]></format>
  4326. </remarks><exception cref="T:System.InvalidCastException">
  4327. A
  4328. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4329. other than **Binary** or **VarBinary** was used when
  4330. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4331. was set to
  4332. <see cref="T:System.IO.Stream" />
  4333. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4334. -or-
  4335. A
  4336. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4337. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4338. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4339. was set to
  4340. <see cref="T:System.IO.TextReader" />
  4341. .
  4342. -or-
  4343. A
  4344. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4345. other than **Xml** was used when
  4346. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4347. was set to
  4348. <see cref="T:System.Xml.XmlReader" />
  4349. .
  4350. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4351. An exception occurred while executing the command against a locked row. This exception is not generated when you are using Microsoft .NET Framework version 1.0.
  4352. -or-
  4353. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4354. </exception><exception cref="T:System.InvalidOperationException">
  4355. The
  4356. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4357. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4358. </exception><exception cref="T:System.IO.IOException">
  4359. An error occurred in a
  4360. <see cref="T:System.IO.Stream" />
  4361. ,
  4362. <see cref="T:System.Xml.XmlReader" />
  4363. or
  4364. <see cref="T:System.IO.TextReader" />
  4365. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4366. </exception><exception cref="T:System.ObjectDisposedException">
  4367. The
  4368. <see cref="T:System.IO.Stream" />
  4369. ,
  4370. <see cref="T:System.Xml.XmlReader" />
  4371. or
  4372. <see cref="T:System.IO.TextReader" />
  4373. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4374. </exception>
  4375. </member>
  4376. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync">
  4377. <summary>
  4378. An asynchronous version of
  4379. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  4380. , which sends the
  4381. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4382. to the
  4383. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4384. and builds an
  4385. <see cref="T:System.Xml.XmlReader" />
  4386. object.
  4387. Exceptions will be reported via the returned Task object.
  4388. </summary><returns>
  4389. A task representing the asynchronous operation.
  4390. </returns><remarks>
  4391. <format type="text/markdown"><![CDATA[
  4392. ## Remarks
  4393. The **XmlReader** returned by this method does not support asynchronous operations.
  4394. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4395. ]]></format>
  4396. </remarks><exception cref="T:System.InvalidCastException">
  4397. A
  4398. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4399. other than **Binary** or **VarBinary** was used when
  4400. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4401. was set to
  4402. <see cref="T:System.IO.Stream" />
  4403. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4404. -or-
  4405. A
  4406. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4407. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4408. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4409. was set to
  4410. <see cref="T:System.IO.TextReader" />
  4411. .
  4412. -or-
  4413. A
  4414. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4415. other than **Xml** was used when
  4416. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4417. was set to
  4418. <see cref="T:System.Xml.XmlReader" />
  4419. .
  4420. </exception><exception cref="T:System.InvalidOperationException">
  4421. Calling
  4422. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4423. more than once for the same instance before task completion.
  4424. -or-
  4425. The
  4426. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4427. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4428. -or-
  4429. <see langword="Context Connection=true" />
  4430. is specified in the connection string.
  4431. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4432. SQL Server returned an error while executing the command text.
  4433. -or-
  4434. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4435. </exception><exception cref="T:System.IO.IOException">
  4436. An error occurred in a
  4437. <see cref="T:System.IO.Stream" />
  4438. ,
  4439. <see cref="T:System.Xml.XmlReader" />
  4440. or
  4441. <see cref="T:System.IO.TextReader" />
  4442. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4443. </exception><exception cref="T:System.ObjectDisposedException">
  4444. The
  4445. <see cref="T:System.IO.Stream" />
  4446. ,
  4447. <see cref="T:System.Xml.XmlReader" />
  4448. or
  4449. <see cref="T:System.IO.TextReader" />
  4450. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4451. </exception>
  4452. </member>
  4453. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync(System.Threading.CancellationToken)">
  4454. <param name="cancellationToken">
  4455. The cancellation instruction.
  4456. </param><summary>
  4457. An asynchronous version of
  4458. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  4459. , which sends the
  4460. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4461. to the
  4462. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4463. and builds an
  4464. <see cref="T:System.Xml.XmlReader" />
  4465. object.
  4466. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.
  4467. </summary><returns>
  4468. A task representing the asynchronous operation.
  4469. </returns><remarks>
  4470. <format type="text/markdown"><![CDATA[
  4471. ## Remarks
  4472. The **XmlReader** returned by this method does not support asynchronous operations.
  4473. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4474. ]]></format>
  4475. </remarks><exception cref="T:System.InvalidCastException">
  4476. A
  4477. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4478. other than **Binary** or **VarBinary** was used when
  4479. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4480. was set to
  4481. <see cref="T:System.IO.Stream" />
  4482. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4483. -or-
  4484. A
  4485. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4486. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4487. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4488. was set to
  4489. <see cref="T:System.IO.TextReader" />
  4490. .
  4491. -or-
  4492. A
  4493. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4494. other than **Xml** was used when
  4495. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4496. was set to
  4497. <see cref="T:System.Xml.XmlReader" />
  4498. .
  4499. </exception><exception cref="T:System.InvalidOperationException">
  4500. Calling
  4501. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4502. more than once for the same instance before task completion.
  4503. -or-
  4504. The
  4505. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4506. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4507. -or-
  4508. <see langword="Context Connection=true" />
  4509. is specified in the connection string.
  4510. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4511. SQL Server returned an error while executing the command text.
  4512. -or-
  4513. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4514. </exception><exception cref="T:System.IO.IOException">
  4515. An error occurred in a
  4516. <see cref="T:System.IO.Stream" />
  4517. ,
  4518. <see cref="T:System.Xml.XmlReader" />
  4519. or
  4520. <see cref="T:System.IO.TextReader" />
  4521. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4522. </exception><exception cref="T:System.ObjectDisposedException">
  4523. The
  4524. <see cref="T:System.IO.Stream" />
  4525. ,
  4526. <see cref="T:System.Xml.XmlReader" />
  4527. or
  4528. <see cref="T:System.IO.TextReader" />
  4529. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4530. </exception>
  4531. </member>
  4532. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Prepare">
  4533. <summary>
  4534. Creates a prepared version of the command on an instance of SQL Server.
  4535. </summary><remarks>
  4536. <format type="text/markdown"><![CDATA[
  4537. ## Remarks
  4538. If <xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A> is set to `StoredProcedure`, the call to <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> should succeed, although it may cause a no-op.
  4539. Before you call <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A>, specify the data type of each parameter in the statement to be prepared. For each parameter that has a variable length data type, you must set the <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> property to the maximum size needed. <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> returns an error if these conditions are not met.
  4540. > [!NOTE]
  4541. > If the database context is changed by executing the Transact-SQL `USE <database>` statement, or by calling the <xref:Microsoft.Data.SqlClient.SqlConnection.ChangeDatabase%2A> method, then <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> must be called a second time.
  4542. If you call an `Execute` method after calling <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A>, any parameter value that is larger than the value specified by the <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> property is automatically truncated to the original specified size of the parameter, and no truncation errors are returned.
  4543. Output parameters (whether prepared or not) must have a user-specified data type. If you specify a variable length data type, you must also specify the maximum <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A>.
  4544. Prior to Visual Studio 2010, <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> threw an exception. Beginning in Visual Studio 2010, this method does not throw an exception.
  4545. ## Examples
  4546. The following example demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> method.
  4547. [!code-csharp[SqlCommand.Prepare#1](~/../sqlclient/doc/samples/SqlCommand_Prepare.cs#1)]
  4548. ]]></format>
  4549. </remarks>
  4550. </member>
  4551. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Notification">
  4552. <summary>
  4553. Gets or sets a value that specifies the
  4554. <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" />
  4555. object bound to this command.
  4556. </summary><value>
  4557. When set to null (default), no notification should be requested.
  4558. </value><remarks>
  4559. <format type="text/markdown"><![CDATA[
  4560. ## Remarks
  4561. You must set the value for this property before the command is executed for it to take effect.
  4562. ]]></format>
  4563. </remarks>
  4564. </member>
  4565. <member name="P:Microsoft.Data.SqlClient.SqlCommand.NotificationAutoEnlist">
  4566. <summary>
  4567. Gets or sets a value indicating whether the application should automatically receive query notifications from a common
  4568. <see cref="T:Microsoft.Data.SqlClient.SqlDependency" />
  4569. object.
  4570. </summary><value>
  4571. <see langword="true" />
  4572. if the application should automatically receive query notifications; otherwise
  4573. <see langword="false" />
  4574. . The default value is
  4575. <see langword="true" />
  4576. .
  4577. </value><remarks>
  4578. <format type="text/markdown"><![CDATA[
  4579. ## Remarks
  4580. This feature is used in ASP.NET applications to receive notifications for all commands executed in an ASP page against SQL Server. This enables ASP.NET to cache the page until the queries used to render the page would produce a different result. Automatic enlistment.
  4581. This property applies only to versions of SQL Server that support query notifications. For earlier versions, setting this property to `true` has no effect on the application.
  4582. ]]></format>
  4583. </remarks>
  4584. </member>
  4585. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ResetCommandTimeout">
  4586. <summary> Resets the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" /> property to its default value.
  4587. </summary><remarks>
  4588. <format type="text/markdown"><![CDATA[
  4589. ## Remarks
  4590. The default value of the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> is 30 seconds.
  4591. ]]></format>
  4592. </remarks>
  4593. </member>
  4594. <member name="T:Microsoft.Data.SqlClient.SqlCommandBuilder">
  4595. <summary>
  4596. Automatically generates single-table commands that are used to reconcile changes made to a
  4597. <see cref="T:System.Data.DataSet" />
  4598. with the associated SQL Server database. This class cannot be inherited.
  4599. </summary><remarks>
  4600. <format type="text/markdown"><![CDATA[
  4601. ## Remarks
  4602. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter> does not automatically generate the Transact-SQL statements required to reconcile changes made to a <xref:System.Data.DataSet> with the associated instance of SQL Server. However, you can create a <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> object to automatically generate Transact-SQL statements for single-table updates if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property of the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>. Then, any additional Transact-SQL statements that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>.
  4603. The <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> registers itself as a listener for <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> events whenever you set the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.DataAdapter%2A> property. You can only associate one <xref:Microsoft.Data.SqlClient.SqlDataAdapter> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> object with each other at one time.
  4604. To generate INSERT, UPDATE, or DELETE statements, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> uses the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property to retrieve a required set of metadata automatically. If you change the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> after the metadata has been retrieved, such as after the first update, you should call the <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> method to update the metadata.
  4605. The `SelectCommand` must also return at least one primary key or unique column. If none are present, an **InvalidOperation** exception is generated, and the commands are not generated.
  4606. The <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> also uses the <xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>, <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>, and <xref:Microsoft.Data.SqlClient.SqlCommand.Transaction%2A> properties referenced by the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A>. The user should call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if one or more of these properties are modified, or if the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> itself is replaced. Otherwise the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A>, and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> properties retain their previous values.
  4607. If you call <xref:System.ComponentModel.Component.Dispose%2A>, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> is disassociated from the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>, and the generated commands are no longer used.
  4608. ## Examples
  4609. The following example uses the <xref:Microsoft.Data.SqlClient.SqlCommand>, along <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and <xref:Microsoft.Data.SqlClient.SqlConnection>, to select rows from a data source. The example is passed a connection string, a query string that is a Transact-SQL SELECT statement, and a string that is the name of the database table. The example then creates a <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>.
  4610. [!code-csharp[SqlCommandBuilder#1](~/../sqlclient/doc/samples/SqlCommandBuilder.cs#1)]
  4611. ]]></format>
  4612. </remarks>
  4613. </member>
  4614. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.#ctor">
  4615. <summary>
  4616. Initializes a new instance of the
  4617. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4618. class.
  4619. </summary><remarks>
  4620. To be added.
  4621. </remarks>
  4622. </member>
  4623. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.#ctor(Microsoft.Data.SqlClient.SqlDataAdapter)">
  4624. <param name="adapter">
  4625. The name of the
  4626. <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />
  4627. .
  4628. </param><summary>
  4629. Initializes a new instance of the
  4630. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4631. class with the associated
  4632. <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />
  4633. object.
  4634. </summary><remarks>
  4635. <format type="text/markdown"><![CDATA[
  4636. ## Remarks
  4637. The <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> registers itself as a listener for <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> events that are generated by the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> specified in this property.
  4638. When you create a new instance of <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>, any existing <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> associated with this <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is released.
  4639. ]]></format>
  4640. </remarks>
  4641. </member>
  4642. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.CatalogLocation">
  4643. <summary>
  4644. Sets or gets the
  4645. <see cref="T:System.Data.Common.CatalogLocation" />
  4646. for an instance of the
  4647. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4648. class.
  4649. </summary><value>
  4650. A
  4651. <see cref="T:System.Data.Common.CatalogLocation" />
  4652. object.
  4653. </value><remarks>
  4654. To be added.
  4655. </remarks>
  4656. </member>
  4657. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.CatalogSeparator">
  4658. <summary>
  4659. Sets or gets a string used as the catalog separator for an instance of the
  4660. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4661. class.
  4662. </summary><value>
  4663. A string that indicates the catalog separator for use with an instance of the
  4664. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4665. class.
  4666. </value><remarks>
  4667. To be added.
  4668. </remarks>
  4669. </member>
  4670. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.DataAdapter">
  4671. <summary>Gets or sets a <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> object for which Transact-SQL statements are automatically generated.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> object.</value><remarks>
  4672. <format type="text/markdown"><![CDATA[
  4673. ## Remarks
  4674. The <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> registers itself as a listener for <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> events that are generated by the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> specified in this property.
  4675. When you create a new instance of <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>, any existing <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> associated with this <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is released.
  4676. ]]></format>
  4677. </remarks>
  4678. </member>
  4679. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.DeriveParameters(Microsoft.Data.SqlClient.SqlCommand)">
  4680. <param name="command">The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> referencing the stored procedure from which the parameter information is to be derived. The derived parameters are added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection of the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />.</param><summary>Retrieves parameter information from the stored procedure specified in the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> and populates the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection of the specified <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object.</summary><remarks>
  4681. <format type="text/markdown"><![CDATA[
  4682. ## Remarks
  4683. `DeriveParameters` overwrites any existing parameter information for the `SqlDbCommand`.
  4684. `DeriveParameters` requires an additional call to the database to obtain the information. If the parameter information is known in advance, it is more efficient to populate the parameters collection by setting the information explicitly.
  4685. You can only use `DeriveParameters` with stored procedures. You cannot use `DeriveParameters` with extended stored procedures. You cannot use `DeriveParameters` to populate the <xref:Microsoft.Data.SqlClient.SqlParameterCollection> with arbitrary Transact-SQL statements, such as a parameterized SELECT statement.
  4686. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  4687. ]]></format>
  4688. </remarks><exception cref="T:System.InvalidOperationException">The command text is not a valid stored procedure name.</exception>
  4689. </member>
  4690. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.QuotePrefix">
  4691. <summary>Gets or sets the starting character or characters to use when specifying SQL Server database objects, such as tables or columns, whose names contain characters such as spaces or reserved tokens.</summary><value>The starting character or characters to use. The default is an empty string.</value><remarks>
  4692. <format type="text/markdown"><![CDATA[
  4693. ## Remarks
  4694. > [!NOTE]
  4695. > Although you cannot change the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.QuotePrefix%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteSuffix%2A> properties after an insert, update, or delete command has been generated, you can change their settings after calling the `Update` method of a DataAdapter.
  4696. ]]></format>
  4697. </remarks><exception cref="T:System.InvalidOperationException">This property cannot be changed after an INSERT, UPDATE, or DELETE command has been generated.</exception>
  4698. </member>
  4699. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteSuffix">
  4700. <summary>Gets or sets the ending character or characters to use when specifying SQL Server database objects, such as tables or columns, whose names contain characters such as spaces or reserved tokens.</summary><value>The ending character or characters to use. The default is an empty string.</value><remarks>
  4701. <format type="text/markdown"><![CDATA[
  4702. ## Remarks
  4703. > [!NOTE]
  4704. > Although you cannot change the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.QuotePrefix%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteSuffix%2A> properties after an insert, update, or delete operation has been generated, you can change their settings after calling the `Update` method of a DataAdapter.
  4705. ]]></format>
  4706. </remarks><exception cref="T:System.InvalidOperationException">This property cannot be changed after an insert, update, or delete command has been generated.</exception>
  4707. </member>
  4708. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.SchemaSeparator">
  4709. <summary>Gets or sets the character to be used for the separator between the schema identifier and any other identifiers.</summary><value>The character to be used as the schema separator.</value><remarks>
  4710. <format type="text/markdown"><![CDATA[
  4711. ## Remarks
  4712. Generally, database servers indicate the schema for a identifier by separating the schema name from the identifier with some character. For example, SQL Server uses a period, creating complete identifiers such as Person.CustomerName, where "Person" is the schema name and "CustomerName" is the identifier. Setting this property lets developers modify this behavior.
  4713. ]]></format>
  4714. </remarks>
  4715. </member>
  4716. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.ApplyParameterInfo(System.Data.Common.DbParameter,System.Data.DataRow,System.Data.StatementType,System.Boolean)">
  4717. <param name="parameter">
  4718. To be added.
  4719. </param><param name="datarow">
  4720. To be added.
  4721. </param><param name="statementType">
  4722. To be added.
  4723. </param><param name="whereClause">
  4724. To be added.
  4725. </param><summary>
  4726. To be added.
  4727. </summary><remarks>
  4728. To be added.
  4729. </remarks>
  4730. </member>
  4731. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand">
  4732. <summary>Gets the automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform deletions on the database.</summary><returns>The automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform deletions.</returns><remarks>
  4733. <format type="text/markdown"><![CDATA[
  4734. ## Remarks
  4735. An application can use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> method for informational or troubleshooting purposes because it returns the <xref:Microsoft.Data.SqlClient.SqlCommand> object to be executed.
  4736. You can also use <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> as the basis of a modified command. For example, you might call <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> and modify the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> value, and then explicitly set that on the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>.
  4737. After the SQL statement is first generated, the application must explicitly call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if it changes the statement in any way. Otherwise, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> will still be using information from the previous statement, which might not be correct. The SQL statements are first generated when the application calls either <xref:System.Data.Common.DbDataAdapter.Update%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A>.
  4738. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4739. ]]></format>
  4740. </remarks>
  4741. </member>
  4742. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand(System.Boolean)">
  4743. <param name="useColumnsForParameterNames">If <see langword="true" />, generate parameter names matching column names if possible. If <see langword="false" />, generate <c>@p1</c>, <c>@p2</c>, and so on.</param><summary>Gets the automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object that is required to perform deletions on the database.</summary><returns>The automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object that is required to perform deletions.</returns><remarks>
  4744. <format type="text/markdown"><![CDATA[
  4745. ## Remarks
  4746. An application can use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> method for informational or troubleshooting purposes because it returns the <xref:Microsoft.Data.SqlClient.SqlCommand> object to be executed.
  4747. You can also use <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> as the basis of a modified command. For example, you might call <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> and modify the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> value, and then explicitly set that on the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>.
  4748. After the SQL statement is first generated, the application must explicitly call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if it changes the statement in any way. Otherwise, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A> will still be using information from the previous statement, which might not be correct. The SQL statements are first generated when the application calls either <xref:System.Data.Common.DbDataAdapter.Update%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand%2A>.
  4749. The default behavior, when generating parameter names, is to use `@p1`, `@p2`, and so on for the various parameters. Passing `true` for the `useColumnsForParameterNames` parameter lets you force the <xref:System.Data.OleDb.OleDbCommandBuilder> to generate parameters based on the column names instead. This succeeds only if the following conditions are met:
  4750. - The <xref:System.Data.Common.DbMetaDataColumnNames.ParameterNameMaxLength> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection has been specified and its length is equal to or greater than the generated parameter name.
  4751. - The generated parameter name meets the criteria specified in the <xref:System.Data.Common.DbMetaDataColumnNames.ParameterNamePattern> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection regular expression.
  4752. - A <xref:System.Data.Common.DbMetaDataColumnNames.ParameterMarkerFormat> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection is specified.
  4753. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4754. ]]></format>
  4755. </remarks>
  4756. </member>
  4757. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand">
  4758. <summary>Gets the automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform insertions on the database.</summary><returns>The automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform insertions.</returns><remarks>
  4759. <format type="text/markdown"><![CDATA[
  4760. ## Remarks
  4761. An application can use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> method for informational or troubleshooting purposes because it returns the <xref:Microsoft.Data.SqlClient.SqlCommand> object to be executed.
  4762. You can also use <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> as the basis of a modified command. For example, you might call <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> and modify the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> value, and then explicitly set that on the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>.
  4763. After the Transact-SQL statement is first generated, the application must explicitly call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if it changes the statement in any way. Otherwise, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> will still be using information from the previous statement, which might not be correct. The Transact-SQL statements are first generated when the application calls either <xref:System.Data.Common.DbDataAdapter.Update%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A>.
  4764. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4765. ]]></format>
  4766. </remarks>
  4767. </member>
  4768. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand(System.Boolean)">
  4769. <param name="useColumnsForParameterNames">If <see langword="true" />, generate parameter names matching column names if possible. If <see langword="false" />, generate <c>@p1</c>, <c>@p2</c>, and so on.</param><summary>Gets the automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object that is required to perform insertions on the database.</summary><returns>The automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object that is required to perform insertions.</returns><remarks>
  4770. <format type="text/markdown"><![CDATA[
  4771. ## Remarks
  4772. An application can use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> method for informational or troubleshooting purposes because it returns the <xref:Microsoft.Data.SqlClient.SqlCommand> object to be executed.
  4773. You can also use <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> as the basis of a modified command. For example, you might call <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> and modify the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> value, and then explicitly set that on the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>.
  4774. After the Transact-SQL statement is first generated, the application must explicitly call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if it changes the statement in any way. Otherwise, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A> will still be using information from the previous statement, which might not be correct. The Transact-SQL statements are first generated when the application calls either <xref:System.Data.Common.DbDataAdapter.Update%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand%2A>.
  4775. The default behavior, when generating parameter names, is to use `@p1`, `@p2`, and so on for the various parameters. Passing `true` for the `useColumnsForParameterNames` parameter lets you force the <xref:System.Data.OleDb.OleDbCommandBuilder> to generate parameters based on the column names instead. This succeeds only if the following conditions are met:
  4776. - The <xref:System.Data.Common.DbMetaDataColumnNames.ParameterNameMaxLength> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection has been specified and its length is equal to or greater than the generated parameter name.
  4777. - The generated parameter name meets the criteria specified in the <xref:System.Data.Common.DbMetaDataColumnNames.ParameterNamePattern> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection regular expression.
  4778. - A <xref:System.Data.Common.DbMetaDataColumnNames.ParameterMarkerFormat> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection is specified.
  4779. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4780. ]]></format>
  4781. </remarks>
  4782. </member>
  4783. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterName(System.Int32)">
  4784. <param name="parameterOrdinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4785. </member>
  4786. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterName(System.String)">
  4787. <param name="parameterName">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4788. </member>
  4789. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterPlaceholder(System.Int32)">
  4790. <param name="parameterOrdinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4791. </member>
  4792. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetSchemaTable(System.Data.Common.DbCommand)">
  4793. <param name="srcCommand">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4794. </member>
  4795. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand">
  4796. <summary>Gets the automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform updates on the database.</summary><returns>The automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object that is required to perform updates.</returns><remarks>
  4797. <format type="text/markdown"><![CDATA[
  4798. ## Remarks
  4799. An application can use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> method for informational or troubleshooting purposes because it returns the <xref:Microsoft.Data.SqlClient.SqlCommand> object to be executed.
  4800. You can also use <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> as the basis of a modified command. For example, you might call <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> and modify the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> value, and then explicitly set that on the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>.
  4801. After the Transact-SQL statement is first generated, the application must explicitly call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if it changes the statement in any way. Otherwise, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> will still be using information from the previous statement, which might not be correct. The Transact-SQL statements are first generated when the application calls either <xref:System.Data.Common.DbDataAdapter.Update%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A>.
  4802. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4803. ]]></format>
  4804. </remarks>
  4805. </member>
  4806. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand(System.Boolean)">
  4807. <param name="useColumnsForParameterNames">If <see langword="true" />, generate parameter names matching column names if possible. If <see langword="false" />, generate <c>@p1</c>, <c>@p2</c>, and so on.</param><summary>Gets the automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform updates on the database.</summary><returns>The automatically generated <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object required to perform updates.</returns><remarks>
  4808. <format type="text/markdown"><![CDATA[
  4809. ## Remarks
  4810. An application can use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> method for informational or troubleshooting purposes because it returns the <xref:Microsoft.Data.SqlClient.SqlCommand> object to be executed.
  4811. You can also use <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> as the basis of a modified command. For example, you might call <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> and modify the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> value, and then explicitly set that on the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>.
  4812. After the Transact-SQL statement is first generated, the application must explicitly call <xref:System.Data.Common.DbCommandBuilder.RefreshSchema%2A> if it changes the statement in any way. Otherwise, the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A> will still be using information from the previous statement, which might not be correct. The Transact-SQL statements are first generated when the application calls either <xref:System.Data.Common.DbDataAdapter.Update%2A> or <xref:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand%2A>.
  4813. The default behavior, when generating parameter names, is to use `@p1`, `@p2`, and so on for the various parameters. Passing `true` for the `useColumnsForParameterNames` parameter lets you force the <xref:System.Data.OleDb.OleDbCommandBuilder> to generate parameters based on the column names instead. This succeeds only if the following conditions are met:
  4814. - The <xref:System.Data.Common.DbMetaDataColumnNames.ParameterNameMaxLength> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection has been specified and its length is equal to or greater than the generated parameter name.
  4815. - The generated parameter name meets the criteria specified in the <xref:System.Data.Common.DbMetaDataColumnNames.ParameterNamePattern> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection regular expression.
  4816. - A <xref:System.Data.Common.DbMetaDataColumnNames.ParameterMarkerFormat> returned from the **GetSchema** method call and found in the <xref:System.Data.Common.DbMetaDataCollectionNames.DataSourceInformation> collection is specified.
  4817. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4818. ]]></format>
  4819. </remarks>
  4820. </member>
  4821. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.InitializeCommand(System.Data.Common.DbCommand)">
  4822. <param name="command">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4823. </member>
  4824. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteIdentifier(System.String)">
  4825. <param name="unquotedIdentifier">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4826. </member>
  4827. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.SetRowUpdatingHandler(System.Data.Common.DbDataAdapter)">
  4828. <param name="adapter">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  4829. </member>
  4830. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.UnquoteIdentifier(System.String)">
  4831. <param name="quotedIdentifier">The identifier that will have its embedded quotes removed.</param><summary>Given a quoted identifier, returns the correct unquoted form of that identifier. This includes correctly unescaping any embedded quotes in the identifier.</summary><returns>The unquoted identifier, with embedded quotes properly unescaped.</returns><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/retrieving-and-modifying-data.md">Connecting and Retrieving Data in ADO.NET</related><related type="Article" href="~/docs/framework/data/adonet/sql/index.md">Using the .NET Framework Data Provider for SQL Server</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  4832. </member>
  4833. <member name="T:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting">
  4834. <summary>Note that these settings cannot be used to bypass encryption and gain access to plaintext data. For details, see <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted (Database Engine)</see>.
  4835. </summary><remarks>
  4836. <format type="text/markdown"><![CDATA[
  4837. ## Remarks
  4838. - If Always Encrypted is disabled for a query and the query has parameters that need to be encrypted (parameters that correspond to encrypted columns), the query will fail.
  4839. - If Always Encrypted is disabled for a query and the query returns results from encrypted columns, the query will return encrypted values. The encrypted values will have the varbinary datatype.
  4840. ]]></format>
  4841. </remarks>
  4842. </member>
  4843. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.Disabled">
  4844. <summary>Specifies the connection does not use Always Encrypted. Should be used if no queries sent over the connection access encrypted columns.</summary>
  4845. </member>
  4846. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.Enabled">
  4847. <summary>Enables Always Encrypted for the query.</summary>
  4848. </member>
  4849. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.ResultSetOnly">
  4850. <summary>Specifies that only the results of the command should be processed by the Always Encrypted routine in the driver. Use this value when the command has no parameters that require encryption.</summary>
  4851. </member>
  4852. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.UseConnectionSetting">
  4853. <summary>Specifies that the command should default to the Always Encrypted setting in the connection string.</summary>
  4854. </member>
  4855. <member name="T:Microsoft.Data.SqlClient.SqlConnection">
  4856. <summary>Represents a connection to a SQL Server database. This class cannot be inherited.</summary><remarks>
  4857. <format type="text/markdown"><![CDATA[
  4858. ## Remarks
  4859. A <xref:Microsoft.Data.SqlClient.SqlConnection> object represents a unique session to a SQL Server data source. With a client/server database system, it is equivalent to a network connection to the server. <xref:Microsoft.Data.SqlClient.SqlConnection> is used together with <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and <xref:Microsoft.Data.SqlClient.SqlCommand> to increase performance when connecting to a Microsoft SQL Server database. For all third-party SQL Server products and other OLE DB-supported data sources, use <xref:System.Data.OleDb.OleDbConnection>.
  4860. When you create an instance of <xref:Microsoft.Data.SqlClient.SqlConnection>, all properties are set to their initial values. For a list of these values, see the <xref:Microsoft.Data.SqlClient.SqlConnection> constructor.
  4861. See <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> for a list of the keywords in a connection string.
  4862. If the <xref:Microsoft.Data.SqlClient.SqlConnection> goes out of scope, it won't be closed. Therefore, you must explicitly close the connection by calling `Close` or `Dispose`. `Close` and `Dispose` are functionally equivalent. If the connection pooling value `Pooling` is set to `true` or `yes`, the underlying connection is returned back to the connection pool. On the other hand, if `Pooling` is set to `false` or `no`, the underlying connection to the server is actually closed.
  4863. > [!NOTE]
  4864. > Login and logout events will not be raised on the server when a connection is fetched from or returned to the connection pool, because the connection is not actually closed when it is returned to the connection pool. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  4865. To ensure that connections are always closed, open the connection inside of a `using` block, as shown in the following code fragment. Doing so ensures that the connection is automatically closed when the code exits the block.
  4866. ```vb
  4867. Using connection As New SqlConnection(connectionString)
  4868. connection.Open()
  4869. ' Do work here; connection closed on following line.
  4870. End Using
  4871. ```
  4872. ```csharp
  4873. using (SqlConnection connection = new SqlConnection(connectionString))
  4874. {
  4875. connection.Open();
  4876. // Do work here; connection closed on following line.
  4877. }
  4878. ```
  4879. > [!NOTE]
  4880. > To deploy high-performance applications, you must use connection pooling. When you use the .NET Framework Data Provider for SQL Server, you do not have to enable connection pooling because the provider manages this automatically, although you can modify some settings. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  4881. If a <xref:Microsoft.Data.SqlClient.SqlException> is generated by the method executing a <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlConnection> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the <xref:Microsoft.Data.SqlClient.SqlConnection>. However, the user can reopen the connection and continue.
  4882. An application that creates an instance of the <xref:Microsoft.Data.SqlClient.SqlConnection> object can require all direct and indirect callers to have sufficient permission to the code by setting declarative or imperative security demands. <xref:Microsoft.Data.SqlClient.SqlConnection> makes security demands using the <xref:Microsoft.Data.SqlClient.SqlClientPermission> object. Users can verify that their code has sufficient permissions by using the <xref:Microsoft.Data.SqlClient.SqlClientPermissionAttribute> object. Users and administrators can also use the [Caspol.exe (Code Access Security Policy Tool)](~/docs/framework/tools/caspol-exe-code-access-security-policy-tool.md) to modify security policy at the machine, user, and enterprise levels. For more information, see [Security in .NET](~/docs/standard/security/index.md). For an example demonstrating how to use security demands, see [Code Access Security and ADO.NET](~/docs/framework/data/adonet/code-access-security.md).
  4883. For more information about handling warning and informational messages from the server, see [Connection Events](~/docs/framework/data/adonet/connection-events.md). For more information about SQL Server engine errors and error messages, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  4884. > [!CAUTION]
  4885. > You can force TCP instead of shared memory. You can do that by prefixing tcp: to the server name in the connection string or you can use localhost.
  4886. ## Examples
  4887. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and a <xref:Microsoft.Data.SqlClient.SqlConnection>. The <xref:Microsoft.Data.SqlClient.SqlConnection> is opened and set as the <xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A> for the <xref:Microsoft.Data.SqlClient.SqlCommand>. The example then calls <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>. To accomplish this, the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> is passed a connection string and a query string that is a Transact-SQL INSERT statement. The connection is closed automatically when the code exits the using block.
  4888. [!code-csharp[SqlCommand_ExecuteNonQuery Example#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs#1)]
  4889. ]]></format>
  4890. </remarks>
  4891. </member>
  4892. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor">
  4893. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> class.</summary><remarks>
  4894. <format type="text/markdown"><![CDATA[
  4895. ## Remarks
  4896. When a new instance of <xref:Microsoft.Data.SqlClient.SqlConnection> is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property.
  4897. |Properties|Initial value|
  4898. |----------------|-------------------|
  4899. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>|empty string ("")|
  4900. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A>|15|
  4901. |<xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A>|empty string ("")|
  4902. |<xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A>|empty string ("")|
  4903. You can change the value for these properties only by using the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property. The <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class provides functionality for creating and managing the contents of connection strings.
  4904. ## Examples
  4905. The following example creates and opens a <xref:Microsoft.Data.SqlClient.SqlConnection>.
  4906. [!code-csharp[SqlConnection_SqlConnection Example#1](~/../sqlclient/doc/samples/SqlConnection_SqlConnection.cs#1)]
  4907. ]]></format>
  4908. </remarks>
  4909. </member>
  4910. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String)">
  4911. <param name="connectionString">The connection used to open the SQL Server database.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> class when given a string that contains the connection string.</summary><remarks>
  4912. <format type="text/markdown"><![CDATA[
  4913. ## Remarks
  4914. When a new instance of <xref:Microsoft.Data.SqlClient.SqlConnection> is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property.
  4915. |Properties|Initial value|
  4916. |----------------|-------------------|
  4917. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>|`connectionString`|
  4918. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A>|15|
  4919. |<xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A>|empty string ("")|
  4920. |<xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A>|empty string ("")|
  4921. You can change the value for these properties only by using the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property. The <xref:Microsoft.Data.SqlClient.SqlConnection> class provides functionality for creating and managing the contents of connection strings.
  4922. ## Examples
  4923. The following example creates and opens a <xref:Microsoft.Data.SqlClient.SqlConnection>.
  4924. [!code-csharp[SqlConnection_SqlConnection1 Example#1](~/../sqlclient/doc/samples/SqlConnection_SqlConnection1.cs#1)]
  4925. ]]></format>
  4926. </remarks>
  4927. </member>
  4928. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String,Microsoft.Data.SqlClient.SqlCredential)">
  4929. <param name="connectionString">A connection string that does not use any of the following connection string keywords: <see langword="Integrated Security = true" />, <see langword="UserId" />, or <see langword="Password" />; or that does not use <see langword="ContextConnection = true" />.</param><param name="credential">A <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object. If <paramref name="credential" /> is null, <see cref="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String,Microsoft.Data.SqlClient.SqlCredential)" /> is functionally equivalent to <see cref="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String)" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> class given a connection string, that does not use <see langword="Integrated Security = true" /> and a <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object that contains the user ID and password.</summary><remarks>To be added.</remarks>
  4930. </member>
  4931. <member name="P:Microsoft.Data.SqlClient.SqlConnection.AccessToken">
  4932. <summary>Gets or sets the access token for the connection.</summary><value>The access token for the connection.</value><remarks>To be added.</remarks>
  4933. </member>
  4934. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ClientConnectionId">
  4935. <summary>The connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or failed.</summary><value>The connection ID of the most recent connection attempt.</value><remarks>
  4936. <format type="text/markdown"><![CDATA[
  4937. ## Remarks
  4938. <xref:Microsoft.Data.SqlClient.SqlConnection.ClientConnectionId%2A> works regardless of which version of the server you connect to, but extended events logs and entry on connectivity ring buffer errors will not be present in SQL Server 2008 R2 and earlier.
  4939. You can locate the connection ID in the extended events log to see if the failure was on the server if the extended event for logging connection ID is enabled. You can also locate the connection ID in the connection ring buffer ([Connectivity troubleshooting in SQL Server 2008 with the Connectivity Ring Buffer](https://go.microsoft.com/fwlink/?LinkId=207752)) for certain connection errors. If the connection ID is not in the connection ring buffer, you can assume a network error.
  4940. ]]></format>
  4941. </remarks>
  4942. </member>
  4943. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ColumnEncryptionKeyCacheTtl">
  4944. <summary>Gets or sets the time-to-live for column encryption key entries in the column encryption key cache for the <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see> feature. The default value is 2 hours. 0 means no caching at all.</summary><value>The time interval.</value><remarks>To be added.</remarks>
  4945. </member>
  4946. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ColumnEncryptionQueryMetadataCacheEnabled">
  4947. <summary>Gets or sets a value that indicates whether query metadata caching is enabled (true) or not (false) for parameterized queries running against <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see> enabled databases. The default value is true.</summary><value>Returns true if query metadata caching is enabled; otherwise false. true is the default.</value><remarks>
  4948. <format type="text/markdown"><![CDATA[
  4949. ## Remarks
  4950. For parameterized queries, SqlClient makes a roundtrip to SQL Server for parameter metadata, to see which parameter it needs to encrypt and how (which keys and algorithms should be used). If the application calls the same query multiple times, an extra roundtrip is made to the server each time, which degrades application performance.
  4951. With **ColumnEncryptionQueryMetadataCacheEnabled** set to true, if the same query is called multiple times, the roundtrip to the server will be made only once. The cache has a non-configurable Max size parameter that is set to 2000 queries.
  4952. ]]></format>
  4953. </remarks>
  4954. </member>
  4955. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ColumnEncryptionTrustedMasterKeyPaths">
  4956. <summary>Allows you to set a list of trusted key paths for a database server. If while processing an application query the driver receives a key path that is not on the list, the query will fail. This property provides additional protection against security attacks that involve a compromised SQL Server providing fake key paths, which may lead to leaking key store credentials.</summary><value>The list of trusted master key paths for the column encryption.</value><remarks>To be added.</remarks>
  4957. </member>
  4958. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString">
  4959. <summary>Gets or sets the string used to open a SQL Server database.</summary><value>The connection string that includes the source database name, and other parameters needed to establish the initial connection. The default value is an empty string.</value><remarks>
  4960. <format type="text/markdown"><![CDATA[
  4961. ## Remarks
  4962. The <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> is similar to an OLE DB connection string, but is not identical. Unlike OLE DB or ADO, the connection string that is returned is the same as the user-set <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>, minus security information if the Persist Security Info value is set to `false` (default). The .NET Framework Data Provider for SQL Server does not persist or return the password in a connection string unless you set Persist Security Info to `true`.
  4963. You can use the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property to connect to a database. The following example illustrates a typical connection string.
  4964. ```
  4965. "Persist Security Info=False;Integrated Security=true;Initial Catalog=Northwind;server=(local)"
  4966. ```
  4967. Use the new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> to construct valid connection strings at run time. For more information, see [Connection String Builders](~/docs/framework/data/adonet/connection-string-builders.md).
  4968. The <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property can be set only when the connection is closed. Many of the connection string values have corresponding read-only properties. When the connection string is set, these properties are updated, except when an error is detected. In this case, none of the properties are updated. <xref:Microsoft.Data.SqlClient.SqlConnection> properties return only those settings that are contained in the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
  4969. To connect to a local computer, specify "(local)" for the server. If a server name is not specified, a connection will be attempted to the default instance on the local computer.
  4970. Resetting the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> on a closed connection resets all connection string values (and related properties) including the password. For example, if you set a connection string that includes "Database= AdventureWorks", and then reset the connection string to "Data Source=myserver;Integrated Security=true", the <xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A> property is no longer set to "AdventureWorks".
  4971. The connection string is parsed immediately after being set. If errors in syntax are found when parsing, a runtime exception, such as <xref:System.ArgumentException>, is generated. Other errors can be found only when an attempt is made to open the connection.
  4972. The basic format of a connection string includes a series of keyword/value pairs separated by semicolons. The equal sign (=) connects each keyword and its value. To include values that contain a semicolon, single-quote character, or double-quote character, the value must be enclosed in double quotation marks. If the value contains both a semicolon and a double-quote character, the value can be enclosed in single quotation marks. The single quotation mark is also useful if the value starts with a double-quote character. Conversely, the double quotation mark can be used if the value starts with a single quotation mark. If the value contains both single-quote and double-quote characters, the quotation mark character used to enclose the value must be doubled every time it occurs within the value.
  4973. To include preceding or trailing spaces in the string value, the value must be enclosed in either single quotation marks or double quotation marks. Any leading or trailing spaces around integer, Boolean, or enumerated values are ignored, even if enclosed in quotation marks. However, spaces within a string literal keyword or value are preserved. Single or double quotation marks may be used within a connection string without using delimiters (for example, Data Source= my'Server or Data Source= my"Server), unless a quotation mark character is the first or last character in the value.
  4974. Keywords are not case sensitive.
  4975. The following table lists the valid names for keyword values within the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
  4976. |Keyword|Default|Description|
  4977. |-------------|-------------|-----------------|
  4978. |Addr|N/A|Synonym of **Data Source**.|
  4979. |Address|N/A|Synonym of **Data Source**.|
  4980. |App|N/A|Synonym of **Application Name**.|
  4981. |Application Name|N/A|The name of the application, or '.NET SQLClient Data Provider' if no application name is provided.<br /><br /> An application name can be 128 characters or less.|
  4982. |ApplicationIntent|ReadWrite|Declares the application workload type when connecting to a server. Possible values are `ReadOnly` and `ReadWrite`. For example:<br /><br /> `ApplicationIntent=ReadOnly`<br /><br /> For more information about SqlClient support for Always On Availability Groups, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).|
  4983. |Asynchronous Processing<br /><br /> -or-<br /><br /> Async|'false'|When `true`, enables asynchronous operation support. Recognized values are `true`, `false`, `yes`, and `no`.<br /><br /> This property is ignored beginning in .NET Framework 4.5. For more information about SqlClient support for asynchronous programming, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).|
  4984. |AttachDBFilename<br /><br /> -or-<br /><br /> Extended Properties<br /><br /> -or-<br /><br /> Initial File Name|N/A|The name of the primary database file, including the full path name of an attachable database. AttachDBFilename is only supported for primary data files with an .mdf extension.<br /><br /> If the value of the AttachDBFileName key is specified in the connection string, the database is attached and becomes the default database for the connection.<br /><br /> If this key is not specified and if the database was previously attached, the database will not be reattached. The previously attached database will be used as the default database for the connection.<br /><br /> If this key is specified together with the AttachDBFileName key, the value of this key will be used as the alias. However, if the name is already used in another attached database, the connection will fail.<br /><br /> The path may be absolute or relative by using the DataDirectory substitution string. If DataDirectory is used, the database file must exist within a subdirectory of the directory pointed to by the substitution string. **Note:** Remote server, HTTP, and UNC path names are not supported. <br /><br /> The database name must be specified with the keyword 'database' (or one of its aliases) as in the following:<br /><br /> <code>"AttachDbFileName=&#124;DataDirectory&#124;\data\YourDB.mdf;integrated security=true;database=YourDatabase"</code><br /><br /> An error will be generated if a log file exists in the same directory as the data file and the 'database' keyword is used when attaching the primary data file. In this case, remove the log file. Once the database is attached, a new log file will be automatically generated based on the physical path.|
  4985. |Authentication|N/A|The authentication method used for [Connecting to SQL Database By Using Azure Active Directory Authentication](https://azure.microsoft.com/documentation/articles/sql-database-aad-authentication/#7-connect-to-your-database-by-using-azure-active-directory-identities).<br /><br /> Valid values are:<br /><br /> `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Password`, `Sql Password`. Currently `Active Directory Integrated` and `Active Directory Interactive` modes of authentication are only supported for .NET Framework. |
  4986. |Column Encryption Setting|N/A|Enables or disables [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine?view=sql-server-2017) functionality for the connection.|
  4987. |Connect Timeout<br /><br /> -or-<br /><br /> Connection Timeout<br /><br /> -or-<br /><br /> Timeout|15|The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.<br /><br /> Valid values are greater than or equal to 0 and less than or equal to 2147483647.<br /><br /> When opening a connection to a Azure SQL Database, set the connection timeout to 30 seconds.|
  4988. |Connection Lifetime<br /><br /> -or-<br /><br /> Load Balance Timeout|0|When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by `Connection Lifetime`. This is useful in clustered configurations to force load balancing between a running server and a server just brought online.<br /><br /> A value of zero (0) causes pooled connections to have the maximum connection timeout.|
  4989. |ConnectRetryCount|1|Controls the number of reconnection attempts after the client identifies an idle connection failure. Valid values are 0 to 255. The default is 1. 0 means do not attempt to reconnect (disable connection resiliency).<br /><br /> For additional information about idle connection resiliency, see [Technical Article - Idle Connection Resiliency](https://go.microsoft.com/fwlink/?LinkId=393996).|
  4990. |ConnectRetryInterval|10|Specifies the time between each connection retry attempt (ConnectRetryCount). Valid values are 1 to 60 seconds (default=10), applied after the first reconnection attempt. When a broken connection is detected, the client immediately attempts to reconnect; this is the first reconnection attempt and only occurs if ConnectRetryCount is greater than 0. If the first reconnection attempt fails and ConnectRetryCount is greater than 1, the client waits ConnectRetryInterval to try the second and subsequent reconnection attempts.<br /><br /> For additional information about idle connection resiliency, see [Technical Article - Idle Connection Resiliency](https://go.microsoft.com/fwlink/?LinkId=393996).|
  4991. |Context Connection|'false'|`true` if an in-process connection to SQL Server should be made.|
  4992. |Current Language<br /><br /> -or-<br /><br /> Language|N/A|Sets the language used for database server warning or error messages.<br /><br /> The language name can be 128 characters or less.|
  4993. |Data Source<br /><br /> -or-<br /><br /> Server<br /><br /> -or-<br /><br /> Address<br /><br /> -or-<br /><br /> Addr<br /><br /> -or-<br /><br /> Network Address|N/A|The name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name:<br /><br /> `server=tcp:servername, portnumber`<br /><br /> When specifying a local instance, always use (local). To force a protocol, add one of the following prefixes:<br /><br /> `np:(local), tcp:(local), lpc:(local)`<br /><br /> Beginning in .NET Framework 4.5, you can also connect to a LocalDB database as follows:<br /><br /> `server=(localdb)\\myInstance`<br /><br /> For more information about LocalDB, see [SqlClient Support for LocalDB](~/docs/framework/data/adonet/sql/sqlclient-support-for-localdb.md).<br /><br /> **Data Source** must use the TCP format or the Named Pipes format.<br /><br /> TCP format is as follows:<br /><br /> - tcp:\<host name>\\<instance name\><br />- tcp:\<host name>,\<TCP/IP port number><br /><br /> The TCP format must start with the prefix "tcp:" and is followed by the database instance, as specified by a host name and an instance name. This format is not applicable when connecting to Azure SQL Database. TCP is automatically selected for connections to Azure SQL Database when no protocol is specified.<br /><br /> The host name MUST be specified in one of the following ways:<br /><br /> - NetBIOSName<br />- IPv4Address<br />- IPv6Address<br /><br /> The instance name is used to resolve to a particular TCP/IP port number on which a database instance is hosted. Alternatively, specifying a TCP/IP port number directly is also allowed. If both instance name and port number are not present, the default database instance is used.<br /><br /> The Named Pipes format is as follows:<br /><br /> - np:\\\\<host name\>\pipe\\<pipe name\><br /><br /> The Named Pipes format MUST start with the prefix "np:" and is followed by a named pipe name.<br /><br /> The host name MUST be specified in one of the following ways:<br /><br /> - NetBIOSName<br />- IPv4Address<br />- IPv6Address<br /><br /> The pipe name is used to identify the database instance to which the .NET Framework application will be connected.<br /><br /> If the value of the **Network** key is specified, the prefixes "tcp:" and "np:" should not be specified. **Note:** You can force the use of TCP instead of shared memory, either by prefixing **tcp:** to the server name in the connection string, or by using **localhost**.|
  4994. |Encrypt|'false'|When `true`, SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](~/docs/framework/data/adonet/connection-string-syntax.md).<br /><br /> Beginning in .NET Framework 4.5, when `TrustServerCertificate` is false and `Encrypt` is true, the server name (or IP address) in a SQL Server SSL certificate must exactly match the server name (or IP address) specified in the connection string. Otherwise, the connection attempt will fail. For information about support for certificates whose subject starts with a wildcard character (*), see [Accepted wildcards used by server certificates for server authentication](https://support.microsoft.com/kb/258858).|
  4995. |Enlist|'true'|`true` indicates that the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.|
  4996. |Failover Partner|N/A|The name of the failover partner server where database mirroring is configured.<br /><br /> If the value of this key is "", then **Initial Catalog** must be present, and its value must not be "".<br /><br /> The server name can be 128 characters or less.<br /><br /> If you specify a failover partner but the failover partner server is not configured for database mirroring and the primary server (specified with the Server keyword) is not available, then the connection will fail.<br /><br /> If you specify a failover partner and the primary server is not configured for database mirroring, the connection to the primary server (specified with the Server keyword) will succeed if the primary server is available.|
  4997. |Initial Catalog<br /><br /> -or-<br /><br /> Database|N/A|The name of the database.<br /><br /> The database name can be 128 characters or less.|
  4998. |Integrated Security<br /><br /> -or-<br /><br /> Trusted_Connection|'false'|When `false`, User ID and Password are specified in the connection. When `true`, the current Windows account credentials are used for authentication.<br /><br /> Recognized values are `true`, `false`, `yes`, `no`, and `sspi` (strongly recommended), which is equivalent to `true`.<br /><br /> If User ID and Password are specified and Integrated Security is set to true, the User ID and Password will be ignored and Integrated Security will be used.<br /><br /> <xref:Microsoft.Data.SqlClient.SqlCredential> is a more secure way to specify credentials for a connection that uses SQL Server Authentication (`Integrated Security=false`).|
  4999. |Max Pool Size|100|The maximum number of connections that are allowed in the pool.<br /><br /> Valid values are greater than or equal to 1. Values that are less than **Min Pool Size** generate an error.|
  5000. |Min Pool Size|0|The minimum number of connections that are allowed in the pool.<br /><br /> Valid values are greater than or equal to 0. Zero (0) in this field means no minimum connections are initially opened.<br /><br /> Values that are greater than **Max Pool Size** generate an error.|
  5001. |MultipleActiveResultSets|'false'|When `true`, an application can maintain multiple active result sets (MARS). When `false`, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.<br /><br /> Recognized values are `true` and `false`.<br /><br /> For more information, see [Multiple Active Result Sets (MARS)](~/docs/framework/data/adonet/sql/multiple-active-result-sets-mars.md).|
  5002. |`MultiSubnetFailover`|FALSE|Always specify `multiSubnetFailover=True` when connecting to the availability group listener of a SQL Server 2012 (or later) availability group or a SQL Server 2012 (or later) Failover Cluster Instance. `multiSubnetFailover=True` configures SqlClient to provide faster detection of and connection to the (currently) active server. Possible values are `Yes` and `No`, `True` and `False` or `1` and `0`. For example:<br /><br /> `MultiSubnetFailover=True`<br /><br /> The default is `False`. For more information about SqlClient's support for Always On AGs, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).|
  5003. |Network Library<br /><br /> -or-<br /><br /> Network<br /><br /> -or-<br /><br /> Net|N/A|The network library used to establish a connection to an instance of SQL Server. Supported values include:<br /><br /> dbnmpntw (Named Pipes)<br /><br /> dbmsrpcn (Multiprotocol, Windows RPC)<br /><br /> dbmsadsn (Apple Talk)<br /><br /> dbmsgnet (VIA)<br /><br /> dbmslpcn (Shared Memory)<br /><br /> dbmsspxn (IPX/SPX)<br /><br /> dbmssocn (TCP/IP)<br /><br /> Dbmsvinn (Banyan Vines)<br /><br /> The corresponding network DLL must be installed on the system to which you connect. If you do not specify a network and you use a local server (for example, "." or "(local)"), shared memory is used. In this example, the network library is Win32 Winsock TCP/IP (dbmssocn), and 1433 is the port being used.<br /><br /> `Network Library=dbmssocn;Data Source=000.000.000.000,1433;`|
  5004. |Packet Size|8000|Size in bytes of the network packets used to communicate with an instance of SQL Server.<br /><br /> The packet size can be greater than or equal to 512 and less than or equal to 32768.|
  5005. |Password<br /><br /> -or-<br /><br /> PWD|N/A|The password for the SQL Server account logging on. Not recommended. To maintain a high level of security, we strongly recommend that you use the `Integrated Security` or `Trusted_Connection` keyword instead. <xref:Microsoft.Data.SqlClient.SqlCredential> is a more secure way to specify credentials for a connection that uses SQL Server Authentication.<br /><br /> The password must be 128 characters or less.|
  5006. |Persist Security Info<br /><br /> -or-<br /><br /> PersistSecurityInfo|'false'|When set to `false` or `no` (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password. Recognized values are `true`, `false`, `yes`, and `no`.|
  5007. |PoolBlockingPeriod|Auto|Sets the blocking period behavior for a connection pool. See <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod> property for details.|
  5008. |Pooling|'true'|When the value of this key is set to true, any newly created connection will be added to the pool when closed by the application. In a next attempt to open the same connection, that connection will be drawn from the pool.<br /><br /> Connections are considered the same if they have the same connection string. Different connections have different connection strings.<br /><br /> The value of this key can be "true", "false", "yes", or "no".|
  5009. |Replication|'false'|`true` if replication is supported using the connection.|
  5010. |Transaction Binding|Implicit Unbind|Controls connection association with an enlisted `System.Transactions` transaction.<br /><br /> Possible values are:<br /><br /> `Transaction Binding=Implicit Unbind;`<br /><br /> `Transaction Binding=Explicit Unbind;`<br /><br /> Implicit Unbind causes the connection to detach from the transaction when it ends. After detaching, additional requests on the connection are performed in autocommit mode. The `System.Transactions.Transaction.Current` property is not checked when executing requests while the transaction is active. After the transaction has ended, additional requests are performed in autocommit mode.<br /><br /> If the system ends the transaction (in the scope of a using block) before the last command completes, it will throw <xref:System.InvalidOperationException>.<br /><br /> Explicit Unbind causes the connection to remain attached to the transaction until the connection is closed or an explicit `SqlConnection.TransactionEnlist(null)` is called. Beginning in .NET Framework 4.0, changes to Implicit Unbind make Explicit Unbind obsolete. An `InvalidOperationException` is thrown if `Transaction.Current` is not the enlisted transaction or if the enlisted transaction is not active.|
  5011. |TransparentNetworkIPResolution|See description.|When the value of this key is set to `true`, the application is required to retrieve all IP addresses for a particular DNS entry and attempt to connect with the first one in the list. If the connection is not established within 0.5 seconds, the application will try to connect to all others in parallel. When the first answers, the application will establish the connection with the respondent IP address.<br /><br /> If the `MultiSubnetFailover` key is set to `true`, `TransparentNetworkIPResolution` is ignored.<br /><br /> If the `Failover Partner` key is set, `TransparentNetworkIPResolution` is ignored.<br /><br /> The value of this key must be `true`, `false`, `yes`, or `no`.<br /><br /> A value of `yes` is treated the same as a value of `true`.<br /><br /> A value of `no` is treated the same as a value of `false`.<br /><br /> The default values are as follows:<br /><br /> <ul><li>`false` when:<br /><br /> <ul><li>Connecting to Azure SQL Database where the data source ends with:<br /><br /> <ul><li>.database.chinacloudapi.cn</li><li>.database.usgovcloudapi.net</li><li>.database.cloudapi.de</li><li>.database.windows.net</li></ul></li><li>`Authentication` is 'Active Directory Password' or 'Active Directory Integrated'</li></ul></li><li>`true` in all other cases.</li></ul>|
  5012. |TrustServerCertificate|'false'|When set to `true`, SSL is used to encrypt the channel when bypassing walking the certificate chain to validate trust. If TrustServerCertificate is set to `true` and Encrypt is set to `false`, the channel is not encrypted. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](~/docs/framework/data/adonet/connection-string-syntax.md).|
  5013. |Type System Version|N/A|A string value that indicates the type system the application expects. The functionality available to a client application is dependent on the version of SQL Server and the compatibility level of the database. Explicitly setting the type system version that the client application was written for avoids potential problems that could cause an application to break if a different version of SQL Server is used. **Note:** The type system version cannot be set for common language runtime (CLR) code executing in-process in SQL Server. For more information, see [SQL Server Common Language Runtime Integration](~/docs/framework/data/adonet/sql/sql-server-common-language-runtime-integration.md). <br /><br /> Possible values are:<br /><br /> `Type System Version=SQL Server 2012;`<br /><br /> `Type System Version=SQL Server 2008;`<br /><br /> `Type System Version=SQL Server 2005;`<br /><br /> `Type System Version=Latest;`<br /><br /> `Type System Version=SQL Server 2012;` specifies that the application will require version 11.0.0.0 of Microsoft.SqlServer.Types.dll. The other `Type System Version` settings will require version 10.0.0.0 of Microsoft.SqlServer.Types.dll.<br /><br /> `Latest` is obsolete and should not be used. `Latest` is equivalent to `Type System Version=SQL Server 2008;`.|
  5014. |User ID<br /><br /> -or-<br /><br /> UID<br /><br /> -or-|N/A|The SQL Server login account. Not recommended. To maintain a high level of security, we strongly recommend that you use the `Integrated Security` or `Trusted_Connection` keywords instead. <xref:Microsoft.Data.SqlClient.SqlCredential> is a more secure way to specify credentials for a connection that uses SQL Server Authentication.<br /><br /> The user ID must be 128 characters or less.|
  5015. |User Instance|'false'|A value that indicates whether to redirect the connection from the default SQL Server Express instance to a runtime-initiated instance running under the account of the caller.|
  5016. |Workstation ID<br /><br /> -or-<br /><br /> WSID|The local computer name|The name of the workstation connecting to SQL Server.<br /><br /> The ID must be 128 characters or less.|
  5017. The following list contains the valid names for connection pooling values within the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  5018. - Connection Lifetime (or Load Balance Timeout)
  5019. - Enlist
  5020. - Max Pool Size
  5021. - Min Pool Size
  5022. - Pooling
  5023. When you are setting keyword or connection pooling values that require a Boolean value, you can use 'yes' instead of 'true', and 'no' instead of 'false'. Integer values are represented as strings.
  5024. > [!NOTE]
  5025. > The .NET Framework Data Provider for SQL Server uses its own protocol to communicate with SQL Server. Therefore, it does not support the use of an ODBC data source name (DSN) when connecting to SQL Server because it does not add an ODBC layer.
  5026. > [!NOTE]
  5027. > Universal data link (UDL) files are not supported for the .NET Framework Data Provider for SQL Server.
  5028. > [!CAUTION]
  5029. > In this release, the application should use caution when constructing a connection string based on user input (for example when retrieving user ID and password information from a dialog box, and appending it to the connection string). The application should make sure that a user cannot embed additional connection string parameters in these values (for example, entering a password as "validpassword;database=somedb" in an attempt to attach to a different database). If you need to construct connection strings based on user input, use the new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>, which validates the connection string and helps to eliminate this problem. See [Connection String Builders](~/docs/framework/data/adonet/connection-string-builders.md) for more information.
  5030. ## Examples
  5031. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and sets the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property before opening the connection.
  5032. [!code-csharp[SqlConnection_ConnectionString Example#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionString.cs#1)]
  5033. ]]></format>
  5034. </remarks><exception cref="T:System.ArgumentException">An invalid connection string argument has been supplied, or a required connection string argument has not been supplied.</exception>
  5035. </member>
  5036. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout">
  5037. <summary>Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.</summary><value>The time (in seconds) to wait for a connection to open. The default value is 15 seconds.</value><remarks>
  5038. <format type="text/markdown"><![CDATA[
  5039. ## Remarks
  5040. You can set the amount of time a connection waits to time out by using the `Connect Timeout` or `Connection Timeout` keywords in the connection string. A value of 0 indicates no limit, and should be avoided in a <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> because an attempt to connect waits indefinitely.
  5041. ## Examples
  5042. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and sets the `Connection Timeout` to 30 seconds in the connection string. The code opens the connection and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A> property in the console window.
  5043. [!code-csharp[SqlConnection_ConnectionTimeout Example#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionTimeout.cs#1)]
  5044. ]]></format>
  5045. </remarks><exception cref="T:System.ArgumentException">The value set is less than 0.</exception>
  5046. </member>
  5047. <member name="P:Microsoft.Data.SqlClient.SqlConnection.Credential">
  5048. <summary>Gets or sets the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object for this connection.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object for this connection.</value><remarks>
  5049. <format type="text/markdown"><![CDATA[
  5050. ## Remarks
  5051. `Persist Security Info = true` is required to get the value of the <xref:Microsoft.Data.SqlClient.SqlCredential> object with <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A>.
  5052. The default value of <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is null.
  5053. An <xref:System.InvalidOperationException> exception will be raised:
  5054. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set on an open connection.
  5055. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when `Context Connection=true`.
  5056. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when `Integrated Security = true`.
  5057. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when the connection string uses `Password`.
  5058. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when the connection string uses `UserID`.
  5059. ]]></format>
  5060. </remarks>
  5061. </member>
  5062. <member name="P:Microsoft.Data.SqlClient.SqlConnection.Database">
  5063. <summary>Gets the name of the current database or the database to be used after a connection is opened.</summary><value>The name of the current database or the name of the database to be used after a connection is opened. The default value is an empty string.</value><remarks>
  5064. <format type="text/markdown"><![CDATA[
  5065. ## Remarks
  5066. The <xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A> property updates dynamically. If you change the current database using a Transact-SQL statement or the <xref:Microsoft.Data.SqlClient.SqlConnection.ChangeDatabase%2A> method, an informational message is sent and the property is updated automatically.
  5067. ## Examples
  5068. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  5069. [!code-csharp[SqlConnection_Database Example#1](~/../sqlclient/doc/samples/SqlConnection_Database.cs#1)]
  5070. ]]></format>
  5071. </remarks>
  5072. </member>
  5073. <member name="P:Microsoft.Data.SqlClient.SqlConnection.DataSource">
  5074. <summary>Gets the name of the instance of SQL Server to which to connect.</summary><value>The name of the instance of SQL Server to which to connect. The default value is an empty string.</value><remarks>
  5075. <format type="text/markdown"><![CDATA[
  5076. ## Remarks
  5077. > [!NOTE]
  5078. > The <xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A> property returns `null` if the connection string for the <xref:Microsoft.Data.SqlClient.SqlConnection> is "context connection=true".
  5079. ## Examples
  5080. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  5081. [!code-csharp[SqlConnection_DataSource Example#1](~/../sqlclient/doc/samples/SqlConnection_DataSource.cs#1)]
  5082. ]]></format>
  5083. </remarks>
  5084. </member>
  5085. <member name="P:Microsoft.Data.SqlClient.SqlConnection.DbProviderFactory">
  5086. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  5087. </member>
  5088. <member name="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors">
  5089. <summary>Gets or sets the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors" /> property.</summary><value>
  5090. <see langword="true" /> if the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors" /> property has been set; otherwise <see langword="false" />.</value><remarks>
  5091. <format type="text/markdown"><![CDATA[
  5092. ## Remarks
  5093. When you set <xref:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors%2A> to `true`, errors that were previously treated as exceptions are now handled as <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> events. All events fire immediately and are handled by the event handler. If is <xref:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors%2A> is set to `false`, then <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> events are handled at the end of the procedure.
  5094. > [!NOTE]
  5095. > An error with a severity level of 17 or above that causes the server to stop processing the command needs to be handled as an exception. In this case, an exception is thrown regardless of how the error is handled in the <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event.
  5096. For more information on working with events, see [Connection Events](~/docs/framework/data/adonet/connection-events.md). For more information on errors generated by the SQL Server engine, see [Database Engine Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  5097. ]]></format>
  5098. </remarks>
  5099. </member>
  5100. <member name="P:Microsoft.Data.SqlClient.SqlConnection.PacketSize">
  5101. <summary>Gets the size (in bytes) of network packets used to communicate with an instance of SQL Server.</summary><value>The size (in bytes) of network packets. The default value is 8000.</value><remarks>
  5102. <format type="text/markdown"><![CDATA[
  5103. ## Remarks
  5104. If an application performs bulk copy operations, or sends or receives lots of text or image data, a packet size larger than the default may improve efficiency because it causes fewer network read and write operations. If an application sends and receives small amounts of information, you can set the packet size to 512 bytes (using the Packet Size value in the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>), which is sufficient for most data transfer operations. For most applications, the default packet size is best.
  5105. <xref:Microsoft.Data.SqlClient.SqlConnection.PacketSize%2A> may be a value in the range of 512 and 32767 bytes. An exception is generated if the value is outside this range.
  5106. Setting the default value to a number greater than 8000 will cause the packets to use the MultiPage allocator on the instance of SQL Server instead of the much more efficient SinglePage allocator, reducing the overall scalability of the SQL Server. For more information on how SQL Server uses memory, see [Memory Management Architecture Guide](/sql/relational-databases/memory-management-architecture-guide).
  5107. ## Examples
  5108. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, including setting the `Packet Size` to 512 in the connection string. It displays the <xref:Microsoft.Data.SqlClient.SqlConnection.PacketSize%2A> and <xref:Microsoft.Data.SqlClient.SqlConnection.ServerVersion%2A> properties in the console window.
  5109. [!code-csharp[SqlConnection_PacketSize Example#1](~/../sqlclient/doc/samples/SqlConnection_PacketSize.cs#1)]
  5110. ]]></format>
  5111. </remarks>
  5112. </member>
  5113. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ServerVersion">
  5114. <summary>Gets a string that contains the version of the instance of SQL Server to which the client is connected.</summary><value>The version of the instance of SQL Server.</value><remarks>
  5115. <format type="text/markdown"><![CDATA[
  5116. ## Remarks
  5117. The version is of the form *##.##.####*, where the first two digits are the major version, the next two digits are the minor version, and the last four digits are the release version. The string is of the form *major.minor.build*, where major and minor are exactly two digits and build is exactly four digits.
  5118. <xref:Microsoft.Data.SqlClient.SqlConnection.ServerVersion%2A> was called while the returned Task was not completed and the connection was not opened after a call to <xref:Microsoft.Data.SqlClient.SqlConnection.OpenAsync%2A>.
  5119. ## Examples
  5120. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.ServerVersion%2A> property.
  5121. [!code-csharp[SqlConnection_ServerVersion Example#1](~/../sqlclient/doc/samples/SqlConnection_ServerVersion.cs#1)]
  5122. ]]></format>
  5123. </remarks><exception cref="T:System.InvalidOperationException">The connection is closed.
  5124. <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ServerVersion" /> was called while the returned Task was not completed and the connection was not opened after a call to <see cref="M:Microsoft.Data.SqlClient.SqlConnection.OpenAsync(System.Threading.CancellationToken)" />.</exception>
  5125. </member>
  5126. <member name="P:Microsoft.Data.SqlClient.SqlConnection.State">
  5127. <summary>Indicates the state of the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> during the most recent network operation performed on the connection.</summary><value>An <see cref="T:System.Data.ConnectionState" /> enumeration.</value><remarks>
  5128. <format type="text/markdown"><![CDATA[
  5129. ## Remarks
  5130. Returns an <xref:System.Data.ConnectionState> enumeration indicating the state of the <xref:Microsoft.Data.SqlClient.SqlConnection>. Closing and reopening the connection will refresh the value of <xref:Microsoft.Data.SqlClient.SqlConnection.State%2A>.
  5131. ]]></format>
  5132. </remarks>
  5133. </member>
  5134. <member name="P:Microsoft.Data.SqlClient.SqlConnection.StatisticsEnabled">
  5135. <summary>When set to <see langword="true" />, enables statistics gathering for the current connection.</summary><value>Returns <see langword="true" /> if statistics gathering is enabled; otherwise <see langword="false" />. <see langword="false" /> is the default.</value><remarks>
  5136. <format type="text/markdown"><![CDATA[
  5137. ## Remarks
  5138. Enabling statistics gathering has a minor, but measurable effect on performance and therefore should be enabled only when it is required.
  5139. ]]></format>
  5140. </remarks>
  5141. </member>
  5142. <member name="P:Microsoft.Data.SqlClient.SqlConnection.WorkstationId">
  5143. <summary>Gets a string that identifies the database client.</summary><value>A string that identifies the database client. If not specified, the name of the client computer. If neither is specified, the value is an empty string.</value><remarks>
  5144. <format type="text/markdown"><![CDATA[
  5145. ## Remarks
  5146. The string typically contains the network name of the client. The <xref:Microsoft.Data.SqlClient.SqlConnection.WorkstationId%2A> property corresponds to the `Workstation ID` connection string property.
  5147. ## Examples
  5148. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.WorkstationId%2A> property.
  5149. [!code-csharp[SqlConnection_WorkstationId Example#1](~/../sqlclient/doc/samples/SqlConnection_WorkstationId.cs#1)]
  5150. ]]></format>
  5151. </remarks>
  5152. </member>
  5153. <member name="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage">
  5154. <summary>Occurs when SQL Server returns a warning or informational message.</summary><remarks>
  5155. <format type="text/markdown"><![CDATA[
  5156. ## Remarks
  5157. Clients that want to process warnings or informational messages sent by the server should create an <xref:Microsoft.Data.SqlClient.SqlInfoMessageEventHandler> delegate to listen to this event.
  5158. The <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event occurs when a message with a severity of 10 or less is returned by SQL Server. Messages that have a severity between 11 and 20 raise an error and messages that have a severity over 20 causes the connection to close. For more information on SQL Server error levels, see [Database Engine Error Severities](/sql/relational-databases/errors-events/database-engine-error-severities).
  5159. For more information and an example, see [Connection Events](~/docs/framework/data/adonet/connection-events.md).
  5160. ]]></format>
  5161. </remarks>
  5162. </member>
  5163. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginDbTransaction(System.Data.IsolationLevel)">
  5164. <param name="isolationLevel">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5165. </member>
  5166. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction">
  5167. <summary>Starts a database transaction.</summary><returns>An object representing the new transaction.</returns><remarks>
  5168. <format type="text/markdown"><![CDATA[
  5169. ## Remarks
  5170. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5171. You must explicitly commit or roll back the transaction using the <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> or <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> method. To make sure that the .NET Framework Data Provider for SQL Server transaction management model performs correctly, avoid using other transaction management models, such as the one provided by SQL Server.
  5172. > [!NOTE]
  5173. > If you do not specify an isolation level, the default isolation level is used. To specify an isolation level with the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A> method, use the overload that takes the `iso` parameter (<xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>). The isolation level set for a transaction persists after the transaction is completed and until the connection is closed or disposed. Setting the isolation level to **Snapshot** in a database where the snapshot isolation level is not enabled does not throw an exception. The transaction will complete using the default isolation level.
  5174. > [!CAUTION]
  5175. > If a transaction is started and a level 16 or higher error occurs on the server, the transaction will not be rolled back until the <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> method is invoked. No exception is thrown on **ExecuteReader**.
  5176. > [!CAUTION]
  5177. > When your query returns a large amount of data and calls `BeginTransaction`, a <xref:Microsoft.Data.SqlClient.SqlException> is thrown because SQL Server does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
  5178. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5179. ## Examples
  5180. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, a <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods.
  5181. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  5182. ]]></format>
  5183. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">Parallel transactions are not allowed when using Multiple Active Result Sets (MARS).</exception><exception cref="T:System.InvalidOperationException">Parallel transactions are not supported.</exception>
  5184. </member>
  5185. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.Data.IsolationLevel)">
  5186. <param name="iso">The isolation level under which the transaction should run.</param><summary>Starts a database transaction with the specified isolation level.</summary><returns>An object representing the new transaction.</returns><remarks>
  5187. <format type="text/markdown"><![CDATA[
  5188. ## Remarks
  5189. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5190. You must explicitly commit or roll back the transaction using the <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> or <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> method. To make sure that the .NET Framework Data Provider for SQL Server transaction management model performs correctly, avoid using other transaction management models, such as the one provided by SQL Server.
  5191. > [!NOTE]
  5192. > After a transaction is committed or rolled back, the isolation level of the transaction persists for all subsequent commands that are in autocommit mode (the SQL Server default). This can produce unexpected results, such as an isolation level of REPEATABLE READ persisting and locking other users out of a row. To reset the isolation level to the default (READ COMMITTED), execute the Transact-SQL SET TRANSACTION ISOLATION LEVEL READ COMMITTED statement, or call <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A?displayProperty=nameWithType> followed immediately by <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A?displayProperty=nameWithType>. For more information on SQL Server isolation levels, see [Transaction Isolation Levels](/sql/t-sql/language-elements/transaction-isolation-levels).
  5193. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5194. > [!CAUTION]
  5195. > When your query returns a large amount of data and calls `BeginTransaction`, a <xref:Microsoft.Data.SqlClient.SqlException> is thrown because SQL Server does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
  5196. ## Examples
  5197. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, a <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods.
  5198. [!code-csharp[SqlConnection_BeginTransaction1 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction1.cs#1)]
  5199. ]]></format>
  5200. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">Parallel transactions are not allowed when using Multiple Active Result Sets (MARS).</exception><exception cref="T:System.InvalidOperationException">Parallel transactions are not supported.</exception>
  5201. </member>
  5202. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.Data.IsolationLevel,System.String)">
  5203. <param name="iso">The isolation level under which the transaction should run.</param><param name="transactionName">The name of the transaction.</param><summary>Starts a database transaction with the specified isolation level and transaction name.</summary><returns>An object representing the new transaction.</returns><remarks>
  5204. <format type="text/markdown"><![CDATA[
  5205. ## Remarks
  5206. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5207. The value in the `transactionName` parameter can be used in later calls to <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> and in the `savePoint` parameter of the <xref:Microsoft.Data.SqlClient.SqlTransaction.Save%2A> method.
  5208. You must explicitly commit or roll back the transaction using the <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> or <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> method. To make sure that the SQL Server transaction management model performs correctly, avoid using other transaction management models, such as the one provided by SQL Server.
  5209. > [!NOTE]
  5210. > After a transaction is committed or rolled back, the isolation level of the transaction persists for all subsequent commands that are in autocommit mode (the SQL Server default). This can produce unexpected results, such as an isolation level of REPEATABLE READ persisting and locking other users out of a row. To reset the isolation level to the default (READ COMMITTED), execute the Transact-SQL SET TRANSACTION ISOLATION LEVEL READ COMMITTED statement, or call <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A?displayProperty=nameWithType> followed immediately by <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A?displayProperty=nameWithType>. For more information on SQL Server isolation levels, see [Transaction Isolation Levels](/sql/t-sql/language-elements/transaction-isolation-levels).
  5211. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5212. > [!CAUTION]
  5213. > When your query returns a large amount of data and calls `BeginTransaction`, a <xref:Microsoft.Data.SqlClient.SqlException> is thrown because SQL Server does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
  5214. ## Examples
  5215. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, a <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods.
  5216. [!code-csharp[SqlConnection_BeginTransaction3 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction3.cs#1)]
  5217. ]]></format>
  5218. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">Parallel transactions are not allowed when using Multiple Active Result Sets (MARS).</exception><exception cref="T:System.InvalidOperationException">Parallel transactions are not supported.</exception>
  5219. </member>
  5220. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.String)">
  5221. <param name="transactionName">The name of the transaction.</param><summary>Starts a database transaction with the specified transaction name.</summary><returns>An object representing the new transaction.</returns><remarks>
  5222. <format type="text/markdown"><![CDATA[
  5223. ## Remarks
  5224. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5225. The length of the `transactionName` parameter must not exceed 32 characters; otherwise an exception will be thrown.
  5226. The value in the `transactionName` parameter can be used in later calls to <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> and in the `savePoint` parameter of the <xref:Microsoft.Data.SqlClient.SqlTransaction.Save%2A> method.
  5227. You must explicitly commit or roll back the transaction using the <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> or <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> method. To make sure that the .NET Data Provider for SQL Server transaction management model performs correctly, avoid using other transaction management models, such as the one provided by SQL Server.
  5228. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5229. > [!CAUTION]
  5230. > When your query returns a large amount of data and calls `BeginTransaction`, a <xref:Microsoft.Data.SqlClient.SqlException> is thrown because SQL Server does not allow parallel transactions when using MARS. To avoid this problem, always associate a transaction with the command, the connection, or both before any readers are open.
  5231. ## Examples
  5232. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, a <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods.
  5233. [!code-csharp[SqlConnection_BeginTransaction2 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction2.cs#1)]
  5234. ]]></format>
  5235. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">Parallel transactions are not allowed when using Multiple Active Result Sets (MARS).</exception><exception cref="T:System.InvalidOperationException">Parallel transactions are not supported.</exception>
  5236. </member>
  5237. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangeDatabase(System.String)">
  5238. <param name="database">The name of the database to use instead of the current database.</param><summary>Changes the current database for an open <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />.</summary><remarks>
  5239. <format type="text/markdown"><![CDATA[
  5240. ## Remarks
  5241. The value supplied in the `database` parameter must be a valid database name. The `database` parameter cannot contain a null value, an empty string, or a string with only blank characters.
  5242. ## Examples
  5243. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  5244. [!code-csharp[SqlConnection_Database Example#1](~/../sqlclient/doc/samples/SqlConnection_Database.cs#1)]
  5245. ]]></format>
  5246. </remarks><exception cref="T:System.ArgumentException">The database name is not valid.</exception><exception cref="T:System.InvalidOperationException">The connection is not open.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">Cannot change the database.</exception>
  5247. </member>
  5248. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,Microsoft.Data.SqlClient.SqlCredential,System.Security.SecureString)">
  5249. <param name="connectionString">The connection string that contains enough information to connect to a server. The connection string should not use any of the following connection string keywords: <see langword="Integrated Security = true" />, <see langword="UserId" />, or <see langword="Password" />; or <see langword="ContextConnection = true" />.</param><param name="credential">A <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</param><param name="newSecurePassword">The new password. <paramref name="newSecurePassword" /> must be read only. The password must also comply with any password security policy set on the server (for example, minimum length and requirements for specific characters).</param><summary>Changes the SQL Server password for the user indicated in the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  5250. The connection string contains any combination of <see langword="UserId" />, <see langword="Password" />, or <see langword="Integrated Security=true" />.
  5251. -or-
  5252. The connection string contains <see langword="Context Connection=true" />.
  5253. -or-
  5254. <paramref name="newSecurePassword" /> is greater than 128 characters.
  5255. -or-
  5256. <paramref name="newSecurePassword" /> is not read only.
  5257. -or-
  5258. <paramref name="newSecurePassword" /> is an empty string.</exception><exception cref="T:System.ArgumentNullException">One of the parameters (<paramref name="connectionString" />, <paramref name="credential" />, or <paramref name="newSecurePassword" />) is null.</exception>
  5259. </member>
  5260. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,System.String)">
  5261. <param name="connectionString">The connection string that contains enough information to connect to the server that you want. The connection string must contain the user ID and the current password.</param><param name="newPassword">The new password to set. This password must comply with any password security policy set on the server, including minimum length, requirements for specific characters, and so on.</param><summary>Changes the SQL Server password for the user indicated in the connection string to the supplied new password.</summary><remarks>
  5262. <format type="text/markdown"><![CDATA[
  5263. ## Remarks
  5264. When you are using SQL Server on Windows Server, developers can take advantage of functionality that lets the client application supply both the current and a new password in order to change the existing password. Applications can implement functionality such as prompting the user for a new password during initial login if the old one has expired, and this operation can be completed without administrator intervention.
  5265. The <xref:Microsoft.Data.SqlClient.SqlConnection.ChangePassword%2A> method changes the SQL Server password for the user indicated in the supplied `connectionString` parameter to the value supplied in the `newPassword` parameter. If the connection string includes the option for integrated security (that is, "Integrated Security=True" or the equivalent), an exception is thrown.
  5266. To determine that the password has expired, calling the <xref:Microsoft.Data.SqlClient.SqlConnection.Open%2A> method raises a <xref:Microsoft.Data.SqlClient.SqlException>. In order to indicate that the password that is contained within the connection string must be reset, the <xref:Microsoft.Data.SqlClient.SqlException.Number%2A> property for the exception contains the status value 18487 or 18488. The first value (18487) indicates that the password has expired and the second (18488) indicates that the password must be reset before logging in.
  5267. This method opens its own connection to the server, requests the password change, and closes the connection as soon as it has completed. This connection is not retrieved from, nor returned to, the SQL Server connection pool.
  5268. ## Examples
  5269. The following is a simple example of changing a password:
  5270. ```csharp
  5271. class Program {
  5272. static void Main(string[] args) {
  5273. Microsoft.Data.SqlClient.SqlConnection.ChangePassword(
  5274. "Data Source=a_server;Initial Catalog=a_database;UID=user;PWD=old_password",
  5275. "new_password");
  5276. }
  5277. }
  5278. ```
  5279. ```vb
  5280. Module Module1
  5281. Sub Main()
  5282. Microsoft.Data.SqlClient.SqlConnection.ChangePassword(
  5283. "Data Source=a_server;Initial Catalog=a_database;UID=user;PWD=old_password",
  5284. "new_password")
  5285. End Sub
  5286. End Module
  5287. ```
  5288. The following console application demonstrates the issues involved in changing a user's password because the current password has expired.
  5289. [!code-csharp[SqlConnection_ConnectionString1#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionString1.cs#1)]
  5290. ]]></format>
  5291. </remarks><exception cref="T:System.ArgumentException">The connection string includes the option to use integrated security.
  5292. Or
  5293. The <paramref name="newPassword" /> exceeds 128 characters.</exception><exception cref="T:System.ArgumentNullException">Either the <paramref name="connectionString" /> or the <paramref name="newPassword" /> parameter is null.</exception>
  5294. </member>
  5295. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ClearAllPools">
  5296. <summary>Empties the connection pool.</summary><remarks>
  5297. <format type="text/markdown"><![CDATA[
  5298. ## Remarks
  5299. <xref:Microsoft.Data.SqlClient.SqlConnection.ClearAllPools%2A> resets (or empties) the connection pool. If there are connections in use at the time of the call, they are marked appropriately and will be discarded (instead of being returned to the pool) when <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> is called on them.
  5300. ]]></format>
  5301. </remarks>
  5302. </member>
  5303. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ClearPool(Microsoft.Data.SqlClient.SqlConnection)">
  5304. <param name="connection">The <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> to be cleared from the pool.</param><summary>Empties the connection pool associated with the specified connection.</summary><remarks>
  5305. <format type="text/markdown"><![CDATA[
  5306. ## Remarks
  5307. <xref:Microsoft.Data.SqlClient.SqlConnection.ClearPool%2A> clears the connection pool that is associated with the `connection`. If additional connections associated with `connection` are in use at the time of the call, they are marked appropriately and are discarded (instead of being returned to the pool) when <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> is called on them.
  5308. ]]></format>
  5309. </remarks>
  5310. </member>
  5311. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Close">
  5312. <summary>Closes the connection to the database. This is the preferred method of closing any open connection.</summary><remarks>
  5313. <format type="text/markdown"><![CDATA[
  5314. ## Remarks
  5315. The <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> method rolls back any pending transactions. It then releases the connection to the connection pool, or closes the connection if connection pooling is disabled.
  5316. > [!NOTE]
  5317. > Pending transactions started using Transact-SQL or <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A> are automatically rolled back when the connection is reset if connection pooling is enabled. If connection pooling is off, the transaction is rolled back after `SqlConnection.Close` is called. Transactions started through <xref:System.Transactions> are controlled through the `System.Transactions` infrastructure, and are not affected by `SqlConnection.Close`.
  5318. An application can call <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> more than one time. No exception is generated.
  5319. If the <xref:Microsoft.Data.SqlClient.SqlConnection> goes out of scope, it won't be closed. Therefore, you must explicitly close the connection by calling `Close` or `Dispose`. `Close` and `Dispose` are functionally equivalent. If the connection pooling value `Pooling` is set to `true` or `yes`, the underlying connection is returned back to the connection pool. On the other hand, if `Pooling` is set to `false` or `no`, the underlying connection to the server is closed.
  5320. > [!NOTE]
  5321. > Login and logout events will not be raised on the server when a connection is fetched from or returned to the connection pool, because the connection is not actually closed when it is returned to the connection pool. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  5322. > [!CAUTION]
  5323. > Do not call `Close` or `Dispose` on a Connection, a DataReader, or any other managed object in the `Finalize` method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a `Finalize` method in your class definition. For more information, see [Garbage Collection](~/docs/standard/garbage-collection/index.md).
  5324. ## Examples
  5325. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, opens it, displays some of its properties. The connection is automatically closed at the end of the `using` block.
  5326. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  5327. ]]></format>
  5328. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">The connection-level error that occurred while opening the connection.</exception>
  5329. </member>
  5330. <member name="M:Microsoft.Data.SqlClient.SqlConnection.CreateCommand">
  5331. <summary>Creates and returns a <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object associated with the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object.</returns><remarks>
  5332. <format type="text/markdown"><![CDATA[
  5333. ## Examples
  5334. [!code-csharp[SqlConnection_CreateCommand#1](~/../sqlclient/doc/samples/SqlConnection_CreateCommand.cs#1)]
  5335. ]]></format>
  5336. </remarks>
  5337. </member>
  5338. <member name="M:Microsoft.Data.SqlClient.SqlConnection.CreateDbCommand">
  5339. <summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5340. </member>
  5341. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Dispose(System.Boolean)">
  5342. <param name="disposing">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  5343. </member>
  5344. <member name="M:Microsoft.Data.SqlClient.SqlConnection.EnlistDistributedTransaction(System.EnterpriseServices.ITransaction)">
  5345. <param name="transaction">A reference to an existing <see cref="T:System.EnterpriseServices.ITransaction" /> in which to enlist.</param><summary>Enlists in the specified transaction as a distributed transaction.</summary><remarks>
  5346. <format type="text/markdown"><![CDATA[
  5347. ## Remarks
  5348. You can use the <xref:Microsoft.Data.SqlClient.SqlConnection.EnlistTransaction%2A> method to enlist in a distributed transaction. Because it enlists a connection in a <xref:System.Transactions.Transaction> instance, **EnlistTransaction** takes advantage of functionality available in the <xref:System.Transactions> namespace for managing distributed transactions, making it preferable to **EnlistDistributedTransaction** for this purpose. For more information, see [Distributed Transactions](~/docs/framework/data/adonet/distributed-transactions.md).
  5349. You can continue to enlist in an existing distributed transaction using the **EnlistDistributedTransaction** method if auto-enlistment is disabled. Enlisting in an existing distributed transaction makes sure that, if the transaction is committed or rolled back, modifications made by the code at the data source are also committed or rolled back.
  5350. `EnlistDistributedTransaction` returns an exception if the <xref:Microsoft.Data.SqlClient.SqlConnection> has already started a transaction using <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>. However, if the transaction is a local transaction started at the data source (for example, by explicitly executing the BEGIN TRANSACTION statement using an <xref:Microsoft.Data.SqlClient.SqlCommand> object), **EnlistDistributedTransaction** rolls back the local transaction and enlists in the existing distributed transaction as requested. You do not receive notice that the local transaction was rolled back, and are responsible for managing any local transactions not started using <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>.
  5351. ]]></format>
  5352. </remarks>
  5353. </member>
  5354. <member name="M:Microsoft.Data.SqlClient.SqlConnection.EnlistTransaction(System.Transactions.Transaction)">
  5355. <param name="transaction">A reference to an existing <see cref="T:System.Transactions.Transaction" /> in which to enlist.</param><summary>Enlists in the specified transaction as a distributed transaction.</summary><remarks>
  5356. <format type="text/markdown"><![CDATA[
  5357. ## Remarks
  5358. You can use the <xref:Microsoft.Data.SqlClient.SqlConnection.EnlistTransaction%2A> method to enlist in a distributed transaction. Because it enlists a connection in a <xref:System.Transactions.Transaction> instance, **EnlistTransaction** takes advantage of functionality available in the <xref:System.Transactions> namespace for managing distributed transactions, making it preferable to **EnlistDistributedTransaction**, which uses a **System.EnterpriseServices.ITransaction** object. It also has slightly different semantics: once a connection is explicitly enlisted on a transaction, it cannot be unenlisted or enlisted in another transaction until the first transaction finishes. For more information about distributed transactions, see [Distributed Transactions](~/docs/framework/data/adonet/distributed-transactions.md).
  5359. ]]></format>
  5360. </remarks>
  5361. </member>
  5362. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema">
  5363. <summary>Returns schema information for the data source of this <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />. For more information about scheme, see [SQL Server Schema Collections](~/docs/framework/data/adonet/sql-server-schema-collections.md).</summary><returns>A <see cref="T:System.Data.DataTable" /> that contains schema information.</returns><remarks>To be added.</remarks>
  5364. </member>
  5365. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema(System.String)">
  5366. <param name="collectionName">Specifies the name of the schema to return.</param><summary>Returns schema information for the data source of this <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> using the specified string for the schema name.</summary><returns>A <see cref="T:System.Data.DataTable" /> that contains schema information.</returns><remarks>
  5367. <format type="text/markdown"><![CDATA[
  5368. ## Remarks
  5369. You may need the schema information of the database, tables or columns. This sample:
  5370. - Uses GetSchema to get schema information.
  5371. - Use schema restrictions to get the specified information.
  5372. - Gets schema information of the database, tables, and some columns.
  5373. Before you run the sample, you need to create the sample database, using the following Transact-SQL:
  5374. ```
  5375. USE [master]
  5376. GO
  5377. CREATE DATABASE [MySchool]
  5378. GO
  5379. USE [MySchool]
  5380. GO
  5381. SET ANSI_NULLS ON
  5382. GO
  5383. SET QUOTED_IDENTIFIER ON
  5384. GO
  5385. CREATE TABLE [dbo].[Course]([CourseID] [nvarchar](10) NOT NULL,
  5386. [Year] [smallint] NOT NULL,
  5387. [Title] [nvarchar](100) NOT NULL,
  5388. [Credits] [int] NOT NULL,
  5389. [DepartmentID] [int] NOT NULL,
  5390. CONSTRAINT [PK_Course] PRIMARY KEY CLUSTERED
  5391. (
  5392. [CourseID] ASC,
  5393. [Year] ASC
  5394. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
  5395. GO
  5396. SET ANSI_NULLS ON
  5397. GO
  5398. SET QUOTED_IDENTIFIER ON
  5399. GO
  5400. CREATE TABLE [dbo].[Department]([DepartmentID] [int] IDENTITY(1,1) NOT NULL,
  5401. [Name] [nvarchar](50) NOT NULL,
  5402. [Budget] [money] NOT NULL,
  5403. [StartDate] [datetime] NOT NULL,
  5404. [Administrator] [int] NULL,
  5405. CONSTRAINT [PK_Department] PRIMARY KEY CLUSTERED
  5406. (
  5407. [DepartmentID] ASC
  5408. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
  5409. GO
  5410. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C1045', 2012, N'Calculus', 4, 7)
  5411. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C1061', 2012, N'Physics', 4, 1)
  5412. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C2021', 2012, N'Composition', 3, 2)
  5413. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C2042', 2012, N'Literature', 4, 2)
  5414. SET IDENTITY_INSERT [dbo].[Department] ON
  5415. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (1, N'Engineering', 350000.0000, CAST(0x0000999C00000000 AS DateTime), 2)
  5416. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (2, N'English', 120000.0000, CAST(0x0000999C00000000 AS DateTime), 6)
  5417. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (4, N'Economics', 200000.0000, CAST(0x0000999C00000000 AS DateTime), 4)
  5418. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (7, N'Mathematics', 250024.0000, CAST(0x0000999C00000000 AS DateTime), 3)
  5419. SET IDENTITY_INSERT [dbo].[Department] OFF
  5420. ALTER TABLE [dbo].[Course] WITH CHECK ADD CONSTRAINT [FK_Course_Department] FOREIGN KEY([DepartmentID])
  5421. REFERENCES [dbo].[Department] ([DepartmentID])
  5422. GO
  5423. ALTER TABLE [dbo].[Course] CHECK CONSTRAINT [FK_Course_Department]
  5424. GO
  5425. ```
  5426. [How to Get Schema Information from Database](https://code.msdn.microsoft.com/How-to-Get-Schema-b66d62e2) has C# and Visual Basic versions of this code sample in a Visual Studio project.
  5427. [!code-csharp[SqlConnection.GetSchema#1](~/../sqlclient/doc/samples/SqlConnection_GetSchema.cs#1)]
  5428. ]]></format>
  5429. </remarks><exception cref="T:System.ArgumentException">
  5430. <paramref name="collectionName" /> is specified as null.</exception>
  5431. </member>
  5432. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema(System.String,System.String[])">
  5433. <param name="collectionName">Specifies the name of the schema to return.</param><param name="restrictionValues">A set of restriction values for the requested schema.</param><summary>Returns schema information for the data source of this <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> using the specified string for the schema name and the specified string array for the restriction values.</summary><returns>A <see cref="T:System.Data.DataTable" /> that contains schema information.</returns><remarks>
  5434. <format type="text/markdown"><![CDATA[
  5435. ## Remarks
  5436. The `restrictionValues` parameter can supply *n* depth of values, which are specified by the restrictions collection for a specific collection. In order to set values on a given restriction, and not set the values of other restrictions, you need to set the preceding restrictions to `null` and then put the appropriate value in for the restriction that you would like to specify a value for.
  5437. An example of this is the "Tables" collection. If the "Tables" collection has three restrictions--database, owner, and table name--and you want to get back only the tables associated with the owner "Carl", you need to pass in the following values: null, "Carl". If a restriction value is not passed in, the default values are used for that restriction. This is the same mapping as passing in `null`, which is different from passing in an empty string for the parameter value. In that case, the empty string ("") is considered to be the value for the specified parameter.
  5438. For a code sample demonstrating <xref:Microsoft.Data.SqlClient.SqlConnection.GetSchema%2A>, see <xref:Microsoft.Data.SqlClient.SqlConnection.GetSchema%2A>.
  5439. ]]></format>
  5440. </remarks><exception cref="T:System.ArgumentException">
  5441. <paramref name="collectionName" /> is specified as null.</exception><altmember cref="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema" />
  5442. </member>
  5443. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Open">
  5444. <summary>Opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />.</summary><remarks>
  5445. <format type="text/markdown"><![CDATA[
  5446. ## Remarks
  5447. The <xref:Microsoft.Data.SqlClient.SqlConnection> draws an open connection from the connection pool if one is available. Otherwise, it establishes a new connection to an instance of SQL Server.
  5448. > [!NOTE]
  5449. > If the <xref:Microsoft.Data.SqlClient.SqlConnection> goes out of scope, it is not closed. Therefore, you must explicitly close the connection by calling <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A>.
  5450. > [!NOTE]
  5451. > If you specify a port number other than 1433 when you are trying to connect to an instance of SQL Server and using a protocol other than TCP/IP, the <xref:Microsoft.Data.SqlClient.SqlConnection.Open%2A> method fails. To specify a port number other than 1433, include "server=machinename,port number" in the connection string, and use the TCP/IP protocol.
  5452. > [!NOTE]
  5453. > The .NET Framework Data Provider for SQL Server requires the Security permission with "Allows calls to unmanaged assemblies" enabled (<xref:System.Security.Permissions.SecurityPermission> with <xref:System.Security.Permissions.SecurityPermissionFlag> set to `UnmanagedCode`) to open a <xref:Microsoft.Data.SqlClient.SqlConnection> with SQL Debugging enabled.
  5454. ## Examples
  5455. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, opens it, and displays some of its properties. The connection is automatically closed at the end of the `using` block.
  5456. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  5457. ]]></format>
  5458. </remarks><exception cref="T:System.InvalidOperationException">Cannot open a connection without specifying a data source or server.
  5459. or
  5460. The connection is already open.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">A connection-level error occurred while opening the connection. If the <see cref="P:Microsoft.Data.SqlClient.SqlException.Number" /> property contains the value 18487 or 18488, this indicates that the specified password has expired or must be reset. See the <see cref="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,System.String)" /> method for more information.
  5461. The <see langword="&lt;system.data.localdb&gt;" /> tag in the app.config file has invalid or unknown elements.</exception><exception cref="T:System.Configuration.ConfigurationErrorsException">There are two entries with the same name in the <see langword="&lt;localdbinstances&gt;" /> section.</exception>
  5462. </member>
  5463. <member name="M:Microsoft.Data.SqlClient.SqlConnection.OpenAsync(System.Threading.CancellationToken)">
  5464. <param name="cancellationToken">The cancellation instruction.</param><summary>An asynchronous version of <see cref="M:Microsoft.Data.SqlClient.SqlConnection.Open" />, which opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />. The cancellation token can be used to request that the operation be abandoned before the connection timeout elapses. Exceptions will be propagated via the returned Task. If the connection timeout time elapses without successfully connecting, the returned Task will be marked as faulted with an Exception. The implementation returns a Task without blocking the calling thread for both pooled and non-pooled connections.</summary><returns>A task representing the asynchronous operation.</returns><remarks>
  5465. <format type="text/markdown"><![CDATA[
  5466. ## Remarks
  5467. After calling <xref:Microsoft.Data.SqlClient.SqlConnection.OpenAsync%2A>, <xref:Microsoft.Data.SqlClient.SqlConnection.State%2A> must return <xref:System.Data.ConnectionState.Connecting> until the returned <xref:System.Threading.Tasks.Task> is completed. Then, if the connection was successful, <xref:Microsoft.Data.SqlClient.SqlConnection.State%2A> must return <xref:System.Data.ConnectionState.Open>. If the connection fails, <xref:Microsoft.Data.SqlClient.SqlConnection.State%2A> must return <xref:System.Data.ConnectionState.Closed>.
  5468. A call to <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> will attempt to cancel or close the corresponding <xref:Microsoft.Data.SqlClient.SqlConnection.OpenAsync%2A> call.
  5469. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  5470. ]]></format>
  5471. </remarks><exception cref="T:System.InvalidOperationException">Calling <see cref="M:Microsoft.Data.SqlClient.SqlConnection.OpenAsync(System.Threading.CancellationToken)" /> more than once for the same instance before task completion.
  5472. <see langword="Context Connection=true" /> is specified in the connection string.
  5473. A connection was not available from the connection pool before the connection time out elapsed.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">Any error returned by SQL Server that occurred while opening the connection.</exception>
  5474. </member>
  5475. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProviders(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})">
  5476. <param name="customProviders">Custom column encryption key provider dictionary</param><summary>Registers the column encryption key store providers. This function should only be called once in an app. This does shallow copying of the dictionary so that the app cannot alter the custom provider list once it has been set.</summary><remarks>
  5477. <format type="text/markdown"><![CDATA[
  5478. ## Examples
  5479. ```csharp
  5480. Dictionary<string, SqlColumnEncryptionKeyStoreProvider> customKeyStoreProviders = new Dictionary<string, SqlColumnEncryptionKeyStoreProvider>();
  5481. MySqlClientHSMProvider myProvider = new MySqlClientHSMProvider();
  5482. customKeyStoreProviders.Add(@"HSM Provider", myProvider);
  5483. SqlConnection.RegisterColumnEncryptionKeyStoreProviders(customKeyStoreProviders);
  5484. ```
  5485. ]]></format>
  5486. </remarks>
  5487. </member>
  5488. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ResetStatistics">
  5489. <summary>If statistics gathering is enabled, all values are reset to zero.</summary><remarks>
  5490. <format type="text/markdown"><![CDATA[
  5491. ## Remarks
  5492. If statistics gathering is not enabled and this method is called, no error is thrown.
  5493. ]]></format>
  5494. </remarks>
  5495. </member>
  5496. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RetrieveStatistics">
  5497. <summary>Returns a name value pair collection of statistics at the point in time the method is called.</summary><returns>Returns a reference of type <see cref="T:System.Collections.IDictionary" /> of <see cref="T:System.Collections.DictionaryEntry" /> items.</returns><remarks>
  5498. <format type="text/markdown"><![CDATA[
  5499. ## Remarks
  5500. When this method is called, the values retrieved are those at the current point in time. If you continue using the connection, the values are incorrect. You need to re-execute the method to obtain the most current values.
  5501. ]]></format>
  5502. </remarks>
  5503. </member>
  5504. <member name="T:Microsoft.Data.SqlClient.SqlConnectionColumnEncryptionSetting">
  5505. <summary>Note that these settings cannot be used to bypass encryption and gain access to plaintext data. For details, see <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted (Database Engine)</see>.</summary><remarks>To be added.</remarks>
  5506. </member>
  5507. <member name="F:Microsoft.Data.SqlClient.SqlConnectionColumnEncryptionSetting.Disabled">
  5508. <summary>Specifies the connection does not use Always Encrypted. Should be used if no queries sent over the connection access encrypted columns.</summary>
  5509. </member>
  5510. <member name="F:Microsoft.Data.SqlClient.SqlConnectionColumnEncryptionSetting.Enabled">
  5511. <summary>Enables Always Encrypted functionality for the connection. Query parameters that correspond to encrypted columns will be transparently encrypted and query results from encrypted columns will be transparently decrypted.</summary>
  5512. </member>
  5513. <member name="T:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol">
  5514. <summary>
  5515. Specifies a value for Attestation Protocol.
  5516. </summary>
  5517. </member>
  5518. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.NotSpecified">
  5519. <summary>If the attestation protocol is not specified. Use this as default value.</summary><value>0</value>
  5520. </member>
  5521. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.AAS">
  5522. <summary>Attestation portocol for Azure Attestation Service</summary><value>1</value>
  5523. </member>
  5524. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.HGS">
  5525. <summary>Attestation protocol for Host Guardian Service</summary><value>3</value>
  5526. </member>
  5527. <member name="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder">
  5528. <summary>Provides a simple way to create and manage the contents of connection strings used by the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> class.</summary><remarks>
  5529. <format type="text/markdown"><![CDATA[
  5530. ## Remarks
  5531. The connection string builder lets developers programmatically create syntactically correct connection strings, and parse and rebuild existing connection strings, using properties and methods of the class. The connection string builder provides strongly typed properties corresponding to the known key/value pairs allowed by SQL Server. Developers needing to create connection strings as part of applications can use the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class to build and modify connection strings. The class also makes it easy to manage connection strings stored in an application configuration file.
  5532. The <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> performs checks for valid key/value pairs. Therefore, you cannot use this class to create invalid connection strings; trying to add invalid pairs will throw an exception. The class maintains a fixed collection of synonyms and can translate from a synonym to the corresponding well-known key name.
  5533. For example, when you use the **Item** property to retrieve a value, you can specify a string that contains any synonym for the key you need. For example, you can specify "Network Address", "addr", or any other acceptable synonym for this key within a connection string when you use any member that requires a string that contains the key name, such as the **Item** property or the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Remove%2A> method. See the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property for a full list of acceptable synonyms.
  5534. The **Item** property handles tries to insert malicious entries. For example, the following code, using the default Item property (the indexer, in C#) correctly escapes the nested key/value pair:
  5535. ```vb
  5536. Dim builder As New Microsoft.Data.SqlClient.SqlConnectionStringBuilder
  5537. builder("Data Source") = "(local)"
  5538. builder("Integrated Security") = True
  5539. builder("Initial Catalog") = "AdventureWorks;NewValue=Bad"
  5540. Console.WriteLine(builder.ConnectionString)
  5541. ```
  5542. ```csharp
  5543. Microsoft.Data.SqlClient.SqlConnectionStringBuilder builder =
  5544. new Microsoft.Data.SqlClient.SqlConnectionStringBuilder();
  5545. builder["Data Source"] = "(local)";
  5546. builder["Integrated Security"] = true;
  5547. builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad";
  5548. Console.WriteLine(builder.ConnectionString);
  5549. ```
  5550. The result is the following connection string that handles the invalid value in a safe manner:
  5551. ```
  5552. Source=(local);Initial Catalog="AdventureWorks;NewValue=Bad";
  5553. Integrated Security=True
  5554. ```
  5555. ## Examples
  5556. The following console application builds connection strings for a SQL Server database. The code uses a <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class to create the connection string, and then passes the <xref:System.Data.Common.DbConnectionStringBuilder.ConnectionString%2A> property of the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> instance to the constructor of the connection class. The example also parses an existing connection string and demonstrates various ways of manipulating the connection string's contents.
  5557. > [!NOTE]
  5558. > This example includes a password to demonstrate how <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.
  5559. [!code-csharp[SqlConnectionStringBuilder#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder.cs#1)]
  5560. ]]></format>
  5561. </remarks>
  5562. </member>
  5563. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.#ctor">
  5564. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> class.</summary><remarks>To be added.</remarks>
  5565. </member>
  5566. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.#ctor(System.String)">
  5567. <param name="connectionString">The basis for the object's internal connection information. Parsed into name/value pairs. Invalid key names raise <see cref="T:System.Collections.Generic.KeyNotFoundException" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> class. The provided connection string provides the data for the instance's internal connection information.</summary><remarks>
  5568. <format type="text/markdown"><![CDATA[
  5569. ## Remarks
  5570. The <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class provides a fixed internal collection of key/value pairs. Even if you supply only a small subset of the possible connection string values in the constructor, the object always provides default values for each key/value pair. When the `ConnectionString` property of the object is retrieved, the string contains only key/value pairs in which the value is not the default value for the item.
  5571. ## Examples
  5572. The following example supplies a simple SQL Server connection string in the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> object's constructor, and then iterates through all the key/value pairs within the object. Note that the collection provides default values for each item. Also note that the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class converts synonyms for the well-known keys so that they are consistent with the well-known names.
  5573. > [!NOTE]
  5574. > This example includes a password to demonstrate how <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.
  5575. [!code-csharp[SqlConnectionStringBuilder3#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder3.cs#1)]
  5576. ]]></format>
  5577. </remarks><exception cref="T:System.Collections.Generic.KeyNotFoundException">Invalid key name within the connection string.</exception><exception cref="T:System.FormatException">Invalid value within the connection string (specifically, when a Boolean or numeric value was expected but not supplied).</exception><exception cref="T:System.ArgumentException">The supplied <paramref name="connectionString" /> is not valid.</exception>
  5578. </member>
  5579. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationIntent">
  5580. <summary>Declares the application workload type when connecting to a database in an SQL Server Availability Group. You can set the value of this property with <see cref="T:Microsoft.Data.SqlClient.ApplicationIntent" />. For more information about SqlClient support for Always On Availability Groups, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).</summary><value>Returns the current value of the property (a value of type <see cref="T:Microsoft.Data.SqlClient.ApplicationIntent" />).</value><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5581. </member>
  5582. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationName">
  5583. <summary>Gets or sets the name of the application associated with the connection string.</summary><value>The name of the application, or ".NET SqlClient Data Provider" if no name has been supplied.</value><remarks>
  5584. <format type="text/markdown"><![CDATA[
  5585. ## Remarks
  5586. This property corresponds to the "Application Name" and "app" keys within the connection string.
  5587. ## Examples
  5588. The following example creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> and assigns a connection string in the object's constructor. The code displays the parsed and recreated version of the connection string, and then modifies the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationName%2A> property of the object. Finally, the code displays the new connection string, including the new key/value pair.
  5589. [!code-csharp[SqlConnectionStringBuilder.ApplicationName#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ApplicationName.cs#1)]
  5590. The sample displays the following text in the console window:
  5591. ```
  5592. Original: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  5593. ApplicationName=".Net SqlClient Data Provider"
  5594. Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True;Application Name="My Application"
  5595. ```
  5596. ]]></format>
  5597. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5598. </member>
  5599. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AsynchronousProcessing">
  5600. <summary>Gets or sets a Boolean value that indicates whether asynchronous processing is allowed by the connection created by using this connection string.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AsynchronousProcessing" /> property, or <see langword="false" /> if no value has been supplied.</value><remarks>
  5601. <format type="text/markdown"><![CDATA[
  5602. ## Remarks
  5603. This property corresponds to the "Asynchronous Processing" and "async" keys within the connection string. In order to take advantage of the asynchronous processing provided by the <xref:Microsoft.Data.SqlClient.SqlCommand> object, this key/value pair must be included within the connection string of the associated <xref:Microsoft.Data.SqlClient.SqlConnection> object.
  5604. ## Examples
  5605. The following example retrieves a connection string and verifies that the connection string is configured to allow for asynchronous processing. (In this case, the string comes from a procedure within the application, but in a production application, the connection string might come from a configuration file, or some other source.) Then, the example performs an asynchronous operation, updating values within a sample database on a background thread.
  5606. [!code-csharp[SqlConnectionStringBuilder_AsynchronousProcessing#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_AsynchronousProcessing.cs#1)]
  5607. ]]></format>
  5608. </remarks><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader" /><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" /><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  5609. </member>
  5610. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AttachDBFilename">
  5611. <summary>Gets or sets a string that contains the name of the primary data file. This includes the full path name of an attachable database.</summary><value>The value of the <see langword="AttachDBFilename" /> property, or <see langword="String.Empty" /> if no value has been supplied.</value><remarks>
  5612. <format type="text/markdown"><![CDATA[
  5613. ## Remarks
  5614. This property corresponds to the "AttachDBFilename", "extended properties", and "initial file name" keys within the connection string.
  5615. `AttachDBFilename` is only supported for primary data files with an .mdf extension.
  5616. An error will be generated if a log file exists in the same directory as the data file and the 'database' keyword is used when attaching the primary data file. In this case, remove the log file. Once the database is attached, a new log file will be automatically generated based on the physical path.
  5617. ## Examples
  5618. The following example creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> instance, and sets the `AttachDBFilename` property in order to specify the name of an attached data file.
  5619. [!code-csharp[DataWorks SqlConnectionStringBuilder_AttachDBFilename#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_AttachDBFilename.cs#1)]
  5620. ]]></format>
  5621. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5622. </member>
  5623. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Authentication">
  5624. <summary>Gets the authentication of the connection string.</summary><value>The authentication of the connection string.</value><remarks>To be added.</remarks>
  5625. </member>
  5626. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ColumnEncryptionSetting">
  5627. <summary>Gets or sets the column encryption settings for the connection string builder.</summary><value>The column encryption settings for the connection string builder.</value><remarks>To be added.</remarks>
  5628. </member>
  5629. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectionReset">
  5630. <summary>Obsolete. Gets or sets a Boolean value that indicates whether the connection is reset when drawn from the connection pool.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectionReset" /> property, or true if no value has been supplied.</value><remarks>
  5631. <format type="text/markdown"><![CDATA[
  5632. ## Remarks
  5633. This property corresponds to the "Connection Reset" key within the <xref:Microsoft.Data.SqlClient.SqlConnection> connection string, which has been removed from version 3.5 SP1 of the .NET Framework.
  5634. ]]></format>
  5635. </remarks>
  5636. </member>
  5637. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryCount">
  5638. <summary>The number of reconnections attempted after identifying that there was an idle connection failure. This must be an integer between 0 and 255. Default is 1. Set to 0 to disable reconnecting on idle connection failures. An <see cref="T:System.ArgumentException" /> will be thrown if set to a value outside of the allowed range.</summary><value>The number of reconnections attempted after identifying that there was an idle connection failure.</value>
  5639. </member>
  5640. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryInterval">
  5641. <summary>Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure. This must be an integer between 1 and 60. The default is 10 seconds. An <see cref="T:System.ArgumentException" /> will be thrown if set to a value outside of the allowed range.</summary><value>Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure.</value>
  5642. </member>
  5643. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectTimeout">
  5644. <summary>Gets or sets the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectTimeout" /> property, or 15 seconds if no value has been supplied.</value><remarks>
  5645. <format type="text/markdown"><![CDATA[
  5646. ## Remarks
  5647. This property corresponds to the "Connect Timeout", "connection timeout", and "timeout" keys within the connection string.
  5648. When opening a connection to a Azure SQL Database, set the connection timeout to 30 seconds.
  5649. ## Examples
  5650. The following example first displays the contents of a connection string that does not specify the "Connect Timeout" value, sets the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectTimeout%2A> property, and then displays the new connection string.
  5651. [!code-csharp[SqlConnectionStringBuilder_ConnectTimeout#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ConnectTimeout.cs#1)]
  5652. ]]></format>
  5653. </remarks>
  5654. </member>
  5655. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ContextConnection">
  5656. <summary>Gets or sets a value that indicates whether a client/server or in-process connection to SQL Server should be made.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ContextConnection" /> property, or <see langword="False" /> if none has been supplied.</value><remarks>
  5657. <format type="text/markdown"><![CDATA[
  5658. ## Remarks
  5659. This property corresponds to the "Context Connection" key within the connection string.
  5660. > [!NOTE]
  5661. > The <xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A> property returns `null` if the connection string for the <xref:Microsoft.Data.SqlClient.SqlConnection> is "context connection=true".
  5662. ]]></format>
  5663. </remarks>
  5664. </member>
  5665. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.CurrentLanguage">
  5666. <summary>Gets or sets the SQL Server Language record name.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.CurrentLanguage" /> property, or <see langword="String.Empty" /> if no value has been supplied.</value><remarks>
  5667. <format type="text/markdown"><![CDATA[
  5668. ## Remarks
  5669. This property corresponds to the "Current Language" and "language" keys within the connection string.
  5670. ]]></format>
  5671. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5672. </member>
  5673. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.DataSource">
  5674. <summary>Gets or sets the name or network address of the instance of SQL Server to connect to.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.DataSource" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5675. <format type="text/markdown"><![CDATA[
  5676. ## Remarks
  5677. This property corresponds to the "Data Source", "server", "address", "addr", and "network address" keys within the connection string. Regardless of which of these values has been supplied within the supplied connection string, the connection string created by the `SqlConnectionStringBuilder` will use the well-known "Data Source" key.
  5678. ## Examples
  5679. The following example demonstrates that the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class converts synonyms for the "Data Source" connection string key into the well-known key:
  5680. [!code-csharp[SqlConnectionStringBuilder_DataSource#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_DataSource.cs#1)]
  5681. ]]></format>
  5682. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5683. </member>
  5684. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.EnclaveAttestationUrl">
  5685. <summary>Gets or sets the enclave attestation Url to be used with enclave based Always Encrypted.</summary><value>The enclave attestation Url.</value><remarks>To be added.</remarks>
  5686. </member>
  5687. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AttestationProtocol">
  5688. <summary>Set/Get the value of Attestation Protocol.</summary><returns>Returns Attestation Protocol.</returns>
  5689. </member>
  5690. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt">
  5691. <summary>Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt" /> property, or <see langword="false" /> if none has been supplied.</value><remarks>
  5692. <format type="text/markdown"><![CDATA[
  5693. ## Remarks
  5694. This property corresponds to the "Encrypt" key within the connection string.
  5695. ]]></format>
  5696. </remarks><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5697. </member>
  5698. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Enlist">
  5699. <summary>Gets or sets a Boolean value that indicates whether the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Enlist" /> property, or <see langword="true" /> if none has been supplied.</value><remarks>
  5700. <format type="text/markdown"><![CDATA[
  5701. ## Remarks
  5702. This property corresponds to the "Enlist" key within the connection string.
  5703. ]]></format>
  5704. </remarks>
  5705. </member>
  5706. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartner">
  5707. <summary>Gets or sets the name or address of the partner server to connect to if the primary server is down.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartner" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>To be added.</remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5708. </member>
  5709. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.InitialCatalog">
  5710. <summary>Gets or sets the name of the database associated with the connection.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.InitialCatalog" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5711. <format type="text/markdown"><![CDATA[
  5712. ## Remarks
  5713. This property corresponds to the "Initial Catalog" and "database" keys within the connection string.
  5714. ## Examples
  5715. The following example creates a simple connection string and then uses the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> class to add the name of the database to the connection string. The code displays the contents of the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.InitialCatalog%2A> property, just to verify that the class was able to convert from the synonym ("Database") to the appropriate property value.
  5716. [!code-csharp[SqlConnectionStringBuilder_InitialCatalog#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_InitialCatalog.cs#1)]
  5717. ]]></format>
  5718. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5719. </member>
  5720. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IntegratedSecurity">
  5721. <summary>Gets or sets a Boolean value that indicates whether User ID and Password are specified in the connection (when <see langword="false" />) or whether the current Windows account credentials are used for authentication (when <see langword="true" />).</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IntegratedSecurity" /> property, or <see langword="false" /> if none has been supplied.</value><remarks>
  5722. <format type="text/markdown"><![CDATA[
  5723. ## Remarks
  5724. This property corresponds to the "Integrated Security" and "trusted_connection" keys within the connection string.
  5725. ## Examples
  5726. The following example converts an existing connection string from using SQL Server Authentication to using integrated security. The example does its work by removing the user name and password from the connection string and then setting the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IntegratedSecurity%2A> property of the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> object.
  5727. > [!NOTE]
  5728. > This example includes a password to demonstrate how <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.
  5729. [!code-csharp[SqlConnectionStringBuilder_IntegratedSecurity#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_IntegratedSecurity.cs#1)]
  5730. ]]></format>
  5731. </remarks>
  5732. </member>
  5733. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IsFixedSize">
  5734. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> has a fixed size.</summary><value>
  5735. <see langword="true" /> in every case, because the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> supplies a fixed-size collection of key/value pairs.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5736. </member>
  5737. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item(System.String)">
  5738. <param name="keyword">The key of the item to get or set.</param><summary>Gets or sets the value associated with the specified key. In C#, this property is the indexer.</summary><value>The value associated with the specified key.</value><remarks>
  5739. <format type="text/markdown"><![CDATA[
  5740. ## Remarks
  5741. Because the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> contains a fixed-size dictionary, trying to add a key that does not exist within the dictionary throws a <xref:System.Collections.Generic.KeyNotFoundException>.
  5742. ## Examples
  5743. The following code, in a console application, creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> and adds key/value pairs to its connection string, using the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item%2A> property.
  5744. [!code-csharp[SqlConnectionStringBuilder2#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder2.cs#1)]
  5745. ]]></format>
  5746. </remarks><exception cref="T:System.ArgumentNullException">
  5747. <paramref name="keyword" /> is a null reference (<see langword="Nothing" /> in Visual Basic).</exception><exception cref="T:System.Collections.Generic.KeyNotFoundException">Tried to add a key that does not exist within the available keys.</exception><exception cref="T:System.FormatException">Invalid value within the connection string (specifically, a Boolean or numeric value was expected but not supplied).</exception>
  5748. </member>
  5749. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys">
  5750. <summary>Gets an <see cref="T:System.Collections.ICollection" /> that contains the keys in the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</summary><value>An <see cref="T:System.Collections.ICollection" /> that contains the keys in the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</value><remarks>
  5751. <format type="text/markdown"><![CDATA[
  5752. ## Remarks
  5753. The order of the values in the <xref:System.Collections.ICollection> is unspecified, but it is the same order as the associated values in the <xref:System.Collections.ICollection> returned by the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values%2A> property.
  5754. ## Examples
  5755. The following console application example creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>. The code loops through the <xref:System.Collections.ICollection> returned by the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys%2A> property displaying the key/value pairs.
  5756. [!code-csharp[SqlConnectionStringBuilder_Keys#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Keys.cs#1)]
  5757. ]]></format>
  5758. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values" /><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item(System.String)" />
  5759. </member>
  5760. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.LoadBalanceTimeout">
  5761. <summary>Gets or sets the minimum time, in seconds, for the connection to live in the connection pool before being destroyed.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.LoadBalanceTimeout" /> property, or 0 if none has been supplied.</value><remarks>
  5762. <format type="text/markdown"><![CDATA[
  5763. ## Remarks
  5764. This property corresponds to the "Load Balance Timeout" and "connection lifetime" keys within the connection string.
  5765. ]]></format>
  5766. </remarks>
  5767. </member>
  5768. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MaxPoolSize">
  5769. <summary>Gets or sets the maximum number of connections allowed in the connection pool for this specific connection string.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MaxPoolSize" /> property, or 100 if none has been supplied.</value><remarks>
  5770. <format type="text/markdown"><![CDATA[
  5771. ## Remarks
  5772. This property corresponds to the "Max Pool Size" key within the connection string.
  5773. ]]></format>
  5774. </remarks>
  5775. </member>
  5776. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MinPoolSize">
  5777. <summary>Gets or sets the minimum number of connections allowed in the connection pool for this specific connection string.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MinPoolSize" /> property, or 0 if none has been supplied.</value><remarks>
  5778. <format type="text/markdown"><![CDATA[
  5779. ## Remarks
  5780. This property corresponds to the "Min Pool Size" key within the connection string.
  5781. ]]></format>
  5782. </remarks>
  5783. </member>
  5784. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultipleActiveResultSets">
  5785. <summary>When true, an application can maintain multiple active result sets (MARS). When false, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection. For more information, see [Multiple Active Result Sets (MARS)](https://msdn.microsoft.com//library/cfa084cz.aspx).</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultipleActiveResultSets" /> property, or <see langword="false" /> if none has been supplied.</value><remarks>
  5786. <format type="text/markdown"><![CDATA[
  5787. ## Remarks
  5788. This property corresponds to the "MultipleActiveResultSets" key within the connection string.
  5789. ## Examples
  5790. The following example explicitly disables the Multiple Active Result Sets feature.
  5791. [!code-csharp[SqlConnectionStringBuilder_MultipleActiveResultSets.MARS#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_MultipleActiveResultSets.cs#1)]
  5792. ]]></format>
  5793. </remarks>
  5794. </member>
  5795. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultiSubnetFailover">
  5796. <summary>If your application is connecting to an AlwaysOn availability group (AG) on different subnets, setting MultiSubnetFailover=true provides faster detection of and connection to the (currently) active server. For more information about SqlClient support for Always On Availability Groups, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).</summary><value>Returns <see cref="T:System.Boolean" /> indicating the current value of the property.</value><remarks>To be added.</remarks>
  5797. </member>
  5798. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.NetworkLibrary">
  5799. <summary>Gets or sets a string that contains the name of the network library used to establish a connection to the SQL Server.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.NetworkLibrary" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5800. <format type="text/markdown"><![CDATA[
  5801. ## Remarks
  5802. This property corresponds to the "Network Library", "network", and "net" keys within the connection string.
  5803. Supported values for this property include dbnmpntw (Named Pipes), dbmsrpcn (Multiprotocol), dbmsadsn (AppleTalk), dbmsgnet (VIA), dbmslpcn (Shared Memory) and dbmsspxn (IPX/SPX), and dbmssocn (TCP/IP). The corresponding network DLL must be installed on the system to which you connect. If you do not specify a network and you use a local server (for example, "." or "(local)"), Shared Memory is used.
  5804. ]]></format>
  5805. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5806. </member>
  5807. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PacketSize">
  5808. <summary>Gets or sets the size in bytes of the network packets used to communicate with an instance of SQL Server.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PacketSize" /> property, or 8000 if none has been supplied.</value><remarks>
  5809. <format type="text/markdown"><![CDATA[
  5810. ## Remarks
  5811. This property corresponds to the "Packet Size" key within the connection string.
  5812. ]]></format>
  5813. </remarks>
  5814. </member>
  5815. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password">
  5816. <summary>Gets or sets the password for the SQL Server account.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5817. <format type="text/markdown"><![CDATA[
  5818. ## Remarks
  5819. This property corresponds to the "Password" and "pwd" keys within the connection string.
  5820. If <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password%2A> has not been set and you retrieve the value, the return value is <xref:System.String.Empty>. To reset the password for the connection string, pass null to the Item property.
  5821. ## Examples
  5822. The following example shows how to set <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password%2A>.
  5823. [!code-csharp[SqlConnectionStringBuilder_Password#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Password.cs#1)]
  5824. ]]></format>
  5825. </remarks><exception cref="T:System.ArgumentNullException">The password was incorrectly set to null. See code sample below.</exception>
  5826. </member>
  5827. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PersistSecurityInfo">
  5828. <summary>Gets or sets a Boolean value that indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PersistSecurityInfo" /> property, or <see langword="false" /> if none has been supplied.</value><remarks>
  5829. <format type="text/markdown"><![CDATA[
  5830. ## Remarks
  5831. This property corresponds to the "Persist Security Info" and "persistsecurityinfo" keys within the connection string.
  5832. ]]></format>
  5833. </remarks>
  5834. </member>
  5835. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod">
  5836. <summary>The blocking period behavior for a connection pool.</summary><value>The available blocking period settings.</value><remarks>
  5837. <format type="text/markdown"><![CDATA[
  5838. ## Remarks
  5839. When connection pooling is enabled and a timeout error or other login error occurs, an exception will be thrown and subsequent connection attempts will fail for the next five seconds, the "blocking period". If the application attempts to connect within the blocking period, the first exception will be thrown again. Subsequent failures after a blocking period ends will result in a new blocking period that is twice as long as the previous blocking period, up to a maximum of one minute.
  5840. Attempting to connect to Azure SQL databases can fail with transient errors which are typically recovered within a few seconds. However, with the connection pool blocking period behavior, you may not be able to reach your database for extensive periods even though the database is available. This is especially problematic for apps that need to render fast. The **PoolBlockingPeriod** enables you to select the blocking period best suited for your app. See the <xref:Microsoft.Data.SqlClient.PoolBlockingPeriod> enumeration for available settings.
  5841. ]]></format>
  5842. </remarks>
  5843. </member>
  5844. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Pooling">
  5845. <summary>Gets or sets a Boolean value that indicates whether the connection will be pooled or explicitly opened every time that the connection is requested.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Pooling" /> property, or <see langword="true" /> if none has been supplied.</value><remarks>
  5846. <format type="text/markdown"><![CDATA[
  5847. ## Remarks
  5848. This property corresponds to the "Pooling" key within the connection string.
  5849. ]]></format>
  5850. </remarks>
  5851. </member>
  5852. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Replication">
  5853. <summary>Gets or sets a Boolean value that indicates whether replication is supported using the connection.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Replication" /> property, or false if none has been supplied.</value><remarks>
  5854. <format type="text/markdown"><![CDATA[
  5855. ## Remarks
  5856. This property corresponds to the "Replication" key within the connection string.
  5857. ]]></format>
  5858. </remarks>
  5859. </member>
  5860. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding">
  5861. <summary>Gets or sets a string value that indicates how the connection maintains its association with an enlisted <see langword="System.Transactions" /> transaction.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5862. <format type="text/markdown"><![CDATA[
  5863. ## Remarks
  5864. The Transaction Binding keywords in a <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> control how a <xref:Microsoft.Data.SqlClient.SqlConnection> binds to an enlisted <xref:System.Transactions.Transaction>.
  5865. The following table shows the possible values for the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding%2A> property:
  5866. |Value|Description|
  5867. |-----------|-----------------|
  5868. |Implicit Unbind|The default. Causes the connection to detach from the transaction when it ends. After detaching, additional requests on the connection are performed in autocommit mode. The <xref:System.Transactions.Transaction.Current%2A> property is not checked when executing requests while the transaction is active. After the transaction has ended, additional requests are performed in autocommit mode.|
  5869. |Explicit Unbind|Causes the connection to remain attached to the transaction until the connection is closed or until <xref:Microsoft.Data.SqlClient.SqlConnection.EnlistTransaction%2A> is called with a `null` (`Nothing` in Visual Basic) value. An <xref:System.InvalidOperationException> is thrown if <xref:System.Transactions.Transaction.Current%2A> is not the enlisted transaction or if the enlisted transaction is not active. This behavior enforces the strict scoping rules required for <xref:System.Transactions.TransactionScope> support.|
  5870. ]]></format>
  5871. </remarks>
  5872. </member>
  5873. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransparentNetworkIPResolution">
  5874. <summary>When the value of this key is set to <see langword="true" />, the application is required to retrieve all IP addresses for a particular DNS entry and attempt to connect with the first one in the list. If the connection is not established within 0.5 seconds, the application will try to connect to all others in parallel. When the first answers, the application will establish the connection with the respondent IP address.</summary><value>A boolean value.</value><remarks>
  5875. <format type="text/markdown"><![CDATA[
  5876. ## Remarks
  5877. If the `MultiSubnetFailover` key is set to `true`, `TransparentNetworkIPResolution` is ignored.
  5878. If the `Failover Partner` key is set, `TransparentNetworkIPResolution` is ignored.
  5879. The value of this key must be `true`, `false`, `yes`, or `no`.
  5880. A value of `yes` is treated the same as a value of `true`.
  5881. A value of `no` is treated the same as a value of `false`.
  5882. This key defaults to `false` when:
  5883. - Connecting to Azure SQL Database where the data source ends with:
  5884. - .database.chinacloudapi.cn
  5885. - .database.usgovcloudapi.net
  5886. - .database.cloudapi.de
  5887. - .database.windows.net
  5888. - `Authentication` is 'Active Directory Password' or 'Active Directory Integrated'
  5889. Otherwise it defaults to `true`.
  5890. ]]></format>
  5891. </remarks>
  5892. </member>
  5893. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TrustServerCertificate">
  5894. <summary>Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.</summary><value>A <see langword="Boolean" />. Recognized values are <see langword="true" />, <see langword="false" />, <see langword="yes" />, and <see langword="no" />.</value><remarks>
  5895. <format type="text/markdown"><![CDATA[
  5896. ## Remarks
  5897. When `TrustServerCertificate` is set to `true`, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. If `TrustServerCertificate` is set to `true` and encryption is turned on, the encryption level specified on the server will be used even if `Encrypt` is set to `false`. The connection will fail otherwise.
  5898. For more information, see [Encryption Hierarchy](/sql/relational-databases/security/encryption/encryption-hierarchy) and [Using Encryption Without Validation](/sql/relational-databases/native-client/features/using-encryption-without-validation).
  5899. ]]></format>
  5900. </remarks>
  5901. </member>
  5902. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TypeSystemVersion">
  5903. <summary>Gets or sets a string value that indicates the type system the application expects.</summary><value>The following table shows the possible values for the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TypeSystemVersion" /> property:
  5904. <list type="table"><listheader><term> Value
  5905. </term><description> Description
  5906. </description></listheader><item><term> SQL Server 2005
  5907. </term><description> Uses the SQL Server 2005 type system. No conversions are made for the current version of ADO.NET.
  5908. </description></item><item><term> SQL Server 2008
  5909. </term><description> Uses the SQL Server 2008 type system.
  5910. </description></item><item><term> Latest
  5911. </term><description> Use the latest version than this client-server pair can handle. This will automatically move forward as the client and server components are upgraded.
  5912. </description></item></list></value><remarks>
  5913. <format type="text/markdown"><![CDATA[
  5914. ## Remarks
  5915. The `TypeSystemVersion` property can be used to specify a down-level version of SQL Server for applications written against that version. This avoids possible problems with incompatible types in a newer version of SQL Server that may cause the application to break.
  5916. ]]></format>
  5917. </remarks>
  5918. </member>
  5919. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserID">
  5920. <summary>Gets or sets the user ID to be used when connecting to SQL Server.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserID" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5921. <format type="text/markdown"><![CDATA[
  5922. ## Remarks
  5923. This property corresponds to the "User ID", "user", and "uid" keys within the connection string.
  5924. ]]></format>
  5925. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5926. </member>
  5927. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserInstance">
  5928. <summary>Gets or sets a value that indicates whether to redirect the connection from the default SQL Server Express instance to a runtime-initiated instance running under the account of the caller.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserInstance" /> property, or <see langword="False" /> if none has been supplied.</value><remarks>
  5929. <format type="text/markdown"><![CDATA[
  5930. ## Remarks
  5931. This property corresponds to the "User Instance" key within the connection string.
  5932. > [!NOTE]
  5933. > This feature is available only with the SQL Server Express Edition. For more information on user instances, see [SQL Server Express User Instances](~/docs/framework/data/adonet/sql/sql-server-express-user-instances.md).
  5934. ]]></format>
  5935. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5936. </member>
  5937. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values">
  5938. <summary>Gets an <see cref="T:System.Collections.ICollection" /> that contains the values in the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</summary><value>An <see cref="T:System.Collections.ICollection" /> that contains the values in the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</value><remarks>
  5939. <format type="text/markdown"><![CDATA[
  5940. ## Remarks
  5941. The order of the values in the <xref:System.Collections.ICollection> is unspecified, but it is the same order as the associated keys in the <xref:System.Collections.ICollection> returned by the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys%2A> property. Because each instance of the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> always contains the same fixed set of keys, the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values%2A> property always returns the values corresponding to the fixed set of keys, in the same order as the keys.
  5942. ## Examples
  5943. The following example first creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>, and then iterates through all the values within the object.
  5944. [!code-csharp[SqlConnectionStringBuilder_Values#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Values.cs#1)]
  5945. ]]></format>
  5946. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys" />
  5947. </member>
  5948. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.WorkstationID">
  5949. <summary>Gets or sets the name of the workstation connecting to SQL Server.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.WorkstationID" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5950. <format type="text/markdown"><![CDATA[
  5951. ## Remarks
  5952. This property corresponds to the "Workstation ID" and "wsid" keys within the connection string.
  5953. ]]></format>
  5954. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5955. </member>
  5956. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Clear">
  5957. <summary>Clears the contents of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> instance.</summary><remarks>
  5958. <format type="text/markdown"><![CDATA[
  5959. ## Remarks
  5960. The <xref:System.Data.Common.DbConnectionStringBuilder.Clear%2A> method removes all key/value pairs from the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>, and resets all corresponding properties. This includes setting the <xref:System.Data.Common.DbConnectionStringBuilder.Count%2A> property to 0, and setting the <xref:System.Data.Common.DbConnectionStringBuilder.ConnectionString%2A> property to an empty string.
  5961. ## Examples
  5962. The following example demonstrates calling the <xref:System.Data.Common.DbConnectionStringBuilder.Clear%2A> method. This example populates the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> with some key/value pairs, and then calls the <xref:System.Data.Common.DbConnectionStringBuilder.Clear%2A> method and shows the results.
  5963. [!code-csharp[DataWorks SqlConnectionStringBuilder_Clear#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Clear.cs#1)]
  5964. ]]></format>
  5965. </remarks>
  5966. </member>
  5967. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ContainsKey(System.String)">
  5968. <param name="keyword">The key to locate in the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</param><summary>Determines whether the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> contains a specific key.</summary><returns>true if the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> contains an element that has the specified key; otherwise, false.</returns><remarks>
  5969. <format type="text/markdown"><![CDATA[
  5970. ## Remarks
  5971. Because the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> contains a fixed-size collection of key/value pairs, the <xref:System.Data.Common.DbConnectionStringBuilder.ContainsKey%2A> method determines only if a particular key name is valid.
  5972. ## Examples
  5973. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> instance, sets some of its properties, and then tries to determine whether various keys exist within the object by calling the **ContainsKey** method.
  5974. [!code-csharp[SqlConnectionStringBuilder_ContainsKey#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ContainsKey.cs#1)]
  5975. The example displays the following output in the console window:
  5976. ```
  5977. Connection string = Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  5978. True
  5979. True
  5980. True
  5981. False
  5982. ```
  5983. ]]></format>
  5984. </remarks><exception cref="T:System.ArgumentNullException">
  5985. <paramref name="keyword" /> is null (<see langword="Nothing" /> in Visual Basic)</exception>
  5986. </member>
  5987. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Remove(System.String)">
  5988. <param name="keyword">The key of the key/value pair to be removed from the connection string in this <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</param><summary>Removes the entry with the specified key from the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> instance.</summary><returns>
  5989. <see langword="true" /> if the key existed within the connection string and was removed; <see langword="false" /> if the key did not exist.</returns><remarks>
  5990. <format type="text/markdown"><![CDATA[
  5991. ## Remarks
  5992. Because the **Remove** method returns a value that indicates its success, it is not required to look for a key before trying to remove the key/value pair from the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> instance. Because the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> maintains a fixed-size collection of key/value pairs, calling the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Remove%2A> method simply resets the value of the key/value pair back to its default value.
  5993. Because the collection of keys supported by the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> is fixed, every item within the collection has a known default value. The following table lists the keys, and the value for each when the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> is first initialized, or after the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Remove%2A> method has been called.
  5994. |Key|Default value|
  5995. |---------|-------------------|
  5996. |Application Name|".Net SqlClient Data Provider"|
  5997. |Asynchronous Processing|False|
  5998. |AttachDBFilename|Empty string|
  5999. |Connection Timeout|15|
  6000. |Context Connection|False|
  6001. |Current Language|Empty string|
  6002. |Data Source|Empty string|
  6003. |Encrypt|False|
  6004. |Enlist|True|
  6005. |Failover Partner|Empty string|
  6006. |Initial Catalog|Empty string|
  6007. |Integrated Security|False|
  6008. |Load Balance Timeout|0|
  6009. |Max Pool Size|100|
  6010. |Min Pool Size|0|
  6011. |MultipleActiveResultSets|False|
  6012. |Network Library|Empty string|
  6013. |Packet Size|8000|
  6014. |Password|Empty string|
  6015. |Persist Security Info|False|
  6016. |Pooling|True|
  6017. |Replication|False|
  6018. |Transaction Binding|Implicit Unbind|
  6019. |User ID|Empty string|
  6020. |User Instance|False|
  6021. |Workstation ID|Empty string|
  6022. ## Examples
  6023. The following example converts an existing connection string from using Windows Authentication to using integrated security. The example works by removing the user name and password from the connection string, and then setting the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IntegratedSecurity%2A> property of the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> object.
  6024. > [!NOTE]
  6025. > This example includes a password to demonstrate how <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application.
  6026. [!code-csharp[SqlConnectionStringBuilder_Remove#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Remove.cs#1)]
  6027. The example displays the following text in the console window:
  6028. ```
  6029. Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password= a1Pass@@11
  6030. Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  6031. Database = AdventureWorks
  6032. ```
  6033. ]]></format>
  6034. </remarks><exception cref="T:System.ArgumentNullException">
  6035. <paramref name="keyword" /> is null (<see langword="Nothing" /> in Visual Basic)</exception>
  6036. </member>
  6037. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ShouldSerialize(System.String)">
  6038. <param name="keyword">The key to locate in the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</param><summary>Indicates whether the specified key exists in this <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> instance.</summary><returns>
  6039. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> contains an entry with the specified key; otherwise, <see langword="false" />.</returns><remarks>
  6040. <format type="text/markdown"><![CDATA[
  6041. ## Remarks
  6042. This method behaves identically to the <xref:System.Data.Common.DbConnectionStringBuilder.ContainsKey%2A> method.
  6043. ]]></format>
  6044. </remarks>
  6045. </member>
  6046. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TryGetValue(System.String,System.Object@)">
  6047. <param name="keyword">The key of the item to retrieve.</param><param name="value">The value corresponding to <paramref name="keyword" />.</param><summary>Retrieves a value corresponding to the supplied key from this <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" />.</summary><returns>
  6048. <see langword="true" /> if <paramref name="keyword" /> was found within the connection string; otherwise, <see langword="false" />.</returns><remarks>
  6049. <format type="text/markdown"><![CDATA[
  6050. ## Remarks
  6051. The <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TryGetValue%2A> method lets developers safely retrieve a value from a <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> without needing to verify that the supplied key name is a valid key name. Because **TryGetValue** does not raise an exception when you call it, passing in a nonexistent key, you do not have to look for a key before retrieving its value. Calling **TryGetValue** with a nonexistent key will place the value null (`Nothing` in Visual Basic) in the `value` parameter.
  6052. ## Examples
  6053. The following example demonstrates the behavior of the **TryGetValue** method.
  6054. [!code-csharp[SqlConnectionStringBuilder_TryGetValue#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs#1)]
  6055. The sample displays the following results:
  6056. ```
  6057. Data Source=(local)
  6058. Trusted_Connection=True
  6059. Unable to retrieve value for 'InvalidKey'
  6060. Unable to retrieve value for null key.
  6061. ```
  6062. ]]></format>
  6063. </remarks><exception cref="T:System.ArgumentNullException">
  6064. <paramref name="keyword" /> contains a null value (<see langword="Nothing" /> in Visual Basic).</exception>
  6065. </member>
  6066. <member name="T:Microsoft.Data.SqlClient.SqlCredential">
  6067. <summary>
  6068. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> provides a more secure way to specify the password for a login attempt using SQL Server Authentication.
  6069. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> is comprised of a user id and a password that will be used for SQL Server Authentication. The password in a <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object is of type <see cref="T:System.Security.SecureString" />.
  6070. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> cannot be inherited.
  6071. Windows Authentication (<see langword="Integrated Security = true" />) remains the most secure way to log in to a SQL Server database.</summary><remarks>
  6072. <format type="text/markdown"><![CDATA[
  6073. ## Remarks
  6074. Use <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> to get or set a connection's <xref:Microsoft.Data.SqlClient.SqlCredential> object. Use <xref:Microsoft.Data.SqlClient.SqlConnection.ChangePassword%2A> to change the password for a <xref:Microsoft.Data.SqlClient.SqlCredential> object. For information on how a <xref:Microsoft.Data.SqlClient.SqlCredential> object affects connection pool behavior, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  6075. An <xref:System.InvalidOperationException> exception will be raised if a non-null <xref:Microsoft.Data.SqlClient.SqlCredential> object is used in a connection with any of the following connection string keywords:
  6076. - `Integrated Security = true`
  6077. - `Password`
  6078. - `User ID`
  6079. - `Context Connection = true`
  6080. The following sample connects to a SQL Server database using <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A>:
  6081. ```
  6082. // change connection string in the APP.CONFIG file
  6083. <connectionStrings>
  6084. <add name="MyConnString"
  6085. connectionString="Initial Catalog=myDB;Server=myServer"
  6086. providerName="Microsoft.Data.SqlClient" />
  6087. </connectionStrings>
  6088. // then use the following snippet:
  6089. using System.Configuration;
  6090. System.Windows.Controls.TextBox txtUserId = new System.Windows.Controls.TextBox();
  6091. System.Windows.Controls.PasswordBox txtPwd = new System.Windows.Controls.PasswordBox();
  6092. Configuration config = Configuration.WebConfigurationManager.OpenWebConfiguration(Null);
  6093. ConnectionStringSettings connString = config.ConnectionStrings.ConnectionString["MyConnString"];
  6094. using (SqlConnection conn = new SqlConnection(connString.ConnectionString))
  6095. {
  6096. SecureString pwd = txtPwd.SecurePassword;
  6097. pwd.MakeReadOnly();
  6098. SqlCredential cred = new SqlCredential(txtUserId.Text, pwd);
  6099. conn.Credential = cred;
  6100. conn.Open();
  6101. }
  6102. ```
  6103. ]]></format>
  6104. </remarks>
  6105. </member>
  6106. <member name="M:Microsoft.Data.SqlClient.SqlCredential.#ctor(System.String,System.Security.SecureString)">
  6107. <param name="userId">The user id.</param><param name="password">The password; a <see cref="T:System.Security.SecureString" /> value marked as read-only. Passing a read/write <see cref="T:System.Security.SecureString" /> parameter will raise an <see cref="T:System.ArgumentException" />.</param><summary>Creates an object of type <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />.</summary><remarks>
  6108. <format type="text/markdown"><![CDATA[
  6109. ## Remarks
  6110. The constructor does not accept null parameters. A <xref:System.String.Empty> value is allowed. An attempt to pass a null parameter in the constructor will raise an <xref:System.ArgumentNullException> exception.
  6111. ]]></format>
  6112. </remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  6113. </member>
  6114. <member name="P:Microsoft.Data.SqlClient.SqlCredential.Password">
  6115. <summary>Gets the password component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</summary><value>The password component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</value><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  6116. </member>
  6117. <member name="P:Microsoft.Data.SqlClient.SqlCredential.UserId">
  6118. <summary>Gets the user ID component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</summary><value>The user ID component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</value><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  6119. </member>
  6120. <member name="T:Microsoft.Data.SqlClient.SqlDataAdapter">
  6121. <summary>Represents a set of data commands and a database connection that are used to fill the <see cref="T:System.Data.DataSet" /> and update a SQL Server database. This class cannot be inherited.</summary><remarks>
  6122. <format type="text/markdown"><![CDATA[
  6123. ## Remarks
  6124. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter>, serves as a bridge between a <xref:System.Data.DataSet> and SQL Server for retrieving and saving data. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter> provides this bridge by mapping <xref:System.Data.Common.DbDataAdapter.Fill%2A>, which changes the data in the <xref:System.Data.DataSet> to match the data in the data source, and <xref:System.Data.Common.DbDataAdapter.Update%2A>, which changes the data in the data source to match the data in the <xref:System.Data.DataSet>, using the appropriate Transact-SQL statements against the data source. The update is performed on a by-row basis. For every inserted, modified, and deleted row, the <xref:System.Data.Common.DbDataAdapter.Update%2A> method determines the type of change that has been performed on it (`Insert`, `Update`, or `Delete`). Depending on the type of change, the `Insert`, `Update`, or `Delete` command template executes to propagate the modified row to the data source. When the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> fills a <xref:System.Data.DataSet>, it creates the necessary tables and columns for the returned data if they do not already exist. However, primary key information is not included in the implicitly created schema unless the <xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A> property is set to <xref:System.Data.MissingSchemaAction.AddWithKey>. You may also have the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> create the schema of the <xref:System.Data.DataSet>, including primary key information, before filling it with data using `FillSchema`. For more information, see [Adding Existing Constraints to a DataSet](~/docs/framework/data/adonet/adding-existing-constraints-to-a-dataset.md).
  6125. <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is used in conjunction with <xref:Microsoft.Data.SqlClient.SqlConnection> and <xref:Microsoft.Data.SqlClient.SqlCommand> to increase performance when connecting to a SQL Server database.
  6126. > [!NOTE]
  6127. > If you are using SQL Server stored procedures to edit or delete data using a `DataAdapter`, make sure that you do not use SET NOCOUNT ON in the stored procedure definition. This causes the rows affected count returned to be zero, which the `DataAdapter` interprets as a concurrency conflict. In this event, a <xref:System.Data.DBConcurrencyException> will be thrown.
  6128. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter> also includes the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A>, and <xref:System.Data.Common.DataAdapter.TableMappings%2A> properties to facilitate the loading and updating of data.
  6129. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the read/write properties are set to initial values. For a list of these values, see the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> constructor.
  6130. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A>, and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A> are generic templates that are automatically filled with individual values from every modified row through the parameters mechanism.
  6131. For every column that you propagate to the data source on <xref:System.Data.Common.DbDataAdapter.Update%2A>, a parameter should be added to the `InsertCommand`, `UpdateCommand`, or `DeleteCommand`. The <xref:System.Data.Common.DbParameter.SourceColumn%2A> property of the <xref:System.Data.Common.DbParameter> object should be set to the name of the column. This setting indicates that the value of the parameter is not set manually, but is taken from the particular column in the currently processed row.
  6132. > [!NOTE]
  6133. > An <xref:System.InvalidOperationException> will occur if the <xref:System.Data.Common.DbDataAdapter.Fill%2A> method is called and the table contains a user-defined type that is not available on the client computer. For more information, see [CLR User-Defined Types](/sql/relational-databases/clr-integration-database-objects-user-defined-types/clr-user-defined-types).
  6134. ## Examples
  6135. The following example uses the <xref:Microsoft.Data.SqlClient.SqlCommand>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter>, and <xref:Microsoft.Data.SqlClient.SqlConnection> to select records from a database and populate a <xref:System.Data.DataSet> with the selected rows. The filled <xref:System.Data.DataSet> is then returned. To accomplish this, the method is passed an initialized <xref:System.Data.DataSet>, a connection string, and a query string that is a Transact-SQL SELECT statement.
  6136. [!code-csharp[SqlDataAdapter_SelectCommand Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SelectCommand.cs#1)]
  6137. ]]></format>
  6138. </remarks>
  6139. </member>
  6140. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor">
  6141. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> class.</summary><remarks>
  6142. <format type="text/markdown"><![CDATA[
  6143. ## Remarks
  6144. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6145. |Properties|Initial value|
  6146. |----------------|-------------------|
  6147. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6148. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6149. You can change the value of any of these properties through a separate call to the property.
  6150. ## Examples
  6151. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6152. [!code-csharp[SqlDataAdapter.SqlDataAdapter Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter.cs#1)]
  6153. ]]></format>
  6154. </remarks>
  6155. </member>
  6156. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(Microsoft.Data.SqlClient.SqlCommand)">
  6157. <param name="selectCommand">A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> that is a Transact-SQL SELECT statement or stored procedure and is set as the <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand" /> property of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> class with the specified <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> as the <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand" /> property.</summary><remarks>
  6158. <format type="text/markdown"><![CDATA[
  6159. ## Remarks
  6160. This implementation of the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> constructor sets the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property to the value specified in the `selectCommand` parameter.
  6161. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6162. |Properties|Initial value|
  6163. |----------------|-------------------|
  6164. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6165. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6166. You can change the value of any of these properties through a separate call to the property.
  6167. When <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> (or any of the other command properties) is assigned to a previously created <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlCommand> is not cloned. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> maintains a reference to the previously created <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6168. ## Examples
  6169. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6170. [!code-csharp[SqlDataAdapter_SqlDataAdapter1 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter1.cs#1)]
  6171. ]]></format>
  6172. </remarks>
  6173. </member>
  6174. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)">
  6175. <param name="selectCommandText">A <see cref="T:System.String" /> that is a Transact-SQL SELECT statement or stored procedure to be used by the <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand" /> property of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />.</param><param name="selectConnection">A <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> that represents the connection. If your connection string does not use <see langword="Integrated Security = true" />, you can use <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> class with a <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand" /> and a <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> object.</summary><remarks>
  6176. <format type="text/markdown"><![CDATA[
  6177. ## Remarks
  6178. This implementation of the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> opens and closes a <xref:Microsoft.Data.SqlClient.SqlConnection> if it is not already open. This can be useful in an application that must call the <xref:System.Data.Common.DbDataAdapter.Fill%2A> method for two or more <xref:Microsoft.Data.SqlClient.SqlDataAdapter> objects. If the <xref:Microsoft.Data.SqlClient.SqlConnection> is already open, you must explicitly call **Close** or **Dispose** to close it.
  6179. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6180. |Properties|Initial value|
  6181. |----------------|-------------------|
  6182. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6183. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6184. You can change the value of either of these properties through a separate call to the property.
  6185. ## Examples
  6186. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6187. [!code-csharp[SqlDataAdapter_SqlDataAdapter3 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter3.cs#1)]
  6188. ]]></format>
  6189. </remarks>
  6190. </member>
  6191. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,System.String)">
  6192. <param name="selectCommandText">A <see cref="T:System.String" /> that is a Transact-SQL SELECT statement or stored procedure to be used by the <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand" /> property of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />.</param><param name="selectConnectionString">The connection string. If your connection string does not use <see langword="Integrated Security = true" />, you can use <see cref="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)" /> and <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> class with a <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand" /> and a connection string.</summary><remarks>
  6193. <format type="text/markdown"><![CDATA[
  6194. ## Remarks
  6195. This overload of the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> constructor uses the `selectCommandText` parameter to set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter> will create and maintain the connection created with the `selectConnectionString` parameter.
  6196. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6197. |Properties|Initial value|
  6198. |----------------|-------------------|
  6199. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6200. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6201. You can change the value of any of these properties through a separate call to the property.
  6202. ## Examples
  6203. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6204. [!code-csharp[SqlDataAdapter_SqlDataAdapter2 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter2.cs#1)]
  6205. ]]></format>
  6206. </remarks>
  6207. </member>
  6208. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand">
  6209. <summary>Gets or sets a Transact-SQL statement or stored procedure to delete records from the data set.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> used during <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> to delete records in the database that correspond to deleted rows in the <see cref="T:System.Data.DataSet" />.</value><remarks>
  6210. <format type="text/markdown"><![CDATA[
  6211. ## Remarks
  6212. During <xref:System.Data.Common.DbDataAdapter.Update%2A>, if this property is not set and primary key information is present in the <xref:System.Data.DataSet>, the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> can be generated automatically if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property and use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. Then, any additional commands that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. This generation logic requires key column information to be present in the <xref:System.Data.DataSet>. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  6213. When <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> is assigned to a previously created <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlCommand> is not cloned. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> maintains a reference to the previously created <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6214. For every column that you propagate to the data source on <xref:System.Data.Common.DbDataAdapter.Update%2A>, a parameter should be added to the `InsertCommand`, `UpdateCommand`, or `DeleteCommand`. The `SourceColumn` property of the parameter should be set to the name of the column. This indicates that the value of the parameter is not set manually, but is taken from the particular column in the currently processed row.
  6215. ## Examples
  6216. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A>, and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> properties. It assumes you have already created a <xref:Microsoft.Data.SqlClient.SqlConnection> object.
  6217. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  6218. ]]></format>
  6219. </remarks>
  6220. </member>
  6221. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand">
  6222. <summary>Gets or sets a Transact-SQL statement or stored procedure to insert new records into the data source.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> used during <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> to insert records into the database that correspond to new rows in the <see cref="T:System.Data.DataSet" />.</value><remarks>
  6223. <format type="text/markdown"><![CDATA[
  6224. ## Remarks
  6225. During <xref:System.Data.Common.DbDataAdapter.Update%2A>, if this property is not set and primary key information is present in the <xref:System.Data.DataSet>, the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A> can be generated automatically if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property and use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. Then, any additional commands that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. This generation logic requires key column information to be present in the <xref:System.Data.DataSet>. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  6226. When <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A> is assigned to a previously created <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlCommand> is not cloned. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A> maintains a reference to the previously created <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6227. If execution of this command returns rows, these rows can be added to the <xref:System.Data.DataSet> depending on how you set the **UpdatedRowSource** property of the <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6228. For every column that you propagate to the data source on <xref:System.Data.Common.DbDataAdapter.Update%2A>, a parameter should be added to `InsertCommand`, `UpdateCommand`, or `DeleteCommand`. The `SourceColumn` property of the parameter should be set to the name of the column. This indicates that the value of the parameter is not set manually, but is taken from the particular column in the currently processed row.
  6229. ## Examples
  6230. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A>, and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> properties. It assumes you have already created a <xref:Microsoft.Data.SqlClient.SqlConnection> object.
  6231. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  6232. ]]></format>
  6233. </remarks>
  6234. </member>
  6235. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand">
  6236. <summary>Gets or sets a Transact-SQL statement or stored procedure used to select records in the data source.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> used during <see cref="M:System.Data.Common.DbDataAdapter.Fill(System.Data.DataSet)" /> to select records from the database for placement in the <see cref="T:System.Data.DataSet" />.</value><remarks>
  6237. <format type="text/markdown"><![CDATA[
  6238. ## Remarks
  6239. When <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> is assigned to a previously created <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlCommand> is not cloned. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> maintains a reference to the previously created <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6240. If the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> does not return any rows, no tables are added to the <xref:System.Data.DataSet>, and no exception is raised.
  6241. ## Examples
  6242. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A>, and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> properties. It assumes you have already created a <xref:Microsoft.Data.SqlClient.SqlConnection> object.
  6243. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  6244. ]]></format>
  6245. </remarks>
  6246. </member>
  6247. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize">
  6248. <summary>Gets or sets the number of rows that are processed in each round-trip to the server.</summary><value>The number of rows to process per-batch.
  6249. <list type="table"><listheader><term> Value is
  6250. </term><description> Effect
  6251. </description></listheader><item><term> 0
  6252. </term><description> There is no limit on the batch size.
  6253. </description></item><item><term> 1
  6254. </term><description> Disables batch updating.
  6255. </description></item><item><term> &gt;1
  6256. </term><description> Changes are sent using batches of <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize" /> operations at a time.
  6257. </description></item></list>
  6258. When setting this to a value other than 1, all the commands associated with the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> have to have their **UpdatedRowSource** property set to <see langword="None" /> or <see langword="OutputParameters" />. An exception is thrown otherwise.</value><remarks>
  6259. <format type="text/markdown"><![CDATA[
  6260. ## Remarks
  6261. Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch.
  6262. Use the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize%2A> property to update a data source with changes from a <xref:System.Data.DataSet>. This can increase application performance by reducing the number of round-trips to the server.
  6263. Executing an extremely large batch could decrease performance. Therefore, you should test for the optimum batch size setting before implementing your application.
  6264. An <xref:System.ArgumentOutOfRangeException> is thrown if the value is set to a number less than zero.
  6265. ]]></format>
  6266. </remarks>
  6267. </member>
  6268. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand">
  6269. <summary>Gets or sets a Transact-SQL statement or stored procedure used to update records in the data source.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> used during <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> to update records in the database that correspond to modified rows in the <see cref="T:System.Data.DataSet" />.</value><remarks>
  6270. <format type="text/markdown"><![CDATA[
  6271. ## Remarks
  6272. During <xref:System.Data.Common.DbDataAdapter.Update%2A>, if this property is not set and primary key information is present in the <xref:System.Data.DataSet>, the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A> can be generated automatically if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property and use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. Then, any additional commands that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. This generation logic requires key column information to be present in the <xref:System.Data.DataSet>. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  6273. When <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A> is assigned to a previously created <xref:Microsoft.Data.SqlClient.SqlCommand>, the <xref:Microsoft.Data.SqlClient.SqlCommand> is not cloned. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A> maintains a reference to the previously created <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6274. > [!NOTE]
  6275. > If execution of this command returns rows, the updated rows may be merged with the <xref:System.Data.DataSet> depending on how you set the **UpdatedRowSource** property of the <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  6276. For every column that you propagate to the data source on <xref:System.Data.Common.DbDataAdapter.Update%2A>, a parameter should be added to `InsertCommand`, `UpdateCommand`, or `DeleteCommand`.
  6277. The `SourceColumn` property of the parameter should be set to the name of the column. This indicates that the value of the parameter is not set manually, but taken from the particular column in the currently processed row.
  6278. ## Examples
  6279. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A>, <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> properties. It assumes you have already created a <xref:Microsoft.Data.SqlClient.SqlConnection> object.
  6280. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  6281. ]]></format>
  6282. </remarks>
  6283. </member>
  6284. <member name="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated">
  6285. <summary>Occurs during <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> after a command is executed against the data source. The attempt to update is made, so the event fires.</summary><remarks>
  6286. <format type="text/markdown"><![CDATA[
  6287. ## Remarks
  6288. When using <xref:System.Data.Common.DbDataAdapter.Update%2A>, there are two events that occur per data row updated. The order of execution is as follows:
  6289. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  6290. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  6291. 3. The command executes.
  6292. 4. If the command is set to `FirstReturnedRecord`, the first returned result is placed in the <xref:System.Data.DataRow>.
  6293. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  6294. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  6295. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  6296. ## Examples
  6297. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  6298. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  6299. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  6300. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  6301. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  6302. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  6303. ]]></format>
  6304. </remarks>
  6305. </member>
  6306. <member name="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating">
  6307. <summary>Occurs during <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> before a command is executed against the data source. The attempt to update is made, so the event fires.</summary><remarks>
  6308. <format type="text/markdown"><![CDATA[
  6309. ## Remarks
  6310. When using <xref:System.Data.Common.DbDataAdapter.Update%2A>, there are two events that occur per data row updated. The order of execution is as follows:
  6311. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  6312. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  6313. 3. The command executes.
  6314. 4. If the command is set to `FirstReturnedRecord`, the first returned result is placed in the <xref:System.Data.DataRow>.
  6315. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  6316. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  6317. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  6318. ## Examples
  6319. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  6320. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  6321. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  6322. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  6323. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  6324. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  6325. ]]></format>
  6326. </remarks>
  6327. </member>
  6328. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.AddToBatch(System.Data.IDbCommand)">
  6329. <param name="command">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  6330. </member>
  6331. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.ClearBatch">
  6332. <summary>To be added.</summary><remarks>To be added.</remarks>
  6333. </member>
  6334. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.CreateRowUpdatedEvent(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  6335. <param name="dataRow">To be added.</param><param name="command">To be added.</param><param name="statementType">To be added.</param><param name="tableMapping">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  6336. </member>
  6337. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.CreateRowUpdatingEvent(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  6338. <param name="dataRow">To be added.</param><param name="command">To be added.</param><param name="statementType">To be added.</param><param name="tableMapping">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  6339. </member>
  6340. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.ExecuteBatch">
  6341. <summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  6342. </member>
  6343. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.GetBatchedParameter(System.Int32,System.Int32)">
  6344. <param name="commandIdentifier">To be added.</param><param name="parameterIndex">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  6345. </member>
  6346. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.GetBatchedRecordsAffected(System.Int32,System.Int32@,System.Exception@)">
  6347. <param name="commandIdentifier">To be added.</param><param name="recordsAffected">To be added.</param><param name="error">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  6348. </member>
  6349. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.InitializeBatching">
  6350. <summary>To be added.</summary><remarks>To be added.</remarks>
  6351. </member>
  6352. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.OnRowUpdated(System.Data.Common.RowUpdatedEventArgs)">
  6353. <param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  6354. </member>
  6355. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.OnRowUpdating(System.Data.Common.RowUpdatingEventArgs)">
  6356. <param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  6357. </member>
  6358. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.TerminateBatching">
  6359. <summary>To be added.</summary><remarks>To be added.</remarks>
  6360. </member>
  6361. <member name="T:Microsoft.Data.SqlClient.SqlDataReader">
  6362. <summary>Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.</summary><remarks>
  6363. <format type="text/markdown"><![CDATA[
  6364. ## Remarks
  6365. To create a <xref:Microsoft.Data.SqlClient.SqlDataReader>, you must call the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> method of the <xref:Microsoft.Data.SqlClient.SqlCommand> object, instead of directly using a constructor.
  6366. While the <xref:Microsoft.Data.SqlClient.SqlDataReader> is being used, the associated <xref:Microsoft.Data.SqlClient.SqlConnection> is busy serving the <xref:Microsoft.Data.SqlClient.SqlDataReader>, and no other operations can be performed on the <xref:Microsoft.Data.SqlClient.SqlConnection> other than closing it. This is the case until the <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A> method of the <xref:Microsoft.Data.SqlClient.SqlDataReader> is called. For example, you cannot retrieve output parameters until after you call <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A>.
  6367. Changes made to a result set by another process or thread while data is being read may be visible to the user of the `SqlDataReader`. However, the precise behavior is timing dependent.
  6368. <xref:Microsoft.Data.SqlClient.SqlDataReader.IsClosed%2A> and <xref:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected%2A> are the only properties that you can call after the <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed. Although the <xref:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected%2A> property may be accessed while the <xref:Microsoft.Data.SqlClient.SqlDataReader> exists, always call <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A> before returning the value of <xref:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected%2A> to guarantee an accurate return value.
  6369. When using sequential access (<xref:System.Data.CommandBehavior.SequentialAccess?displayProperty=nameWithType>), an <xref:System.InvalidOperationException> will be raised if the <xref:Microsoft.Data.SqlClient.SqlDataReader> position is advanced and another read operation is attempted on the previous column.
  6370. > [!NOTE]
  6371. > For optimal performance, <xref:Microsoft.Data.SqlClient.SqlDataReader> avoids creating unnecessary objects or making unnecessary copies of data. Therefore, multiple calls to methods such as <xref:Microsoft.Data.SqlClient.SqlDataReader.GetValue%2A> return a reference to the same object. Use caution if you are modifying the underlying value of the objects returned by methods such as <xref:Microsoft.Data.SqlClient.SqlDataReader.GetValue%2A>.
  6372. ## Examples
  6373. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, a <xref:Microsoft.Data.SqlClient.SqlCommand>, and a <xref:Microsoft.Data.SqlClient.SqlDataReader>. The example reads through the data, writing it out to the console window. The code then closes the <xref:Microsoft.Data.SqlClient.SqlDataReader>. The <xref:Microsoft.Data.SqlClient.SqlConnection> is closed automatically at the end of the `using` code block.
  6374. [!code-csharp[SqlDataReader_Read Example#1](~/../sqlclient/doc/samples/SqlDataReader_Read.cs#1)]
  6375. ]]></format>
  6376. </remarks>
  6377. </member>
  6378. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Connection">
  6379. <summary>Gets the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> associated with the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> associated with the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</value><remarks>To be added.</remarks>
  6380. </member>
  6381. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Depth">
  6382. <summary>Gets a value that indicates the depth of nesting for the current row.</summary><value>The depth of nesting for the current row.</value><remarks>
  6383. <format type="text/markdown"><![CDATA[
  6384. ## Remarks
  6385. The outermost table has a depth of zero. The .NET Framework Data Provider for SQL Server does not support nesting and always returns zero.
  6386. ]]></format>
  6387. </remarks>
  6388. </member>
  6389. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.FieldCount">
  6390. <summary>Gets the number of columns in the current row.</summary><value>When not positioned in a valid recordset, 0; otherwise the number of columns in the current row. The default is -1.</value><remarks>
  6391. <format type="text/markdown"><![CDATA[
  6392. ## Remarks
  6393. Executing a query that, by its nature, does not return rows (such as a DELETE query), sets <xref:Microsoft.Data.SqlClient.SqlDataReader.FieldCount%2A> to 0. However. this should not be confused with a query that returns 0 rows (such as SELECT * FROM *table* WHERE 1 = 2) in which case <xref:Microsoft.Data.SqlClient.SqlDataReader.FieldCount%2A> returns the number of columns in the table, including hidden fields. Use <xref:Microsoft.Data.SqlClient.SqlDataReader.VisibleFieldCount%2A> to exclude hidden fields.
  6394. ]]></format>
  6395. </remarks><exception cref="T:System.NotSupportedException">There is no current connection to an instance of SQL Server.</exception>
  6396. </member>
  6397. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.HasRows">
  6398. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> contains one or more rows.</summary><value>
  6399. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> contains one or more rows; otherwise <see langword="false" />.</value><remarks>To be added.</remarks>
  6400. </member>
  6401. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.IsClosed">
  6402. <summary>Retrieves a Boolean value that indicates whether the specified <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> instance has been closed.</summary><value>
  6403. <see langword="true" /> if the specified <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> instance is closed; otherwise <see langword="false" />.</value><remarks>
  6404. <format type="text/markdown"><![CDATA[
  6405. ## Remarks
  6406. It is not possible to read from a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance that is closed.
  6407. ]]></format>
  6408. </remarks>
  6409. </member>
  6410. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Item(System.Int32)">
  6411. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column in its native format given the column ordinal.</summary><value>The value of the specified column in its native format.</value><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The index passed was outside the range of 0 through <see cref="P:System.Data.IDataRecord.FieldCount" />.</exception>
  6412. </member>
  6413. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Item(System.String)">
  6414. <param name="name">The column name.</param><summary>Gets the value of the specified column in its native format given the column name.</summary><value>The value of the specified column in its native format.</value><remarks>
  6415. <format type="text/markdown"><![CDATA[
  6416. ## Remarks
  6417. A case-sensitive lookup is performed first. If it fails, a second case-insensitive search is made (a case-insensitive comparison is done using the database collation). Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter 'i' in "file".
  6418. This method is kana-width insensitive.
  6419. ]]></format>
  6420. </remarks><exception cref="T:System.IndexOutOfRangeException">No column with the specified name was found.</exception>
  6421. </member>
  6422. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected">
  6423. <summary>Gets the number of rows changed, inserted, or deleted by execution of the Transact-SQL statement.</summary><value>The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements.</value><remarks>
  6424. <format type="text/markdown"><![CDATA[
  6425. ## Remarks
  6426. The value of this property is cumulative. For example, if two records are inserted in batch mode, the value of `RecordsAffected` will be two.
  6427. <xref:Microsoft.Data.SqlClient.SqlDataReader.IsClosed%2A> and <xref:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected%2A> are the only properties that you can call after the <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed.
  6428. ]]></format>
  6429. </remarks>
  6430. </member>
  6431. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.SensitivityClassification">
  6432. <summary>Gets the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification" /> information with the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification" /> associated with the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</value><remarks>To be added.</remarks>
  6433. </member>
  6434. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.VisibleFieldCount">
  6435. <summary>Gets the number of fields in the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> that are not hidden.</summary><value>The number of fields that are not hidden.</value><remarks>
  6436. <format type="text/markdown"><![CDATA[
  6437. ## Remarks
  6438. This value is used to determine how many fields in the <xref:Microsoft.Data.SqlClient.SqlDataReader> are visible. For example, a SELECT on a partial primary key returns the remaining parts of the key as hidden fields. The hidden fields are always appended behind the visible fields.
  6439. ]]></format>
  6440. </remarks>
  6441. </member>
  6442. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.Close">
  6443. <summary>Closes the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> object.</summary><remarks>
  6444. <format type="text/markdown"><![CDATA[
  6445. ## Remarks
  6446. You must ensure the <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A> method is called when you are through using the <xref:Microsoft.Data.SqlClient.SqlDataReader> before using the associated <xref:Microsoft.Data.SqlClient.SqlConnection> for any other purpose. The `Close` method may either be called directly or through the <xref:Microsoft.Data.SqlClient.SqlDataReader.Dispose%2A> method, disposing directly or in the context of [the using statement](~/_csharplang/spec/statements.md#the-using-statement) block.
  6447. The `Close` method populates the values for output parameters, return values and `RecordsAffected` on the <xref:Microsoft.Data.SqlClient.SqlDataReader> by consuming any pending results. This may be a long operation depending on the amount of data to be consumed. If output values, return values, and `RecordsAffected` are not important to your application, the time to close may be shortened by calling the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method of the associated <xref:Microsoft.Data.SqlClient.SqlCommand> object before the `Close` method is called.
  6448. > [!CAUTION]
  6449. > Do not call `Close` or `Dispose` on a Connection, a DataReader, or any other managed object in the `Finalize` method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a `Finalize` method in your class definition. For more information, see [Garbage Collection](~/docs/standard/garbage-collection/index.md).
  6450. ## Examples
  6451. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, a <xref:Microsoft.Data.SqlClient.SqlCommand>, and a <xref:Microsoft.Data.SqlClient.SqlDataReader>. The example reads through the data, writing it out to the console window. The code then closes the <xref:Microsoft.Data.SqlClient.SqlDataReader>. The <xref:Microsoft.Data.SqlClient.SqlConnection> is closed automatically at the end of the `using` code block.
  6452. [!code-csharp[SqlDataReader_Close Example#1](~/../sqlclient/doc/samples/SqlDataReader_Close.cs#1)]
  6453. ]]></format>
  6454. </remarks>
  6455. </member>
  6456. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetBoolean(System.Int32)">
  6457. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a Boolean.</summary><returns>The value of the column.</returns><remarks>
  6458. <format type="text/markdown"><![CDATA[
  6459. ## Remarks
  6460. No conversions are performed; therefore, the data retrieved must already be a Boolean, or an exception is generated.
  6461. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6462. ]]></format>
  6463. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6464. </member>
  6465. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetByte(System.Int32)">
  6466. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a byte.</summary><returns>The value of the specified column as a byte.</returns><remarks>
  6467. <format type="text/markdown"><![CDATA[
  6468. ## Remarks
  6469. No conversions are performed; therefore, the data retrieved must already be a byte.
  6470. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6471. ]]></format>
  6472. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6473. </member>
  6474. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  6475. <param name="i">The zero-based column ordinal.</param><param name="dataIndex">The index within the field from which to begin the read operation.</param><param name="buffer">The buffer into which to read the stream of bytes.</param><param name="bufferIndex">The index within the <paramref name="buffer" /> where the write operation is to start.</param><param name="length">The maximum length to copy into the buffer.</param><summary>Reads a stream of bytes from the specified column offset into the buffer an array starting at the given buffer offset.</summary><returns>The actual number of bytes read.</returns><remarks>
  6476. <format type="text/markdown"><![CDATA[
  6477. ## Remarks
  6478. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetBytes%2A> returns the number of available bytes in the field. Most of the time this is the exact length of the field. However, the number returned may be less than the true length of the field if `GetBytes` has already been used to obtain bytes from the field. This may be the case, for example, if the <xref:Microsoft.Data.SqlClient.SqlDataReader> is reading a large data structure into a buffer. For more information, see the `SequentialAccess` setting for <xref:System.Data.CommandBehavior>.
  6479. If you pass a buffer that is `null`, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetBytes%2A> returns the length of the entire field in bytes, not the remaining size based on the buffer offset parameter.
  6480. No conversions are performed; therefore, the data retrieved must already be a byte array.
  6481. ]]></format>
  6482. </remarks>
  6483. </member>
  6484. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetChar(System.Int32)">
  6485. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a single character.</summary><returns>The value of the specified column.</returns><remarks>
  6486. <format type="text/markdown"><![CDATA[
  6487. ## Remarks
  6488. Not supported for <xref:Microsoft.Data.SqlClient>.
  6489. ]]></format>
  6490. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6491. </member>
  6492. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  6493. <param name="i">The zero-based column ordinal.</param><param name="dataIndex">The index within the field from which to begin the read operation.</param><param name="buffer">The buffer into which to read the stream of bytes.</param><param name="bufferIndex">The index within the <paramref name="buffer" /> where the write operation is to start.</param><param name="length">The maximum length to copy into the buffer.</param><summary>Reads a stream of characters from the specified column offset into the buffer as an array starting at the given buffer offset.</summary><returns>The actual number of characters read.</returns><remarks>
  6494. <format type="text/markdown"><![CDATA[
  6495. ## Remarks
  6496. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> returns the number of available characters in the field. Frequently this is the exact length of the field. However, the number returned may be less than the true length of the field if `GetChars` has already been used to obtain characters from the field. This may be the case, for example, if the <xref:Microsoft.Data.SqlClient.SqlDataReader> is reading a large data structure into a buffer. For more information, see the `SequentialAccess` setting for <xref:System.Data.CommandBehavior>.
  6497. The actual number of characters read can be less than the requested length, if the end of the field is reached. If you pass a buffer that is `null`, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> returns the length of the entire field in characters, not the remaining size based on the buffer offset parameter.
  6498. No conversions are performed; therefore. the data retrieved must already be a character array.
  6499. > [!NOTE]
  6500. > The <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> method returns 0 when `dataIndex` is negative.
  6501. ]]></format>
  6502. </remarks>
  6503. </member>
  6504. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDataTypeName(System.Int32)">
  6505. <param name="i">The zero-based ordinal position of the column to find.</param><summary>Gets a string representing the data type of the specified column.</summary><returns>The string representing the data type of the specified column.</returns><remarks>
  6506. <format type="text/markdown"><![CDATA[
  6507. ## Remarks
  6508. Returns the name of the back-end data type.
  6509. `numeric` is a synonym in SQL Server for the `decimal` data type. `GetDataTypeName` will return "decimal" for a column defined as either decimal or numeric.
  6510. ]]></format>
  6511. </remarks>
  6512. </member>
  6513. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDateTime(System.Int32)">
  6514. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.DateTime" /> object.</summary><returns>The value of the specified column.</returns><remarks>
  6515. <format type="text/markdown"><![CDATA[
  6516. ## Remarks
  6517. No conversions are performed; therefore, the data retrieved must already be a <xref:System.DateTime> object.
  6518. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6519. ]]></format>
  6520. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6521. </member>
  6522. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDateTimeOffset(System.Int32)">
  6523. <param name="i">The zero-based column ordinal.</param><summary>Retrieves the value of the specified column as a <see cref="T:System.DateTimeOffset" /> object.</summary><returns>The value of the specified column.</returns><remarks>
  6524. <format type="text/markdown"><![CDATA[
  6525. ## Remarks
  6526. No conversions are performed; therefore, the data retrieved must already be a <xref:System.DateTimeOffset> object.
  6527. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6528. ]]></format>
  6529. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6530. </member>
  6531. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDecimal(System.Int32)">
  6532. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Decimal" /> object.</summary><returns>The value of the specified column.</returns><remarks>
  6533. <format type="text/markdown"><![CDATA[
  6534. ## Remarks
  6535. No conversions are performed; therefore, the data retrieved must already be a <xref:System.Decimal> object.
  6536. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6537. ]]></format>
  6538. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6539. </member>
  6540. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDouble(System.Int32)">
  6541. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a double-precision floating point number.</summary><returns>The value of the specified column.</returns><remarks>
  6542. <format type="text/markdown"><![CDATA[
  6543. ## Remarks
  6544. No conversions are performed. Therefore, the data retrieved must already be a double-precision floating point number.
  6545. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6546. ]]></format>
  6547. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6548. </member>
  6549. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetEnumerator">
  6550. <summary>Returns an <see cref="T:System.Collections.IEnumerator" /> that iterates through the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</summary><returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</returns><remarks>
  6551. <format type="text/markdown"><![CDATA[
  6552. ## Remarks
  6553. Although you can use this method to retrieve an explicit enumerator, in languages that support a `foreach` construct, it is simpler to use the looping construct directly in order to iterate through the rows in the data reader.
  6554. ]]></format>
  6555. </remarks>
  6556. </member>
  6557. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldType(System.Int32)">
  6558. <param name="i">The zero-based column ordinal.</param><summary>Gets the <see cref="T:System.Type" /> that is the data type of the object.</summary><returns>The <see cref="T:System.Type" /> that is the data type of the object. If the type does not exist on the client, in the case of a User-Defined Type (UDT) returned from the database, **GetFieldType** returns null.</returns><remarks>To be added.</remarks>
  6559. </member>
  6560. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValue``1(System.Int32)">
  6561. <typeparam name="T">The type of the value to be returned.</typeparam><param name="i">The column to be retrieved.</param><summary>Synchronously gets the value of the specified column as a type. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValueAsync``1(System.Int32,System.Threading.CancellationToken)" /> is the asynchronous version of this method.</summary><returns>The returned type object.</returns><remarks>
  6562. <format type="text/markdown"><![CDATA[
  6563. ## Remarks
  6564. `T` can be one of the following types:
  6565. |||||
  6566. |-|-|-|-|
  6567. |Boolean|Byte|Char|DateTime|
  6568. |DateTimeOffset|Decimal|Double|Float|
  6569. |Guid|Int16|Int32|Int64|
  6570. |SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
  6571. |SqlDouble|SqlGuid|SqlInt16|SqlInt32|
  6572. |SqlInt64|SqlMoney|SqlSingle|SqlString|
  6573. |String|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|||
  6574. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6575. ]]></format>
  6576. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6577. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6578. There is no data ready to be read (for example, the first <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" /> hasn't been called, or returned false).
  6579. Tried to read a previously-read column in sequential mode.
  6580. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The value of the column was null (<see cref="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)" /> == <see langword="true" />), retrieving a non-SQL type.</exception><exception cref="T:System.InvalidCastException">
  6581. <typeparamref name="T" /> doesn't match the type returned by SQL Server or cannot be cast.</exception>
  6582. </member>
  6583. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValueAsync``1(System.Int32,System.Threading.CancellationToken)">
  6584. <typeparam name="T">The type of the value to be returned.</typeparam><param name="i">The column to be retrieved.</param><param name="cancellationToken">The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of <see langword="CancellationToken.None" /> makes this method equivalent to <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)" />. The returned task must be marked as cancelled.</param><summary>Asynchronously gets the value of the specified column as a type. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValue``1(System.Int32)" /> is the synchronous version of this method.</summary><returns>The returned type object.</returns><remarks>
  6585. <format type="text/markdown"><![CDATA[
  6586. ## Remarks
  6587. `T` can be one of the following types:
  6588. |||||
  6589. |-|-|-|-|
  6590. |Boolean|Byte|Char|DateTime|
  6591. |DateTimeOffset|Decimal|Double|Float|
  6592. |Guid|Int16|Int32|Int64|
  6593. |SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
  6594. |SqlDouble|SqlGuid|SqlInt16|SqlInt32|
  6595. |SqlInt64|SqlMoney|SqlSingle|SqlString|
  6596. |String|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|||
  6597. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6598. ]]></format>
  6599. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6600. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6601. There is no data ready to be read (for example, the first <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" /> hasn't been called, or returned false).
  6602. Tried to read a previously-read column in sequential mode.
  6603. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.
  6604. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The value of the column was null (<see cref="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)" /> == <see langword="true" />), retrieving a non-SQL type.</exception><exception cref="T:System.InvalidCastException">
  6605. <typeparamref name="T" /> doesn't match the type returned by SQL Server or cannot be cast.</exception>
  6606. </member>
  6607. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFloat(System.Int32)">
  6608. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a single-precision floating point number.</summary><returns>The value of the specified column.</returns><remarks>
  6609. <format type="text/markdown"><![CDATA[
  6610. ## Remarks
  6611. No conversions are performed. Therefore, the data retrieved must already be a single-precision floating point number.
  6612. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6613. ]]></format>
  6614. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6615. </member>
  6616. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetGuid(System.Int32)">
  6617. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a globally unique identifier (GUID).</summary><returns>The value of the specified column.</returns><remarks>
  6618. <format type="text/markdown"><![CDATA[
  6619. ## Remarks
  6620. No conversions are performed; therefore, the data retrieved must already be a GUID.
  6621. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6622. ]]></format>
  6623. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6624. </member>
  6625. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt16(System.Int32)">
  6626. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a 16-bit signed integer.</summary><returns>The value of the specified column.</returns><remarks>
  6627. <format type="text/markdown"><![CDATA[
  6628. ## Remarks
  6629. No conversions are performed; therefore, the data retrieved must already be a 16-bit signed integer.
  6630. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6631. ]]></format>
  6632. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6633. </member>
  6634. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt32(System.Int32)">
  6635. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a 32-bit signed integer.</summary><returns>The value of the specified column.</returns><remarks>
  6636. <format type="text/markdown"><![CDATA[
  6637. ## Remarks
  6638. No conversions are performed; therefore, the data retrieved must already be a 32-bit signed integer.
  6639. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6640. ]]></format>
  6641. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6642. </member>
  6643. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt64(System.Int32)">
  6644. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a 64-bit signed integer.</summary><returns>The value of the specified column.</returns><remarks>
  6645. <format type="text/markdown"><![CDATA[
  6646. ## Remarks
  6647. No conversions are performed; therefore, the data retrieved must already be a 64-bit signed integer.
  6648. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6649. ]]></format>
  6650. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6651. </member>
  6652. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetName(System.Int32)">
  6653. <param name="i">The zero-based column ordinal.</param><summary>Gets the name of the specified column.</summary><returns>The name of the specified column.</returns><remarks>To be added.</remarks>
  6654. </member>
  6655. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetOrdinal(System.String)">
  6656. <param name="name">The name of the column.</param><summary>Gets the column ordinal, given the name of the column.</summary><returns>The zero-based column ordinal.</returns><remarks>
  6657. <format type="text/markdown"><![CDATA[
  6658. ## Remarks
  6659. `GetOrdinal` performs a case-sensitive lookup first. If it fails, a second, case-insensitive search occurs (a case-insensitive comparison is done using the database collation). Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter 'i' in "file". The method throws an `IndexOutOfRange` exception if the zero-based column ordinal is not found.
  6660. `GetOrdinal` is kana-width insensitive.
  6661. Because ordinal-based lookups are more efficient than named lookups, it is inefficient to call `GetOrdinal` within a loop. Save time by calling `GetOrdinal` once and assigning the results to an integer variable for use within the loop.
  6662. ## Examples
  6663. The following example demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlDataReader.GetOrdinal%2A> method.
  6664. [!code-csharp[SqlDataReader_GetOrdinal#1](~/../sqlclient/doc/samples/SqlDataReader_GetOrdinal.cs#1)]
  6665. ]]></format>
  6666. </remarks><exception cref="T:System.IndexOutOfRangeException">The name specified is not a valid column name.</exception>
  6667. </member>
  6668. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificFieldType(System.Int32)">
  6669. <param name="i">An <see cref="T:System.Int32" /> representing the column ordinal.</param><summary>Gets an <see langword="Object" /> that is a representation of the underlying provider-specific field type.</summary><returns>Gets an <see cref="T:System.Object" /> that is a representation of the underlying provider-specific field type.</returns><remarks>To be added.</remarks>
  6670. </member>
  6671. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificValue(System.Int32)">
  6672. <param name="i">An <see cref="T:System.Int32" /> representing the column ordinal.</param><summary>Gets an <see langword="Object" /> that is a representation of the underlying provider specific value.</summary><returns>An <see cref="T:System.Object" /> that is a representation of the underlying provider specific value.</returns><remarks>To be added.</remarks>
  6673. </member>
  6674. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificValues(System.Object[])">
  6675. <param name="values">An array of <see cref="T:System.Object" /> into which to copy the column values.</param><summary>Gets an array of objects that are a representation of the underlying provider specific values.</summary><returns>The array of objects that are a representation of the underlying provider specific values.</returns><remarks>To be added.</remarks>
  6676. </member>
  6677. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBinary(System.Int32)">
  6678. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlBinary" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlBinary" />.</returns><remarks>
  6679. <format type="text/markdown"><![CDATA[
  6680. ## Remarks
  6681. No conversions are performed; therefore the data retrieved must already be a binary structure or an exception is generated.
  6682. ]]></format>
  6683. </remarks>
  6684. </member>
  6685. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBoolean(System.Int32)">
  6686. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlBoolean" />.</summary><returns>The value of the column.</returns><remarks>
  6687. <format type="text/markdown"><![CDATA[
  6688. ## Remarks
  6689. No conversions are performed; therefore, the data retrieved must already be a Boolean or an exception is generated.
  6690. ]]></format>
  6691. </remarks>
  6692. </member>
  6693. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlByte(System.Int32)">
  6694. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlByte" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlByte" />.</returns><remarks>
  6695. <format type="text/markdown"><![CDATA[
  6696. ## Remarks
  6697. No conversions are performed; therefore the data retrieved must already be a byte, or an exception is generated.
  6698. ]]></format>
  6699. </remarks>
  6700. </member>
  6701. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBytes(System.Int32)">
  6702. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as <see cref="T:System.Data.SqlTypes.SqlBytes" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlBytes" />.</returns><remarks>To be added.</remarks>
  6703. </member>
  6704. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlChars(System.Int32)">
  6705. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as <see cref="T:System.Data.SqlTypes.SqlChars" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlChars" />.</returns><remarks>To be added.</remarks>
  6706. </member>
  6707. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDateTime(System.Int32)">
  6708. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlDateTime" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlDateTime" />.</returns><remarks>
  6709. <format type="text/markdown"><![CDATA[
  6710. ## Remarks
  6711. No conversions are performed; therefore, the data retrieved must already be a date/time value, or an exception is generated.
  6712. ]]></format>
  6713. </remarks>
  6714. </member>
  6715. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDecimal(System.Int32)">
  6716. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlDecimal" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlDecimal" />.</returns><remarks>
  6717. <format type="text/markdown"><![CDATA[
  6718. ## Remarks
  6719. No conversions are performed; therefore, the data retrieved must already be a decimal value, or an exception is generated.
  6720. ]]></format>
  6721. </remarks>
  6722. </member>
  6723. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDouble(System.Int32)">
  6724. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlDouble" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlDouble" />.</returns><remarks>
  6725. <format type="text/markdown"><![CDATA[
  6726. ## Remarks
  6727. No conversions are performed; therefore, the data retrieved must already be a double-precision floating-point number, or an exception is generated.
  6728. ]]></format>
  6729. </remarks>
  6730. </member>
  6731. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlGuid(System.Int32)">
  6732. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlGuid" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlGuid" />.</returns><remarks>
  6733. <format type="text/markdown"><![CDATA[
  6734. ## Remarks
  6735. No conversions are performed; therefore, the data retrieved must already be a GUID, or an exception is generated.
  6736. ]]></format>
  6737. </remarks>
  6738. </member>
  6739. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt16(System.Int32)">
  6740. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlInt16" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlInt16" />.</returns><remarks>
  6741. <format type="text/markdown"><![CDATA[
  6742. ## Remarks
  6743. No conversions are performed; therefore, the data retrieved must already be a 16-bit signed integer, or an exception is generated.
  6744. ]]></format>
  6745. </remarks>
  6746. </member>
  6747. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt32(System.Int32)">
  6748. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlInt32" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlInt32" />.</returns><remarks>
  6749. <format type="text/markdown"><![CDATA[
  6750. ## Remarks
  6751. No conversions are performed; therefore the data retrieved must already be a 32-bit signed integer, or an exception is generated.
  6752. ]]></format>
  6753. </remarks>
  6754. </member>
  6755. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt64(System.Int32)">
  6756. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlInt64" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlInt64" />.</returns><remarks>
  6757. <format type="text/markdown"><![CDATA[
  6758. ## Remarks
  6759. No conversions are performed; therefore, the data retrieved must already be a 64-bit signed integer, or an exception is generated.
  6760. ]]></format>
  6761. </remarks>
  6762. </member>
  6763. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlMoney(System.Int32)">
  6764. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlMoney" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlMoney" />.</returns><remarks>
  6765. <format type="text/markdown"><![CDATA[
  6766. ## Remarks
  6767. No conversions are performed; therefore, the data retrieved must already be a decimal value, or an exception is generated.
  6768. ]]></format>
  6769. </remarks>
  6770. </member>
  6771. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlSingle(System.Int32)">
  6772. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlSingle" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlSingle" />.</returns><remarks>
  6773. <format type="text/markdown"><![CDATA[
  6774. ## Remarks
  6775. No conversions are performed; therefore, the data retrieved must already be a single precision floating point number, or an exception is generated.
  6776. ]]></format>
  6777. </remarks>
  6778. </member>
  6779. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlString(System.Int32)">
  6780. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a <see cref="T:System.Data.SqlTypes.SqlString" />.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlTypes.SqlString" />.</returns><remarks>
  6781. <format type="text/markdown"><![CDATA[
  6782. ## Remarks
  6783. No conversions are performed; therefore, the data retrieved must already be a string, or an exception is generated.
  6784. ]]></format>
  6785. </remarks>
  6786. </member>
  6787. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValue(System.Int32)">
  6788. <param name="i">The zero-based column ordinal.</param><summary>Returns the data value in the specified column as a SQL Server type.</summary><returns>The value of the column expressed as a <see cref="T:System.Data.SqlDbType" />.</returns><remarks>
  6789. <format type="text/markdown"><![CDATA[
  6790. ## Remarks
  6791. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValue%2A> returns data using the native SQL Server types. To retrieve data using the .NET Framework types, see <xref:Microsoft.Data.SqlClient.SqlDataReader.GetValue%2A>.
  6792. ]]></format>
  6793. </remarks>
  6794. </member>
  6795. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValues(System.Object[])">
  6796. <param name="values">An array of <see cref="T:System.Object" /> into which to copy the values. The column values are expressed as SQL Server types.</param><summary>Fills an array of <see cref="T:System.Object" /> that contains the values for all the columns in the record, expressed as SQL Server types.</summary><returns>An integer indicating the number of columns copied.</returns><remarks>
  6797. <format type="text/markdown"><![CDATA[
  6798. ## Remarks
  6799. Returns the values for all the columns in the record in a single call, using the SQL type system instead of the CLR type system. The length of the <xref:System.Object> array does not need to match the number of columns in the record. You can pass an <xref:System.Object> array that contains fewer than the number of columns contained in the record. Only the amount of data the <xref:System.Object> array holds is copied to the array, starting at the column with ordinal 0. You can also pass an <xref:System.Object> array whose length is more than the number of columns contained in the resulting row. Any remaining columns are untouched.
  6800. ]]></format>
  6801. </remarks><exception cref="T:System.ArgumentNullException">
  6802. <paramref name="values" /> is null.</exception>
  6803. </member>
  6804. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlXml(System.Int32)">
  6805. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as an XML value.</summary><returns>A <see cref="T:System.Data.SqlTypes.SqlXml" /> value that contains the XML stored within the corresponding field.</returns><remarks>
  6806. <format type="text/markdown"><![CDATA[
  6807. ## Remarks
  6808. No conversions are performed; therefore, the data retrieved must already be an XML value.
  6809. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6810. ]]></format>
  6811. </remarks><exception cref="T:System.ArgumentOutOfRangeException">The index passed was outside the range of 0 to <see cref="P:System.Data.DataTableReader.FieldCount" /> - 1</exception><exception cref="T:System.InvalidOperationException">An attempt was made to read or access columns in a closed <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</exception><exception cref="T:System.InvalidCastException">The retrieved data is not compatible with the <see cref="T:System.Data.SqlTypes.SqlXml" /> type.</exception>
  6812. </member>
  6813. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSchemaTable">
  6814. <summary>Returns a <see cref="T:System.Data.DataTable" /> that describes the column metadata of the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />.</summary><returns>A <see cref="T:System.Data.DataTable" /> that describes the column metadata.</returns><remarks>
  6815. <format type="text/markdown"><![CDATA[
  6816. ## Remarks
  6817. For the <xref:Microsoft.Data.SqlClient.SqlDataReader.GetSchemaTable%2A> method returns metadata about each column in the following order:
  6818. |DataReader column|Description|
  6819. |-----------------------|-----------------|
  6820. |AllowDBNull|Set if the consumer can set the column to a null value or if the provider cannot determine whether the consumer can set the column to a null value. Otherwise, not set. A column may contain null values, even if it cannot be set to a null value.|
  6821. |BaseCatalogName|The name of the catalog in the data store that contains the column. NULL if the base catalog name cannot be determined. The default of this column is a null value.|
  6822. |BaseColumnName|The name of the column in the data store. This might be different than the column name returned in the ColumnName column if an alias was used. A null value if the base column name cannot be determined or if the rowset column is derived, but not identical to, a column in the data store. The default of this column is a null value.|
  6823. |BaseSchemaName|The name of the schema in the data store that contains the column. A null value if the base schema name cannot be determined. The default of this column is a null value.|
  6824. |BaseServerName|The name of the instance of Microsoft SQL Server used by the <xref:Microsoft.Data.SqlClient.SqlDataReader>.|
  6825. |BaseTableName|The name of the table or view in the data store that contains the column. A null value if the base table name cannot be determined. The default of this column is a null value.|
  6826. |ColumnName|The name of the column; this might not be unique. If this cannot be determined, a null value is returned. This name always reflects the most recent renaming of the column in the current view or command text.|
  6827. |ColumnOrdinal|The zero-based ordinal of the column. This column cannot contain a null value.|
  6828. |ColumnSize|The maximum possible length of a value in the column. For columns that use a fixed-length data type, this is the size of the data type. For `nvarchar(MAX)`, `varchar(MAX)`, and `varbinary(MAX)` columns stored in a SQL Server database, the maximum size is 2GB. If these columns are stored and accessed as files, the limit on maximum size is imposed by the file system. This value changes when using the `Type System Version` keyword in the connection string. For new types they are represented as downlevel types. The MAX data types return the normal 4k for `nvarchar` and 8000 for `varchar`. For more information, see the [Transact-SQL reference](/sql/t-sql/language-reference).|
  6829. |DataTypeName|Returns a string representing the data type of the specified column.|
  6830. |IsAliased|`true`: The column name is an alias.<br /><br /> `false`: The column name is not an alias.|
  6831. |IsAutoIncrement|`true`: The column assigns values to new rows in fixed increments.<br /><br /> `false`: The column does not assign values to new rows in fixed increments. The default of this column is `false`.|
  6832. |IsColumnSet|`true`: The column is a sparse column that is a member of a column set.|
  6833. |IsExpression|`true`: The column is an expression.<br /><br /> `false`: The column is not an expression.|
  6834. |IsHidden|`true`: The column is hidden.<br /><br /> `false`: The column is not hidden.|
  6835. |IsIdentity|`true`: The column is an identity column.<br /><br /> `false`: The column is not an identity column.|
  6836. |IsKey|`true`: The column is one of a set of columns in the rowset that, taken together, uniquely identify the row. The set of columns with `IsKey` set to `true` must uniquely identify a row in the rowset. There is no requirement that this set of columns is a minimal set of columns. This set of columns may be generated from a base table primary key, a unique constraint or a unique index.<br /><br /> `false`: The column is not required to uniquely identify the row.|
  6837. |IsLong|`true`: The column contains a Binary Long Object (BLOB) that contains very long data. The definition of very long data is provider-specific.<br /><br /> `false`: The column does not contain a Binary Long Object (BLOB) that contains very long data.|
  6838. |IsReadOnly|`true`: The column cannot be modified.<br /><br /> `false`: The column can be modified.|
  6839. |IsRowVersion|`true`: The column contains a persistent row identifier that cannot be written to, and has no meaningful value except to identity the row.<br /><br /> `false`: The column does not contain a persistent row identifier that cannot be written to, and has no meaningful value except to identity the row.|
  6840. |IsUnique|`true`: Column is of type `timestamp`.<br /><br /> `false`: Column is not of type `timestamp`.|
  6841. |NonVersionedProviderType|The type of the column irrespective of the current `Type System Version` specified in the connection string. The returned value is from the <xref:System.Data.SqlDbType> enumeration.|
  6842. |NumericPrecision|If `ProviderType` is a numeric data type, this is the maximum precision of the column. The precision depends on the definition of the column. If `ProviderType` is not a numeric data type, this is 255.|
  6843. |NumericScale|If `ProviderType` is DBTYPE_DECIMAL or DBTYPE_NUMERIC, the number of digits to the right of the decimal point. Otherwise, this is 255.|
  6844. |ProviderSpecificDataType|Returns the provider-specific data type of the column based on the `Type System Version` keyword in the connection string.|
  6845. |ProviderType|The indicator of the column's data type. If the data type of the column varies from row to row, this must be Object. This column cannot contain a null value.|
  6846. |UdtAssemblyQualifiedName|If the column is a user-defined type (UDT), this is the qualified name of the UDT's assembly as per <xref:System.Type.AssemblyQualifiedName%2A>. If the column is not a UDT, this is null.|
  6847. |XmlSchemaCollectionDatabase|The name of the database where the schema collection for this XML instance is located, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case the `XmlSchemaCollectionName` and `XmlSchemaCollectionOwningSchema` columns are also null.|
  6848. |XmlSchemaCollectionName|The name of the schema collection for this XML instance, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if there is no associated schema collection. If the value is null, the `XmlSchemaCollectionDatabase` and `XmlSchemaCollectionOwningSchema` columns are also null.|
  6849. |XmlSchemaCollectionOwningSchema|The owning relational schema where the schema collection for this XML instance is located, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case the `XmlSchemaCollectionDatabase` and `XmlSchemaCollectionName` columns are also null.|
  6850. > [!NOTE]
  6851. > To make sure that metadata columns return the correct information, you must call <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> with the `behavior` parameter set to `KeyInfo`. Otherwise, some of the columns in the schema table may return default, null, or incorrect data.
  6852. ]]></format>
  6853. </remarks><exception cref="T:System.InvalidOperationException">The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed.</exception>
  6854. </member>
  6855. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetStream(System.Int32)">
  6856. <param name="i">The zero-based column ordinal.</param><summary>Retrieves binary, image, varbinary, UDT, and variant data types as a <see cref="T:System.IO.Stream" />.</summary><returns>A stream object.</returns><remarks>
  6857. <format type="text/markdown"><![CDATA[
  6858. ## Remarks
  6859. <xref:System.IO.Stream.ReadTimeout%2A> defaults to the value of <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>; but you can modify <xref:System.IO.Stream.ReadTimeout%2A> via <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A>.
  6860. Null values will be returned as an empty (zero bytes) <xref:System.IO.Stream>.
  6861. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetBytes%2A> will raise an <xref:System.InvalidOperationException> exception when used on an object returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A> when <xref:System.Data.CommandBehavior.SequentialAccess> is in effect.
  6862. <xref:Microsoft.Data.SqlClient.SqlException> exceptions raised from <xref:System.IO.Stream> are thrown as <xref:System.IO.IOException> exceptions; check the inner exception for the <xref:Microsoft.Data.SqlClient.SqlException>.
  6863. The following <xref:System.IO.Stream> members are not available for objects returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A>:
  6864. - BeginWrite
  6865. - EndWrite
  6866. - Length
  6867. - Position
  6868. - Seek
  6869. - SetLength
  6870. - Write
  6871. - WriteByte
  6872. - WriteTimeout
  6873. When the connection property `ContextConnection=true`, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A> only supports synchronous data retrieval for both sequential (<xref:System.Data.CommandBehavior.SequentialAccess>) and non-sequential (<xref:System.Data.CommandBehavior.Default>) access.
  6874. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6875. ]]></format>
  6876. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6877. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6878. There is no data ready to be read (for example, the first <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" /> hasn't been called, or returned false).
  6879. Tried to read a previously-read column in sequential mode.
  6880. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception><exception cref="T:System.InvalidCastException">The returned type was not one of the types below:
  6881. - binary
  6882. - image
  6883. - varbinary
  6884. - udt</exception>
  6885. </member>
  6886. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetString(System.Int32)">
  6887. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column as a string.</summary><returns>The value of the specified column.</returns><remarks>
  6888. <format type="text/markdown"><![CDATA[
  6889. ## Remarks
  6890. No conversions are performed; therefore, the data retrieved must already be a string.
  6891. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6892. ]]></format>
  6893. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6894. </member>
  6895. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader(System.Int32)">
  6896. <param name="i">The column to be retrieved.</param><summary>Retrieves Char, NChar, NText, NVarChar, text, varChar, and Variant data types as a <see cref="T:System.IO.TextReader" />.</summary><returns>The returned object.</returns><remarks>
  6897. <format type="text/markdown"><![CDATA[
  6898. ## Remarks
  6899. <xref:Microsoft.Data.SqlClient.SqlException> exceptions raised from <xref:System.IO.TextReader> are thrown as <xref:System.IO.IOException> exceptions; check the inner exception for the <xref:Microsoft.Data.SqlClient.SqlException>.
  6900. Null values will be returned as an empty (zero bytes) <xref:System.IO.TextReader>.
  6901. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> will raise an <xref:System.InvalidOperationException> exception when used on an object returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader%2A> when <xref:System.Data.CommandBehavior.SequentialAccess> is in effect.
  6902. When the connection property `ContextConnection=true`, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader%2A> only supports synchronous data retrieval for both sequential (<xref:System.Data.CommandBehavior.SequentialAccess>) and non-sequential (<xref:System.Data.CommandBehavior.Default>) access.
  6903. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6904. ]]></format>
  6905. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6906. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6907. There is no data ready to be read (for example, the first <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" /> hasn't been called, or returned false).
  6908. Tried to read a previously-read column in sequential mode.
  6909. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception><exception cref="T:System.InvalidCastException">The returned type was not one of the types below:
  6910. - char
  6911. - nchar
  6912. - ntext
  6913. - nvarchar
  6914. - text
  6915. - varchar</exception>
  6916. </member>
  6917. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetTimeSpan(System.Int32)">
  6918. <param name="i">The zero-based column ordinal.</param><summary>Retrieves the value of the specified column as a <see cref="T:System.TimeSpan" /> object.</summary><returns>The value of the specified column.</returns><remarks>
  6919. <format type="text/markdown"><![CDATA[
  6920. ## Remarks
  6921. No conversions are performed; therefore, the data retrieved must already be a <xref:System.TimeSpan> object.
  6922. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6923. ]]></format>
  6924. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6925. </member>
  6926. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetValue(System.Int32)">
  6927. <param name="i">The zero-based column ordinal.</param><summary>Gets the value of the specified column in its native format.</summary><returns>This method returns <see cref="T:System.DBNull" /> for null database columns.</returns><remarks>
  6928. <format type="text/markdown"><![CDATA[
  6929. ## Remarks
  6930. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetValue%2A> returns data using the .NET Framework types.
  6931. ]]></format>
  6932. </remarks>
  6933. </member>
  6934. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetValues(System.Object[])">
  6935. <param name="values">An array of <see cref="T:System.Object" /> into which to copy the attribute columns.</param><summary>Populates an array of objects with the column values of the current row.</summary><returns>The number of instances of <see cref="T:System.Object" /> in the array.</returns><remarks>
  6936. <format type="text/markdown"><![CDATA[
  6937. ## Remarks
  6938. For most applications, this method provides an efficient means for retrieving all columns, instead of retrieving each column individually.
  6939. You can pass an <xref:System.Object> array that contains fewer than the number of columns contained in the resulting row. Only the amount of data the <xref:System.Object> array holds is copied to the array. You can also pass an <xref:System.Object> array whose length is more than the number of columns contained in the resulting row.
  6940. This method returns <xref:System.DBNull> for null database columns.
  6941. ## Examples
  6942. The following example demonstrates using a correctly sized array to read all values from the current row in the supplied <xref:Microsoft.Data.SqlClient.SqlDataReader>. In addition, the sample demonstrates using a fixed-sized array that could be either smaller or larger than the number of available columns.
  6943. [!code-csharp[DataTableReader_GetValues#2](~/../sqlclient/doc/samples/DataTableReader_GetValues.cs#2)]
  6944. ]]></format>
  6945. </remarks>
  6946. </member>
  6947. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetXmlReader(System.Int32)">
  6948. <param name="i">The value of the specified column.</param><summary>Retrieves data of type XML as an <see cref="T:System.Xml.XmlReader" />.</summary><returns>The returned object.</returns><remarks>
  6949. <format type="text/markdown"><![CDATA[
  6950. ## Remarks
  6951. The <xref:System.Xml.XmlReader> object returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetXmlReader%2A> does not support asynchronous operations. If you require asynchronous operations on an <xref:System.Xml.XmlReader>, cast the XML column to an NVARCHAR(MAX) on the server and use <xref:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader%2A> with <xref:System.Xml.XmlReader.Create%2A>.
  6952. <xref:Microsoft.Data.SqlClient.SqlException> exceptions raised from <xref:System.Xml.XmlReader> are thrown as <xref:System.Xml.XmlException> exceptions; check the inner exception for the <xref:Microsoft.Data.SqlClient.SqlException>.
  6953. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> will raise an <xref:System.InvalidOperationException> exception when used on an object returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetXmlReader%2A> when <xref:System.Data.CommandBehavior.SequentialAccess> is in effect.
  6954. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6955. ]]></format>
  6956. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6957. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6958. There is no data ready to be read (for example, the first <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" /> hasn't been called, or returned false).
  6959. Trying to read a previously read column in sequential mode.
  6960. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception><exception cref="T:System.InvalidCastException">The returned type was not xml.</exception>
  6961. </member>
  6962. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsCommandBehavior(System.Data.CommandBehavior)">
  6963. <param name="condition">A <see cref="T:System.Data.CommandBehavior" /> enumeration.</param><summary>Determines whether the specified <see cref="T:System.Data.CommandBehavior" /> matches that of the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> .</summary><returns>
  6964. <see langword="true" /> if the specified <see cref="T:System.Data.CommandBehavior" /> is true, <see langword="false" /> otherwise.</returns><remarks>
  6965. <format type="text/markdown"><![CDATA[
  6966. ## Remarks
  6967. This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  6968. ]]></format>
  6969. </remarks>
  6970. </member>
  6971. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)">
  6972. <param name="i">The zero-based column ordinal.</param><summary>Gets a value that indicates whether the column contains non-existent or missing values.</summary><returns>
  6973. <see langword="true" /> if the specified column value is equivalent to <see cref="T:System.DBNull" />; otherwise <see langword="false" />.</returns><remarks>
  6974. <format type="text/markdown"><![CDATA[
  6975. ## Remarks
  6976. Call this method to check for null column values before calling the typed get methods (for example, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetByte%2A>, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChar%2A>, and so on) to avoid raising an error.
  6977. [!code-csharp[SqlDataReader_IsDBNull#1](~/../sqlclient/doc/samples/SqlDataReader_IsDBNull.cs#1)]
  6978. ]]></format>
  6979. </remarks>
  6980. </member>
  6981. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNullAsync(System.Int32,System.Threading.CancellationToken)">
  6982. <param name="i">The zero-based column to be retrieved.</param><param name="cancellationToken">The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of <see langword="CancellationToken.None" /> makes this method equivalent to <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)" />. The returned task must be marked as cancelled.</param><summary>An asynchronous version of <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)" />, which gets a value that indicates whether the column contains non-existent or missing values.
  6983. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.</summary><returns>
  6984. <see langword="true" /> if the specified column value is equivalent to <see langword="DBNull" /> otherwise <see langword="false" />.</returns><remarks>
  6985. <format type="text/markdown"><![CDATA[
  6986. ## Remarks
  6987. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6988. ]]></format>
  6989. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6990. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6991. There is no data ready to be read (for example, the first <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" /> hasn't been called, or returned false).
  6992. Trying to read a previously read column in sequential mode.
  6993. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.
  6994. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception>
  6995. </member>
  6996. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.NextResult">
  6997. <summary>Advances the data reader to the next result, when reading the results of batch Transact-SQL statements.</summary><returns>
  6998. <see langword="true" /> if there are more result sets; otherwise <see langword="false" />.</returns><remarks>
  6999. <format type="text/markdown"><![CDATA[
  7000. ## Remarks
  7001. Used to process multiple results, which can be generated by executing batch Transact-SQL statements.
  7002. By default, the data reader is positioned on the first result.
  7003. ]]></format>
  7004. </remarks>
  7005. </member>
  7006. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.NextResultAsync(System.Threading.CancellationToken)">
  7007. <param name="cancellationToken">The cancellation instruction.</param><summary>An asynchronous version of <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.NextResult" />, which advances the data reader to the next result, when reading the results of batch Transact-SQL statements.
  7008. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.</summary><returns>A task representing the asynchronous operation.</returns><remarks>
  7009. <format type="text/markdown"><![CDATA[
  7010. ## Remarks
  7011. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  7012. ]]></format>
  7013. </remarks><exception cref="T:System.InvalidOperationException">Calling <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.NextResultAsync(System.Threading.CancellationToken)" /> more than once for the same instance before task completion.
  7014. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  7015. </member>
  7016. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.Read">
  7017. <summary>Advances the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> to the next record.</summary><returns>
  7018. <see langword="true" /> if there are more rows; otherwise <see langword="false" />.</returns><remarks>
  7019. <format type="text/markdown"><![CDATA[
  7020. ## Remarks
  7021. The default position of the <xref:Microsoft.Data.SqlClient.SqlDataReader> is before the first record. Therefore, you must call <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> to begin accessing any data.
  7022. Only one `SqlDataReader` per associated <xref:Microsoft.Data.SqlClient.SqlConnection> may be open at a time, and any attempt to open another will fail until the first one is closed. Similarly, while the `SqlDataReader` is being used, the associated `SqlConnection` is busy serving it until you call <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A>.
  7023. ## Examples
  7024. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, a <xref:Microsoft.Data.SqlClient.SqlCommand>, and a <xref:Microsoft.Data.SqlClient.SqlDataReader>. The example reads through the data, writing it out to the console window. The code then closes the <xref:Microsoft.Data.SqlClient.SqlDataReader>. The <xref:Microsoft.Data.SqlClient.SqlConnection> is closed automatically at the end of the `using` code block.
  7025. [!code-csharp[SqlDataReader_Read Example#1](~/../sqlclient/doc/samples/SqlDataReader_Read.cs#1)]
  7026. ]]></format>
  7027. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  7028. </member>
  7029. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)">
  7030. <param name="cancellationToken">The cancellation instruction.</param><summary>An asynchronous version of <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.Read" />, which advances the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> to the next record.
  7031. The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object.</summary><returns>A task representing the asynchronous operation.</returns><remarks>
  7032. <format type="text/markdown"><![CDATA[
  7033. ## Remarks
  7034. If the `behavior` parameter of <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync%2A> is set to `Default`, <xref:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync%2A> reads the entire row before returning the Task.
  7035. For more information, including code samples, about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  7036. ]]></format>
  7037. </remarks><exception cref="T:System.InvalidOperationException">Calling <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" /> more than once for the same instance before task completion.
  7038. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  7039. </member>
  7040. <member name="T:Microsoft.Data.SqlClient.SQLDebugging">
  7041. <summary>
  7042. Included to support debugging applications. Not intended for direct use.
  7043. </summary><remarks>To be added.</remarks>
  7044. </member>
  7045. <member name="M:Microsoft.Data.SqlClient.SQLDebugging.#ctor">
  7046. <summary>
  7047. Initiates instance of <see cref="T:Microsoft.Data.SqlClient.SQLDebugging" /> class object. Not intended for direct use.
  7048. </summary><remarks>To be added.</remarks>
  7049. </member>
  7050. <member name="T:Microsoft.Data.SqlClient.SqlDependency">
  7051. <summary>The <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object represents a query notification dependency between an application and an instance of SQL Server. An application can create a <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object and register to receive notifications via the <see cref="T:Microsoft.Data.SqlClient.OnChangeEventHandler" /> event handler.</summary><remarks>
  7052. <format type="text/markdown"><![CDATA[
  7053. ## Remarks
  7054. <xref:Microsoft.Data.SqlClient.SqlDependency> is ideal for caching scenarios, where your ASP.NET application or middle-tier service needs to keep certain information cached in memory. <xref:Microsoft.Data.SqlClient.SqlDependency> allows you to receive notifications when the original data in the database changes so that the cache can be refreshed.
  7055. To set up a dependency, you need to associate a <xref:Microsoft.Data.SqlClient.SqlDependency> object to one or more <xref:Microsoft.Data.SqlClient.SqlCommand> objects. To receive notifications, you need to subscribe to the <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event. For more information about the requirements for creating queries for notifications, see [Working with Query Notifications](/sql/relational-databases/native-client/features/working-with-query-notifications).
  7056. > [!NOTE]
  7057. > <xref:Microsoft.Data.SqlClient.SqlDependency> was designed to be used in ASP.NET or middle-tier services where there is a relatively small number of servers having dependencies active against the database. It was not designed for use in client applications, where hundreds or thousands of client computers would have <xref:Microsoft.Data.SqlClient.SqlDependency> objects set up for a single database server. If you are developing an application where you need reliable sub-second notifications when data changes, review the sections [Planning an Efficient Query Notifications Strategy](https://docs.microsoft.com/previous-versions/sql/sql-server-2008-r2/ms187528(v=sql.105)#planning-an-efficient-query-notifications-strategy) and [Alternatives to Query Notifications](https://docs.microsoft.com/previous-versions/sql/sql-server-2008-r2/ms187528(v=sql.105)#alternatives-to-query-notifications) in the [Planning for Notifications](https://docs.microsoft.com/previous-versions/sql/sql-server-2008-r2/ms187528(v%3dsql.105)) article.
  7058. For more information, see [Query Notifications in SQL Server](~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md) and [Building Notification Solutions](https://docs.microsoft.com/previous-versions/sql/sql-server-2005/ms171065(v%3dsql.90)).
  7059. > [!NOTE]
  7060. > The <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event may be generated on a different thread from the thread that initiated command execution.
  7061. Query notifications are supported only for SELECT statements that meet a list of specific requirements.
  7062. ]]></format>
  7063. </remarks>
  7064. </member>
  7065. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor">
  7066. <summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class with the default settings.</summary><remarks>
  7067. <format type="text/markdown"><![CDATA[
  7068. ## Remarks
  7069. The constructor initializes the <xref:Microsoft.Data.SqlClient.SqlDependency> object using the default Service Broker service name and time-out. At some point after construction, you must use the <xref:Microsoft.Data.SqlClient.SqlDependency.AddCommandDependency%2A> method to associate one or more commands to this <xref:Microsoft.Data.SqlClient.SqlDependency> object.
  7070. Query notifications are supported only for SELECT statements that meet a list of specific requirements. For more information, see [SQL Server Service Broker](/sql/database-engine/configure-windows/sql-server-service-broker) and [Working with Query Notifications](/sql/connect/oledb/features/working-with-query-notifications).
  7071. ]]></format>
  7072. </remarks>
  7073. </member>
  7074. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor(Microsoft.Data.SqlClient.SqlCommand)">
  7075. <param name="command">The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object to associate with this <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object. The constructor will set up a <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> object and bind it to the command.</param><summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class and associates it with the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> parameter.</summary><remarks>
  7076. <format type="text/markdown"><![CDATA[
  7077. ## Remarks
  7078. Internally, this constructor creates an instance of the <xref:Microsoft.Data.Sql.SqlNotificationRequest> class, and binds it to a <xref:Microsoft.Data.SqlClient.SqlCommand> object.
  7079. Query notifications are supported only for SELECT statements that meet a list of specific requirements. For more information, see [SQL Server Service Broker](/sql/database-engine/configure-windows/sql-server-service-broker) and [Working with Query Notifications](/sql/connect/oledb/features/working-with-query-notifications).
  7080. ]]></format>
  7081. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="command" /> parameter is NULL.</exception><exception cref="T:System.InvalidOperationException">The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object already has a <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> object assigned to its <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Notification" /> property, and that <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> is not associated with this dependency.</exception>
  7082. </member>
  7083. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor(Microsoft.Data.SqlClient.SqlCommand,System.String,System.Int32)">
  7084. <param name="command">The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object to associate with this <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object. The constructor sets up a <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> object and bind it to the command.</param><param name="options">The notification request options to be used by this dependency. <see langword="null" /> to use the default service.</param><param name="timeout">The time-out for this notification in seconds. The default is 0, indicating that the server's time-out should be used.</param><summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class, associates it with the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> parameter, and specifies notification options and a time-out value.</summary><remarks>
  7085. <format type="text/markdown"><![CDATA[
  7086. ## Remarks
  7087. Query notifications are supported only for SELECT statements that meet a list of specific requirements. For more information, see [SQL Server Service Broker](/sql/database-engine/configure-windows/sql-server-service-broker) and [Working with Query Notifications](/sql/connect/oledb/features/working-with-query-notifications).
  7088. ]]></format>
  7089. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="command" /> parameter is NULL.</exception><exception cref="T:System.ArgumentOutOfRangeException">The time-out value is less than zero.</exception><exception cref="T:System.InvalidOperationException">The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object already has a <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> object assigned to its <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Notification" /> property and that <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> is not associated with this dependency.
  7090. An attempt was made to create a **SqlDependency** instance from within SQLCLR.</exception>
  7091. </member>
  7092. <member name="P:Microsoft.Data.SqlClient.SqlDependency.HasChanges">
  7093. <summary>Gets a value that indicates whether one of the result sets associated with the dependency has changed.</summary><value>A Boolean value indicating whether one of the result sets has changed.</value><remarks>
  7094. <format type="text/markdown"><![CDATA[
  7095. ## Remarks
  7096. If you are not using the <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event, you can check the <xref:Microsoft.Data.SqlClient.SqlDependency.HasChanges%2A> property to determine if the query results have changed.
  7097. The <xref:Microsoft.Data.SqlClient.SqlDependency.HasChanges%2A> property does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate a change event.
  7098. ]]></format>
  7099. </remarks>
  7100. </member>
  7101. <member name="P:Microsoft.Data.SqlClient.SqlDependency.Id">
  7102. <summary>Gets a value that uniquely identifies this instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class.</summary><value>A string representation of a GUID that is generated for each instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class.</value><remarks>
  7103. <format type="text/markdown"><![CDATA[
  7104. ## Remarks
  7105. The <xref:Microsoft.Data.SqlClient.SqlDependency.Id%2A> property is used to uniquely identify a given <xref:Microsoft.Data.SqlClient.SqlDependency> instance.
  7106. ]]></format>
  7107. </remarks>
  7108. </member>
  7109. <member name="E:Microsoft.Data.SqlClient.SqlDependency.OnChange">
  7110. <summary>Occurs when a notification is received for any of the commands associated with this <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object.</summary><remarks>
  7111. <format type="text/markdown"><![CDATA[
  7112. ## Remarks
  7113. <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> occurs when the results for the associated command change. If you are not using <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange>, you can check the <xref:Microsoft.Data.SqlClient.SqlDependency.HasChanges%2A> property to determine whether the query results have changed.
  7114. The <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange>.
  7115. ]]></format>
  7116. </remarks>
  7117. </member>
  7118. <member name="M:Microsoft.Data.SqlClient.SqlDependency.AddCommandDependency(Microsoft.Data.SqlClient.SqlCommand)">
  7119. <param name="command">A <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object containing a statement that is valid for notifications.</param><summary>Associates a <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object with this <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> instance.</summary><remarks>
  7120. <format type="text/markdown"><![CDATA[
  7121. ## Remarks
  7122. Query notifications are supported only for SELECT statements that meet a list of specific requirements. For more information, see [SQL Server Service Broker](/sql/database-engine/configure-windows/sql-server-service-broker) and [Working with Query Notifications](/sql/connect/oledb/features/working-with-query-notifications).
  7123. ]]></format>
  7124. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="command" /> parameter is null.</exception><exception cref="T:System.InvalidOperationException">The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> object already has a <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> object assigned to its <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Notification" /> property, and that <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> is not associated with this dependency.</exception>
  7125. </member>
  7126. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String)">
  7127. <param name="connectionString">The connection string for the instance of SQL Server from which to obtain change notifications.</param><summary>Starts the listener for receiving dependency change notifications from the instance of SQL Server specified by the connection string.</summary><returns>
  7128. <see langword="true" /> if the listener initialized successfully; <see langword="false" /> if a compatible listener already exists.</returns><remarks>
  7129. <format type="text/markdown"><![CDATA[
  7130. ## Remarks
  7131. This method starts the listener for the <xref:System.AppDomain> for receiving dependency notifications from the instance of SQL Server specified by the `connectionString` parameter. This method may be called more than once with different connection strings for multiple servers.
  7132. For additional remarks, see <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A>.
  7133. ]]></format>
  7134. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="connectionString" /> parameter is NULL.</exception><exception cref="T:System.InvalidOperationException">The <paramref name="connectionString" /> parameter is the same as a previous call to this method, but the parameters are different.
  7135. The method was called from within the CLR.</exception><exception cref="T:System.Security.SecurityException">The caller does not have the required <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> code access security (CAS) permission.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">A subsequent call to the method has been made with an equivalent <paramref name="connectionString" /> parameter with a different user, or a user that does not default to the same schema.
  7136. Also, any underlying **SqlClient** exceptions.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />
  7137. </member>
  7138. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)">
  7139. <param name="connectionString">The connection string for the instance of SQL Server from which to obtain change notifications.</param><param name="queue">An existing SQL Server Service Broker queue to be used. If <see langword="null" />, the default queue is used.</param><summary>Starts the listener for receiving dependency change notifications from the instance of SQL Server specified by the connection string using the specified SQL Server Service Broker queue.</summary><returns>
  7140. <see langword="true" /> if the listener initialized successfully; <see langword="false" /> if a compatible listener already exists.</returns><remarks>
  7141. <format type="text/markdown"><![CDATA[
  7142. ## Remarks
  7143. This method starts the listener for the <xref:System.AppDomain> for receiving dependency notifications from the instance of SQL Server specified by the `connectionString` parameter. This method may be called more than once with different connection strings for multiple servers.
  7144. If no queue name is specified, <xref:Microsoft.Data.SqlClient.SqlDependency> creates a temporary queue and service in the server that is used for the entire process, even if the process involves more than one <xref:System.AppDomain>. The queue and service are automatically removed upon application shutdown.
  7145. For additional remarks, see <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A>.
  7146. ]]></format>
  7147. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="connectionString" /> parameter is NULL.</exception><exception cref="T:System.InvalidOperationException">The <paramref name="connectionString" /> parameter is the same as a previous call to this method, but the parameters are different.
  7148. The method was called from within the CLR.</exception><exception cref="T:System.Security.SecurityException">The caller does not have the required <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> code access security (CAS) permission.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">A subsequent call to the method has been made with an equivalent <paramref name="connectionString" /> parameter but a different user, or a user that does not default to the same schema.
  7149. Also, any underlying **SqlClient** exceptions.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />
  7150. </member>
  7151. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Stop(System.String)">
  7152. <param name="connectionString">Connection string for the instance of SQL Server that was used in a previous <see cref="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String)" /> call.</param><summary>Stops a listener for a connection specified in a previous <see cref="o:Microsoft.Data.SqlClient.SqlDependency.Start" /> call.</summary><returns>
  7153. <see langword="true" /> if the listener was completely stopped; <see langword="false" /> if the <see cref="T:System.AppDomain" /> was unbound from the listener, but there are is at least one other <see cref="T:System.AppDomain" /> using the same listener.</returns><remarks>
  7154. <format type="text/markdown"><![CDATA[
  7155. ## Remarks
  7156. The <xref:Microsoft.Data.SqlClient.SqlDependency.Stop%2A> method must be called for each <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A> call. A given listener only shuts down fully when it receives the same number of <xref:Microsoft.Data.SqlClient.SqlDependency.Stop%2A> requests as <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A> requests.
  7157. ]]></format>
  7158. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="connectionString" /> parameter is NULL.</exception><exception cref="T:System.InvalidOperationException">The method was called from within SQLCLR.</exception><exception cref="T:System.Security.SecurityException">The caller does not have the required <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> code access security (CAS) permission.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">An underlying **SqlClient** exception occurred.</exception>
  7159. </member>
  7160. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Stop(System.String,System.String)">
  7161. <param name="connectionString">Connection string for the instance of SQL Server that was used in a previous <see cref="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</param><param name="queue">The SQL Server Service Broker queue that was used in a previous <see cref="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</param><summary>Stops a listener for a connection specified in a previous <see cref="o:Microsoft.Data.SqlClient.SqlDependency.Start" /> call.</summary><returns>
  7162. <see langword="true" /> if the listener was completely stopped; <see langword="false" /> if the <see cref="T:System.AppDomain" /> was unbound from the listener, but there is at least one other <see cref="T:System.AppDomain" /> using the same listener.</returns><remarks>
  7163. <format type="text/markdown"><![CDATA[
  7164. ## Remarks
  7165. The <xref:Microsoft.Data.SqlClient.SqlDependency.Stop%2A> method must be called for each <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A> call. A given listener only shuts down fully when it receives the same number of <xref:Microsoft.Data.SqlClient.SqlDependency.Stop%2A> requests as <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A> requests.
  7166. ]]></format>
  7167. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="connectionString" /> parameter is NULL.</exception><exception cref="T:System.InvalidOperationException">The method was called from within SQLCLR.</exception><exception cref="T:System.Security.SecurityException">The caller does not have the required <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> code access security (CAS) permission.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">And underlying **SqlClient** exception occurred.</exception>
  7168. </member>
  7169. <member name="T:Microsoft.Data.SqlClient.SqlEnclaveAttestationParameters">
  7170. <summary>Encapsulates the information SqlClient sends to SQL Server to initiate the process of attesting and creating a secure session with the enclave, SQL Server uses for computations on columns protected using Always Encrypted.</summary><remarks>To be added.</remarks>
  7171. </member>
  7172. <member name="M:Microsoft.Data.SqlClient.SqlEnclaveAttestationParameters.#ctor(System.Int32,System.Byte[],System.Security.Cryptography.ECDiffieHellmanCng)">
  7173. <param name="protocol">The enclave attestation protocol.</param><param name="input">The input of the enclave attestation protocol.</param><param name="clientDiffieHellmanKey">A Diffie-Hellman algorithm that encapsulates a client-side key pair.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlEnclaveAttestationParameters" /> class.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentNullException">
  7174. <paramref name="clientDiffieHellmanKey" /> is <see langword="null" />.</exception>
  7175. </member>
  7176. <member name="P:Microsoft.Data.SqlClient.SqlEnclaveAttestationParameters.ClientDiffieHellmanKey">
  7177. <summary>Gets a Diffie-Hellman algorithm that encapsulates a key pair that SqlClient uses to establish a secure session with the enclave.</summary><value>The Diffie-Hellman algorithm.</value><remarks>To be added.</remarks>
  7178. </member>
  7179. <member name="P:Microsoft.Data.SqlClient.SqlEnclaveAttestationParameters.Protocol">
  7180. <summary>Gets the enclave attestation protocol identifier.</summary><value>The enclave attestation protocol identifier.</value><remarks>To be added.</remarks>
  7181. </member>
  7182. <member name="M:Microsoft.Data.SqlClient.SqlEnclaveAttestationParameters.GetInput">
  7183. <summary>Gets the information used to initiate the process of attesting the enclave. The format and the content of this information is specific to the attestation protocol.</summary><returns>The information required by SQL Server to execute attestation protocol identified by EnclaveAttestationProtocols.</returns><remarks>To be added.</remarks>
  7184. </member>
  7185. <member name="T:Microsoft.Data.SqlClient.SqlEnclaveSession">
  7186. <summary>Encapsulates the state of a secure session between SqlClient and an enclave inside SQL Server, which can be used for computations on encrypted columns protected with Always Encrypted.</summary><remarks>To be added.</remarks>
  7187. </member>
  7188. <member name="M:Microsoft.Data.SqlClient.SqlEnclaveSession.#ctor(System.Byte[],System.Int64)">
  7189. <param name="sessionKey">The symmetric key used to encrypt all the information sent using the session.</param><param name="sessionId">The session ID.</param><summary>Instantiates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlEnclaveSession" /> class.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentNullException">
  7190. <paramref name="sessionKey" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">
  7191. <paramref name="sessionKey" /> has zero length.</exception>
  7192. </member>
  7193. <member name="P:Microsoft.Data.SqlClient.SqlEnclaveSession.SessionId">
  7194. <summary>Gets the session ID.</summary><value>The session ID.</value><remarks>To be added.</remarks>
  7195. </member>
  7196. <member name="M:Microsoft.Data.SqlClient.SqlEnclaveSession.GetSessionKey">
  7197. <summary>Gets the symmetric key that SqlClient uses to encrypt all the information it sends to the enclave using the session.</summary><returns>The symmetric key.</returns><remarks>To be added.</remarks>
  7198. </member>
  7199. <member name="T:Microsoft.Data.SqlClient.SqlError">
  7200. <summary>Collects information relevant to a warning or error returned by SQL Server.</summary><remarks>
  7201. <format type="text/markdown"><![CDATA[
  7202. ## Remarks
  7203. This class is created by the .NET Framework Data Provider for SQL Server when an error occurs. An instance of <xref:Microsoft.Data.SqlClient.SqlError> is created and managed by the <xref:Microsoft.Data.SqlClient.SqlErrorCollection>, which in turn is created by the <xref:Microsoft.Data.SqlClient.SqlException> class.
  7204. Messages with a severity level of 10 or less are informational and indicate problems caused by mistakes in information that a user has entered. Severity levels from 11 through 16 are generated by the user, and can be corrected by the user. Severity levels from 17 through 25 indicate software or hardware errors. When a level 17, 18, or 19 error occurs, you can continue working, although you might not be able to execute a particular statement.
  7205. The <xref:Microsoft.Data.SqlClient.SqlConnection> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server usually closes the <xref:Microsoft.Data.SqlClient.SqlConnection>. However, the user can reopen the connection and continue. In both cases, a <xref:Microsoft.Data.SqlClient.SqlException> is generated by the method executing the command.
  7206. For more information on errors generated by SQL Server, see [Cause and Resolution of Database Engine Errors](https://msdn.microsoft.com/library/ms365262.aspx). For more information about severity levels, see [Database Engine Error Severities](https://msdn.microsoft.com/library/ms164086.aspx).
  7207. ## Examples
  7208. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7209. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7210. ]]></format>
  7211. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlException" />
  7212. </member>
  7213. <member name="P:Microsoft.Data.SqlClient.SqlError.Class">
  7214. <summary>Gets the severity level of the error returned from SQL Server.</summary><value>A value from 1 to 25 that indicates the severity level of the error. The default is 0.</value><remarks>
  7215. <format type="text/markdown"><![CDATA[
  7216. ## Remarks
  7217. Messages with a severity level of 10 or less are informational and indicate problems caused by mistakes in information that a user has entered. Severity levels from 11 through 16 are generated by the user, and can be corrected by the user. Severity levels from 17 through 25 indicate software or hardware errors. When a level 17, 18, or 19 error occurs, you can continue working, although you might not be able to execute a particular statement.
  7218. The <xref:Microsoft.Data.SqlClient.SqlConnection> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server usually closes the <xref:Microsoft.Data.SqlClient.SqlConnection>. However, the user can reopen the connection and continue. In both cases, a <xref:Microsoft.Data.SqlClient.SqlException> is generated by the method executing the command.
  7219. For more information on errors generated by SQL Server, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  7220. ## Examples
  7221. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7222. [!code-csharp[SqlError_State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7223. ]]></format>
  7224. </remarks>
  7225. </member>
  7226. <member name="P:Microsoft.Data.SqlClient.SqlError.LineNumber">
  7227. <summary>Gets the line number within the Transact-SQL command batch or stored procedure that contains the error.</summary><value>The line number within the Transact-SQL command batch or stored procedure that contains the error.</value><remarks>
  7228. <format type="text/markdown"><![CDATA[
  7229. ## Remarks
  7230. Line numbering starts at 1. If the value is 0, the line number is not applicable.
  7231. For more information on errors generated by SQL Server, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  7232. ## Examples
  7233. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7234. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7235. ]]></format>
  7236. </remarks>
  7237. </member>
  7238. <member name="P:Microsoft.Data.SqlClient.SqlError.Message">
  7239. <summary>Gets the text describing the error.</summary><value>The text describing the error. For more information on errors generated by SQL Server, see <see href="/sql/relational-databases/errors-events/database-engine-events-and-errors">Database Engine Events and Errors</see>.</value><remarks>
  7240. <format type="text/markdown"><![CDATA[
  7241. ## Examples
  7242. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7243. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7244. ]]></format>
  7245. </remarks>
  7246. </member>
  7247. <member name="P:Microsoft.Data.SqlClient.SqlError.Number">
  7248. <summary>Gets a number that identifies the type of error.</summary><value>The number that identifies the type of error.</value><remarks>
  7249. <format type="text/markdown"><![CDATA[
  7250. ## Remarks
  7251. The following table describes the possible values for this property:
  7252. |Source of Error|SqlError.Number|SqlError.State|SqlException has inner Win32Exception (beginning with.NET Framework 4.5)|
  7253. |---------------------|---------------------|--------------------|--------------------------------------------------------------------------------|
  7254. |Error from server|Server error code<br /><br /> This number corresponds to an entry in the `master.dbo.sysmessages` table.|Typically greater than 0|No|
  7255. |Connection timeout|-2|0|Yes (Number = 258)|
  7256. |Communication error (non-LocalDB)|Win32 error code|0|Yes (Number = Win32 error code)|
  7257. |Communication error (LocalDB)|Win32 error code|0|No|
  7258. |Encryption capability mismatch|20|0|No|
  7259. |Failed to start LocalDB|Win32 error code|0|No|
  7260. |Read-only routing failure|0|0|No|
  7261. |Server had severe error processing query|0|0|No|
  7262. |Processed cancellation while parsing results|0|0|No|
  7263. |Failed to create user instance|0|0|No|
  7264. For more information on errors generated by SQL Server, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  7265. ## Examples
  7266. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7267. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7268. ]]></format>
  7269. </remarks>
  7270. </member>
  7271. <member name="P:Microsoft.Data.SqlClient.SqlError.Procedure">
  7272. <summary>Gets the name of the stored procedure or remote procedure call (RPC) that generated the error.</summary><value>The name of the stored procedure or RPC. For more information on errors generated by SQL Server, see <see href="/sql/relational-databases/errors-events/database-engine-events-and-errors">Database Engine Events and Errors</see>.</value><remarks>
  7273. <format type="text/markdown"><![CDATA[
  7274. ## Examples
  7275. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7276. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7277. ]]></format>
  7278. </remarks>
  7279. </member>
  7280. <member name="P:Microsoft.Data.SqlClient.SqlError.Server">
  7281. <summary>Gets the name of the instance of SQL Server that generated the error.</summary><value>The name of the instance of SQL Server.</value><remarks>
  7282. <format type="text/markdown"><![CDATA[
  7283. ## Examples
  7284. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7285. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7286. ]]></format>
  7287. </remarks>
  7288. </member>
  7289. <member name="P:Microsoft.Data.SqlClient.SqlError.Source">
  7290. <summary>Gets the name of the provider that generated the error.</summary><value>The name of the provider that generated the error.</value><remarks>
  7291. <format type="text/markdown"><![CDATA[
  7292. ## Examples
  7293. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7294. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7295. ]]></format>
  7296. </remarks>
  7297. </member>
  7298. <member name="P:Microsoft.Data.SqlClient.SqlError.State">
  7299. <summary>Some error messages can be raised at multiple points in the code for the Database Engine. For example, an 1105 error can be raised for several different conditions. Each specific condition that raises an error assigns a unique state code.</summary><value>The state code.</value><remarks>
  7300. <format type="text/markdown"><![CDATA[
  7301. ## Remarks
  7302. State is only set for errors that are received from the server.
  7303. For more information on errors generated by SQL Server, see [Understanding Database Engine Errors](https://msdn.microsoft.com/library/ms165761.aspx).
  7304. ## Examples
  7305. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7306. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7307. ]]></format>
  7308. </remarks>
  7309. </member>
  7310. <member name="M:Microsoft.Data.SqlClient.SqlError.ToString">
  7311. <summary>Gets the complete text of the error message.</summary><returns>The complete text of the error.</returns><remarks>
  7312. <format type="text/markdown"><![CDATA[
  7313. ## Remarks
  7314. The string is in the form "SqlError:", followed by the <xref:Microsoft.Data.SqlClient.SqlError.Message%2A>, and the stack trace. For example:
  7315. SqlError:UserId or Password not valid. \<stack trace>
  7316. ## Examples
  7317. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7318. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7319. ]]></format>
  7320. </remarks>
  7321. </member>
  7322. <member name="T:Microsoft.Data.SqlClient.SqlErrorCollection">
  7323. <summary>Collects all errors generated by the .NET Framework Data Provider for SQL Server. This class cannot be inherited.</summary><remarks>
  7324. <format type="text/markdown"><![CDATA[
  7325. ## Remarks
  7326. This class is created by <xref:Microsoft.Data.SqlClient.SqlException> to collect instances of the <xref:Microsoft.Data.SqlClient.SqlError> class. <xref:Microsoft.Data.SqlClient.SqlErrorCollection> always contains at least one instance of the <xref:Microsoft.Data.SqlClient.SqlError> class.
  7327. ## Examples
  7328. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7329. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7330. ]]></format>
  7331. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlError" /><altmember cref="T:Microsoft.Data.SqlClient.SqlException" />
  7332. </member>
  7333. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.Count">
  7334. <summary>Gets the number of errors in the collection.</summary><value>The total number of errors in the collection.</value><remarks>
  7335. <format type="text/markdown"><![CDATA[
  7336. ## Examples
  7337. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7338. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7339. ]]></format>
  7340. </remarks>
  7341. </member>
  7342. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.Item(System.Int32)">
  7343. <param name="index">The zero-based index of the error to retrieve.</param><summary>Gets the error at the specified index.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlError" /> that contains the error at the specified index.</value><remarks>
  7344. <format type="text/markdown"><![CDATA[
  7345. ## Examples
  7346. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7347. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7348. ]]></format>
  7349. </remarks><exception cref="T:System.IndexOutOfRangeException">Index parameter is outside array bounds.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlErrorCollection.Count" />
  7350. </member>
  7351. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.System#Collections#ICollection#IsSynchronized">
  7352. <summary>For a description of this member, see <see cref="P:System.Collections.ICollection.IsSynchronized" />.</summary><value>
  7353. <see langword="true" /> if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, <see langword="false" />.</value><remarks>
  7354. <format type="text/markdown"><![CDATA[
  7355. ## Remarks
  7356. This member is an explicit interface member implementation. It can be used only when the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> instance is cast to an <xref:System.Collections.ICollection> interface.
  7357. ]]></format>
  7358. </remarks>
  7359. </member>
  7360. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.System#Collections#ICollection#SyncRoot">
  7361. <summary>For a description of this member, see <see cref="P:System.Collections.ICollection.SyncRoot" />.</summary><value>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection" />.</value><remarks>
  7362. <format type="text/markdown"><![CDATA[
  7363. ## Remarks
  7364. This member is an explicit interface member implementation. It can be used only when the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> instance is cast to an <xref:System.Collections.ICollection> interface.
  7365. ]]></format>
  7366. </remarks>
  7367. </member>
  7368. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.CopyTo(System.Array,System.Int32)">
  7369. <param name="array">The <see cref="T:System.Array" /> to copy elements into.</param><param name="index">The index from which to start copying into the <paramref name="array" /> parameter.</param><summary>Copies the elements of the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /> collection into an <see cref="T:System.Array" />, starting at the specified index.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">The sum of <paramref name="index" /> and the number of elements in the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /> collection is greater than the <see cref="P:System.Array.Length" /> of the <see cref="T:System.Array" />.</exception><exception cref="T:System.ArgumentNullException">The <paramref name="array" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> is not valid for <paramref name="array" />.</exception>
  7370. </member>
  7371. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.CopyTo(Microsoft.Data.SqlClient.SqlError[],System.Int32)">
  7372. <param name="array">The <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /> to copy the elements into.</param><param name="index">The index from which to start copying into the <paramref name="array" /> parameter.</param><summary>Copies the elements of the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /> collection into a <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />, starting at the specified index.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">The sum of <paramref name="index" /> and the number of elements in the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /> collection is greater than the length of the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />.</exception><exception cref="T:System.ArgumentNullException">The <paramref name="array" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="index" /> is not valid for <paramref name="array" />.</exception>
  7373. </member>
  7374. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.GetEnumerator">
  7375. <summary>Returns an enumerator that iterates through the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />.</summary><returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />.</returns><remarks>
  7376. <format type="text/markdown"><![CDATA[
  7377. ## Remarks
  7378. Enumerators can be used to read the data in a collection, but they cannot be used to modify the underlying collection.
  7379. ]]></format>
  7380. </remarks>
  7381. </member>
  7382. <member name="T:Microsoft.Data.SqlClient.SqlException">
  7383. <summary>The exception that is thrown when SQL Server returns a warning or error. This class cannot be inherited.</summary><remarks>
  7384. <format type="text/markdown"><![CDATA[
  7385. ## Remarks
  7386. This class is created whenever the .NET Framework Data Provider for SQL Server encounters an error generated from the server. (Client side errors are thrown as standard common language runtime exceptions.) <xref:Microsoft.Data.SqlClient.SqlException> always contains at least one instance of <xref:Microsoft.Data.SqlClient.SqlError>.
  7387. Messages that have a severity level of 10 or less are informational and indicate problems caused by mistakes in information that a user has entered. Severity levels from 11 through 16 are generated by the user, and can be corrected by the user. Severity levels from 17 through 25 indicate software or hardware errors. When a level 17, 18, or 19 error occurs, you can continue working, although you might not be able to execute a particular statement.
  7388. The <xref:Microsoft.Data.SqlClient.SqlConnection> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the <xref:Microsoft.Data.SqlClient.SqlConnection>. However, the user can reopen the connection and continue. In both cases, a <xref:Microsoft.Data.SqlClient.SqlException> is generated by the method executing the command.
  7389. For information about the warning and informational messages sent by SQL Server, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors). The <xref:Microsoft.Data.SqlClient.SqlException> class maps to SQL Server severity.
  7390. The following is general information on handling exceptions. Your code should catch exceptions to prevent the application from crashing and to allow displaying a relevant error message to the user. You can use database transactions to ensure that the data is consistent regardless of what happens in the client application (including a crash). Features like System.Transaction.TransactionScope or the BeginTransaction method (in System.Data.OleDb.OleDbConnection, System.Data.ODBC.ODBCConnection, and Microsoft.Data.SqlClient.SqlConnection) ensure consistent data regardless of exceptions raised by a provider. Transactions can fail, so catch failures and retry the transaction.
  7391. Note that beginning with .NET Framework 4.5, <xref:Microsoft.Data.SqlClient.SqlException> can return an inner <xref:System.ComponentModel.Win32Exception>.
  7392. The exception class of a .NET Framework data provider reports provider-specific errors. For example System.Data.Odbc has OdbcException, System.Data.OleDb has OleDbException, and Microsoft.Data.SqlClient has SqlException. For the best level of error detail, catch these exceptions and use the members of these exception classes to get details of the error.
  7393. In addition to the provider-specific errors, .NET Framework data provider types can raise .NET Framework exceptions such as System.OutOfMemoryException and System.Threading.ThreadAbortException. Recovery from these exceptions may not be possible.
  7394. Bad input can cause a .NET Framework data provider type to raise an exception such as System.ArgumentException or System.IndexOutOfRangeException. Calling a method at the wrong time can raise System.InvalidOperationException.
  7395. So, in general, write an exception handler that catches any provider specific exceptions as well as exceptions from the common language runtime. These can be layered as follows:
  7396. ```csharp
  7397. try {
  7398. // code here
  7399. }
  7400. catch (SqlException odbcEx) {
  7401. // Handle more specific SqlException exception here.
  7402. }
  7403. catch (Exception ex) {
  7404. // Handle generic ones here.
  7405. }
  7406. ```
  7407. Or:
  7408. ```csharp
  7409. try {
  7410. // code here
  7411. }
  7412. catch (Exception ex) {
  7413. if (ex is SqlException) {
  7414. // Handle more specific SqlException exception here.
  7415. }
  7416. else {
  7417. // Handle generic ones here.
  7418. }
  7419. }
  7420. ```
  7421. It is also possible for a .NET Framework data provider method call to fail on a thread pool thread with no user code on the stack. In this case, and when using asynchronous method calls, you must register the <xref:System.AppDomain.UnhandledException> event to handle those exceptions and avoid application crash.
  7422. ## Examples
  7423. The following example generates a <xref:Microsoft.Data.SqlClient.SqlException> and then displays the exception.
  7424. [!code-csharp[SqlException_Errors1 Example#1](~/../sqlclient/doc/samples/SqlException_Errors1.cs#1)]
  7425. ]]></format>
  7426. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlError" /><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />
  7427. </member>
  7428. <member name="P:Microsoft.Data.SqlClient.SqlException.Class">
  7429. <summary>Gets the severity level of the error returned from the .NET Framework Data Provider for SQL Server.</summary><value>A value from 1 to 25 that indicates the severity level of the error.</value><remarks>
  7430. <format type="text/markdown"><![CDATA[
  7431. ## Remarks
  7432. Messages that have a severity level of 10 or less are informational and indicate problems caused by mistakes in information that a user has entered. Severity levels from 11 through 16 are generated by the user, and can be corrected by the user. Severity levels from 17 through 25 indicate software or hardware errors. When a level 17, 18, or 19 error occurs, you can continue working, although you might not be able to execute a particular statement.
  7433. The <xref:Microsoft.Data.SqlClient.SqlConnection> remains open when the severity level is 19 or less. When the severity level is 20 or greater, the server ordinarily closes the <xref:Microsoft.Data.SqlClient.SqlConnection>. However, the user can reopen the connection and continue. In both cases, a <xref:Microsoft.Data.SqlClient.SqlException> is generated by the method executing the command.
  7434. For information about the warning and informational messages sent by SQL Server, see the Troubleshooting section of the SQL Server documentation.
  7435. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Class%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property.
  7436. ## Examples
  7437. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7438. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7439. ]]></format>
  7440. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Number" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Source" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.State" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Server" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Procedure" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.LineNumber" />
  7441. </member>
  7442. <member name="P:Microsoft.Data.SqlClient.SqlException.ClientConnectionId">
  7443. <summary>Represents the client connection ID. For more information, see <see href="https://docs.microsoft.com/dotnet/framework/data/adonet/data-tracing">Data Tracing in ADO.NET</see>.</summary><value>The client connection ID.</value><remarks>
  7444. <format type="text/markdown"><![CDATA[
  7445. ## Remarks
  7446. For a code sample, see <xref:Microsoft.Data.SqlClient.SqlException.ToString%2A>.
  7447. ]]></format>
  7448. </remarks>
  7449. </member>
  7450. <member name="P:Microsoft.Data.SqlClient.SqlException.Errors">
  7451. <summary>Gets a collection of one or more <see cref="T:Microsoft.Data.SqlClient.SqlError" /> objects that give detailed information about exceptions generated by the .NET Framework Data Provider for SQL Server.</summary><value>The collected instances of the <see cref="T:Microsoft.Data.SqlClient.SqlError" /> class.</value><remarks>
  7452. <format type="text/markdown"><![CDATA[
  7453. ## Remarks
  7454. The <xref:Microsoft.Data.SqlClient.SqlErrorCollection> class always contains at least one instance of the <xref:Microsoft.Data.SqlClient.SqlError> class.
  7455. This is a wrapper for <xref:Microsoft.Data.SqlClient.SqlErrorCollection>. For more information on SQL Server engine errors, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  7456. ## Examples
  7457. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7458. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7459. ]]></format>
  7460. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlError" />
  7461. </member>
  7462. <member name="P:Microsoft.Data.SqlClient.SqlException.LineNumber">
  7463. <summary>Gets the line number within the Transact-SQL command batch or stored procedure that generated the error.</summary><value>The line number within the Transact-SQL command batch or stored procedure that generated the error.</value><remarks>
  7464. <format type="text/markdown"><![CDATA[
  7465. ## Remarks
  7466. The line numbering starts at 1; if 0 is returned, the line number is not applicable.
  7467. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.LineNumber%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property.
  7468. ## Examples
  7469. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7470. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7471. ]]></format>
  7472. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Number" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Source" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.State" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Class" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Server" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Procedure" />
  7473. </member>
  7474. <member name="P:Microsoft.Data.SqlClient.SqlException.Number">
  7475. <summary>Gets a number that identifies the type of error.</summary><value>The number that identifies the type of error.</value><remarks>
  7476. <format type="text/markdown"><![CDATA[
  7477. ## Remarks
  7478. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Number%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property. For more information on SQL Server engine errors, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  7479. ## Examples
  7480. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7481. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7482. ]]></format>
  7483. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.State" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Class" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Source" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Server" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Procedure" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.LineNumber" />
  7484. </member>
  7485. <member name="P:Microsoft.Data.SqlClient.SqlException.Procedure">
  7486. <summary>Gets the name of the stored procedure or remote procedure call (RPC) that generated the error.</summary><value>The name of the stored procedure or RPC.</value><remarks>
  7487. <format type="text/markdown"><![CDATA[
  7488. ## Remarks
  7489. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Procedure%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property.
  7490. ## Examples
  7491. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7492. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7493. ]]></format>
  7494. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Number" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.State" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Class" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Server" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Source" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.LineNumber" />
  7495. </member>
  7496. <member name="P:Microsoft.Data.SqlClient.SqlException.Server">
  7497. <summary>Gets the name of the computer that is running an instance of SQL Server that generated the error.</summary><value>The name of the computer running an instance of SQL Server.</value><remarks>
  7498. <format type="text/markdown"><![CDATA[
  7499. ## Remarks
  7500. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Server%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property.
  7501. ## Examples
  7502. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7503. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7504. ]]></format>
  7505. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Number" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.State" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Source" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Class" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Procedure" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.LineNumber" />
  7506. </member>
  7507. <member name="P:Microsoft.Data.SqlClient.SqlException.Source">
  7508. <summary>Gets the name of the provider that generated the error.</summary><value>The name of the provider that generated the error.</value><remarks>
  7509. <format type="text/markdown"><![CDATA[
  7510. ## Remarks
  7511. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Source%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property.
  7512. ## Examples
  7513. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7514. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7515. ]]></format>
  7516. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Number" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.State" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Class" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Server" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Procedure" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.LineNumber" />
  7517. </member>
  7518. <member name="P:Microsoft.Data.SqlClient.SqlException.State">
  7519. <summary>Gets a numeric error code from SQL Server that represents an error, warning or "no data found" message. For more information about how to decode these values, see <see href="/sql/relational-databases/errors-events/database-engine-events-and-errors">Database Engine Events and Errors</see>.</summary><value>The number representing the error code.</value><remarks>
  7520. <format type="text/markdown"><![CDATA[
  7521. ## Remarks
  7522. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.State%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property.
  7523. ## Examples
  7524. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7525. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  7526. ]]></format>
  7527. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Number" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Class" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Source" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Server" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.Procedure" /><altmember cref="P:Microsoft.Data.SqlClient.SqlException.LineNumber" />
  7528. </member>
  7529. <member name="M:Microsoft.Data.SqlClient.SqlException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
  7530. <param name="si">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param><param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param><summary>Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.</summary><remarks>
  7531. <format type="text/markdown"><![CDATA[
  7532. ## Remarks
  7533. `GetObjectData` sets a `SerializationInfo` with all the exception object data targeted for serialization. During deserialization, the exception is reconstituted from the `SerializationInfo` transmitted over the stream.
  7534. ]]></format>
  7535. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="si" /> parameter is a null reference (<see langword="Nothing" /> in Visual Basic).</exception>
  7536. </member>
  7537. <member name="M:Microsoft.Data.SqlClient.SqlException.ToString">
  7538. <summary>Returns a string that represents the current <see cref="T:Microsoft.Data.SqlClient.SqlException" /> object, and includes the client connection ID (for more information, see <see cref="P:Microsoft.Data.SqlClient.SqlException.ClientConnectionId" />).</summary><returns>A string that represents the current <see cref="T:Microsoft.Data.SqlClient.SqlException" /> object.<see cref="T:System.String" />.</returns><remarks>
  7539. <format type="text/markdown"><![CDATA[
  7540. ## Examples
  7541. The following C# example shows how a connection attempt to a valid server but non-existent database causes a <xref:Microsoft.Data.SqlClient.SqlException>, which includes the client connection ID:
  7542. ```csharp
  7543. using Microsoft.Data.SqlClient;
  7544. using System;
  7545. public class A {
  7546. public static void Main() {
  7547. SqlConnection connection = new SqlConnection();
  7548. connection.ConnectionString = "Data Source=a_valid_server;Initial Catalog=Northwinda;Integrated Security=true";
  7549. try {
  7550. connection.Open();
  7551. }
  7552. catch (SqlException p) {
  7553. Console.WriteLine("{0}", p.ClientConnectionId);
  7554. Console.WriteLine("{0}", p.ToString());
  7555. }
  7556. connection.Close();
  7557. }
  7558. }
  7559. ```
  7560. The following Visual Basic sample is functionally equivalent to the previous (C#) sample:
  7561. ```vb
  7562. Imports Microsoft.Data.SqlClient
  7563. Imports System
  7564. Module Module1
  7565. Sub Main()
  7566. Dim connection As New SqlConnection()
  7567. connection.ConnectionString = "Data Source=a_valid_server;Initial Catalog=Northwinda;Integrated Security=true"
  7568. Try
  7569. connection.Open()
  7570. Catch p As SqlException
  7571. Console.WriteLine("{0}", p.ClientConnectionId)
  7572. Console.WriteLine("{0}", p.ToString())
  7573. End Try
  7574. connection.Close()
  7575. End Sub
  7576. End Module
  7577. ```
  7578. ]]></format>
  7579. </remarks>
  7580. </member>
  7581. <member name="T:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs">
  7582. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage" /> event.</summary><remarks>
  7583. <format type="text/markdown"><![CDATA[
  7584. ## Remarks
  7585. The <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event contains a <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection which contains the warnings sent from the server.
  7586. An <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event is generated when a SQL Server message with a severity level of 10 or less occurs.
  7587. ]]></format>
  7588. </remarks>
  7589. </member>
  7590. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Errors">
  7591. <summary>Gets the collection of warnings sent from the server.</summary><value>The collection of warnings sent from the server.</value><remarks>To be added.</remarks>
  7592. </member>
  7593. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Message">
  7594. <summary>Gets the full text of the error sent from the database.</summary><value>The full text of the error.</value><remarks>
  7595. <format type="text/markdown"><![CDATA[
  7596. ## Remarks
  7597. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Message%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Errors%2A> collection.
  7598. ]]></format>
  7599. </remarks>
  7600. </member>
  7601. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Source">
  7602. <summary>Gets the name of the object that generated the error.</summary><value>The name of the object that generated the error.</value><remarks>
  7603. <format type="text/markdown"><![CDATA[
  7604. ## Remarks
  7605. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Source%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Errors%2A> collection.
  7606. ]]></format>
  7607. </remarks>
  7608. </member>
  7609. <member name="M:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.ToString">
  7610. <summary>Retrieves a string representation of the <see cref="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage" /> event.</summary><returns>A string representing the <see cref="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage" /> event.</returns><remarks>To be added.</remarks>
  7611. </member>
  7612. <member name="T:Microsoft.Data.SqlClient.SqlInfoMessageEventHandler">
  7613. <param name="sender">The source of the event.</param><param name="e">A <see cref="T:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs" /> object that contains the event data.</param><summary>Represents the method that will handle the <see cref="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage" /> event of a <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />.</summary><remarks>
  7614. <format type="text/markdown"><![CDATA[
  7615. ## Remarks
  7616. When you create a <xref:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
  7617. ]]></format>
  7618. </remarks>
  7619. </member>
  7620. <member name="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs">
  7621. <summary>Represents the set of arguments passed to the notification event handler.</summary><remarks>To be added.</remarks>
  7622. </member>
  7623. <member name="M:Microsoft.Data.SqlClient.SqlNotificationEventArgs.#ctor(Microsoft.Data.SqlClient.SqlNotificationType,Microsoft.Data.SqlClient.SqlNotificationInfo,Microsoft.Data.SqlClient.SqlNotificationSource)">
  7624. <param name="type">
  7625. <see cref="T:Microsoft.Data.SqlClient.SqlNotificationType" /> value that indicates whether this notification is generated because of an actual change, or by the subscription.</param><param name="info">
  7626. <see cref="T:Microsoft.Data.SqlClient.SqlNotificationInfo" /> value that indicates the reason for the notification event. This may occur because the data in the store actually changed, or the notification became invalid (for example, it timed out).</param><param name="source">
  7627. <see cref="T:Microsoft.Data.SqlClient.SqlNotificationSource" /> value that indicates the source that generated the notification.</param><summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs" /> object.</summary><remarks>To be added.</remarks>
  7628. </member>
  7629. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Info">
  7630. <summary>Gets a value that indicates the reason for the notification event, such as a row in the database being modified or a table being truncated.</summary><value>The notification event reason.</value><remarks>
  7631. <format type="text/markdown"><![CDATA[
  7632. ## Remarks
  7633. This event may occur because the data in the store actually changed, or the notification is no longer valid (for example, it timed out).
  7634. ]]></format>
  7635. </remarks>
  7636. </member>
  7637. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Source">
  7638. <summary>Gets a value that indicates the source that generated the notification, such as a change to the query data or the database's state.</summary><value>The source of the notification.</value><remarks>To be added.</remarks>
  7639. </member>
  7640. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Type">
  7641. <summary>Gets a value that indicates whether this notification is generated because of an actual change, or by the subscription.</summary><value>A value indicating whether the notification was generated by a change or a subscription.</value><remarks>To be added.</remarks>
  7642. </member>
  7643. <member name="T:Microsoft.Data.SqlClient.SqlNotificationInfo">
  7644. <summary>This enumeration provides additional information about the different notifications that can be received by the dependency event handler.</summary><remarks>
  7645. <format type="text/markdown"><![CDATA[
  7646. ## Remarks
  7647. The <xref:Microsoft.Data.SqlClient.SqlNotificationInfo> enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class.
  7648. ]]></format>
  7649. </remarks>
  7650. </member>
  7651. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.AlreadyChanged">
  7652. <summary>The <see langword="SqlDependency" /> object already fired, and new commands cannot be added to it.</summary>
  7653. </member>
  7654. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Alter">
  7655. <summary>An underlying server object related to the query was modified.</summary>
  7656. </member>
  7657. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Delete">
  7658. <summary>Data was changed by a DELETE statement.</summary>
  7659. </member>
  7660. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Drop">
  7661. <summary>An underlying object related to the query was dropped.</summary>
  7662. </member>
  7663. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Error">
  7664. <summary>An internal server error occurred.</summary>
  7665. </member>
  7666. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Expired">
  7667. <summary>The <see langword="SqlDependency" /> object has expired.</summary>
  7668. </member>
  7669. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Insert">
  7670. <summary>Data was changed by an INSERT statement.</summary>
  7671. </member>
  7672. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Invalid">
  7673. <summary>A statement was provided that cannot be notified (for example, an UPDATE statement).</summary>
  7674. </member>
  7675. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Isolation">
  7676. <summary>The statement was executed under an isolation mode that was not valid (for example, Snapshot).</summary>
  7677. </member>
  7678. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Merge">
  7679. <summary>Used to distinguish the server-side cause for a query notification firing.</summary>
  7680. </member>
  7681. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Options">
  7682. <summary>The SET options were not set appropriately at subscription time.</summary>
  7683. </member>
  7684. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.PreviousFire">
  7685. <summary>A previous statement has caused query notifications to fire under the current transaction.</summary>
  7686. </member>
  7687. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Query">
  7688. <summary>A SELECT statement that cannot be notified or was provided.</summary>
  7689. </member>
  7690. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Resource">
  7691. <summary>Fires as a result of server resource pressure.</summary>
  7692. </member>
  7693. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Restart">
  7694. <summary>The server was restarted (notifications are sent during restart.).</summary>
  7695. </member>
  7696. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.TemplateLimit">
  7697. <summary>The subscribing query causes the number of templates on one of the target tables to exceed the maximum allowable limit.</summary>
  7698. </member>
  7699. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Truncate">
  7700. <summary>One or more tables were truncated.</summary>
  7701. </member>
  7702. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Unknown">
  7703. <summary>Used when the info option sent by the server was not recognized by the client.</summary>
  7704. </member>
  7705. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Update">
  7706. <summary>Data was changed by an UPDATE statement.</summary>
  7707. </member>
  7708. <member name="T:Microsoft.Data.SqlClient.SqlNotificationSource">
  7709. <summary>Indicates the source of the notification received by the dependency event handler.</summary><remarks>
  7710. <format type="text/markdown"><![CDATA[
  7711. ## Remarks
  7712. The `SqlNotificationSource` enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class.
  7713. Query notifications are supported only for SELECT statements that meet a list of specific requirements. For more information, see [SQL Server Service Broker](/sql/database-engine/configure-windows/sql-server-service-broker) and [Working with Query Notifications](/sql/connect/oledb/features/working-with-query-notifications).
  7714. ]]></format>
  7715. </remarks>
  7716. </member>
  7717. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Client">
  7718. <summary>A client-initiated notification occurred, such as a client-side time-out or as a result of attempting to add a command to a dependency that has already fired.</summary>
  7719. </member>
  7720. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Data">
  7721. <summary>Data has changed; for example, an insert, update, delete, or truncate operation occurred.</summary>
  7722. </member>
  7723. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Database">
  7724. <summary>The database state changed; for example, the database related to the query was dropped or detached.</summary>
  7725. </member>
  7726. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Environment">
  7727. <summary>The run-time environment was not compatible with notifications; for example, the isolation level was set to snapshot, or one or more SET options are not compatible.</summary>
  7728. </member>
  7729. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Execution">
  7730. <summary>A run-time error occurred during execution.</summary>
  7731. </member>
  7732. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Object">
  7733. <summary>A database object changed; for example, an underlying object related to the query was dropped or modified.</summary>
  7734. </member>
  7735. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Owner">
  7736. <summary>Internal only; not intended to be used in your code.</summary>
  7737. </member>
  7738. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Statement">
  7739. <summary>The Transact-SQL statement is not valid for notifications; for example, a SELECT statement that could not be notified or a non-SELECT statement was executed.</summary>
  7740. </member>
  7741. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.System">
  7742. <summary>A system-related event occurred. For example, there was an internal error, the server was restarted, or resource pressure caused the invalidation.</summary>
  7743. </member>
  7744. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Timeout">
  7745. <summary>The subscription time-out expired.</summary>
  7746. </member>
  7747. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Unknown">
  7748. <summary>Used when the source option sent by the server was not recognized by the client.</summary>
  7749. </member>
  7750. <member name="T:Microsoft.Data.SqlClient.SqlNotificationType">
  7751. <summary>Describes the different notification types that can be received by an <see cref="T:Microsoft.Data.SqlClient.OnChangeEventHandler" /> event handler through the <see cref="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs" /> parameter.</summary><remarks>
  7752. <format type="text/markdown"><![CDATA[
  7753. ## Remarks
  7754. The <xref:Microsoft.Data.SqlClient.SqlNotificationType> enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class. This information is provided when a notification event is fired with the <xref:Microsoft.Data.SqlClient.SqlDependency> class.
  7755. ]]></format>
  7756. </remarks>
  7757. </member>
  7758. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Change">
  7759. <summary>Data on the server being monitored changed. Use the <see cref="T:Microsoft.Data.SqlClient.SqlNotificationInfo" /> item to determine the details of the change.</summary>
  7760. </member>
  7761. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Subscribe">
  7762. <summary>There was a failure to create a notification subscription. Use the <see cref="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs" /> object's <see cref="T:Microsoft.Data.SqlClient.SqlNotificationInfo" /> item to determine the cause of the failure.</summary>
  7763. </member>
  7764. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Unknown">
  7765. <summary>Used when the type option sent by the server was not recognized by the client.</summary>
  7766. </member>
  7767. <member name="T:Microsoft.Data.SqlClient.SqlParameter">
  7768. <summary>Represents a parameter to a <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> and optionally its mapping to <see cref="T:System.Data.DataSet" /> columns. This class cannot be inherited. For more information on parameters, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).</summary><remarks>
  7769. <format type="text/markdown"><![CDATA[
  7770. ## Remarks
  7771. Parameter names are not case sensitive.
  7772. > [!NOTE]
  7773. > Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
  7774. For more information, along with additional sample code demonstrating how to use parameters, see [Commands and Parameters](~/docs/framework/data/adonet/commands-and-parameters.md).
  7775. ## Examples
  7776. The following example creates multiple instances of <xref:Microsoft.Data.SqlClient.SqlParameter> through the <xref:Microsoft.Data.SqlClient.SqlParameterCollection> collection within the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>. These parameters are used to select data from the data source and put the data in the <xref:System.Data.DataSet>. This example assumes that a <xref:System.Data.DataSet> and a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> have already been created by using the appropriate schema, commands, and connection. For more information and additional examples on using parameters, see [Retrieving and Modifying Data in ADO.NET](~/docs/framework/data/adonet/retrieving-and-modifying-data.md) and [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  7777. [!code-csharp[SqlParameterCollection_Add6](~/../sqlclient/doc/samples/SqlParameterCollection_Add6.cs#1)]
  7778. ]]></format>
  7779. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  7780. </member>
  7781. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor">
  7782. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class.</summary><remarks>
  7783. <format type="text/markdown"><![CDATA[
  7784. ## Examples
  7785. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7786. [!code-csharp[SqlParameter_SqlParameter Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter.cs#1)]
  7787. ]]></format>
  7788. </remarks>
  7789. </member>
  7790. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType)">
  7791. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name and the data type.</summary><remarks>
  7792. <format type="text/markdown"><![CDATA[
  7793. ## Remarks
  7794. The data type and, if appropriate, **Size** and <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> are inferred from the value of the `dbType` parameter.
  7795. ## Examples
  7796. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7797. [!code-csharp[SqlParameter_SqlParameter2 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter2.cs#1)]
  7798. ]]></format>
  7799. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7800. </member>
  7801. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32)">
  7802. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The length of the parameter.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name, the <see cref="T:System.Data.SqlDbType" />, and the size.</summary><remarks>
  7803. <format type="text/markdown"><![CDATA[
  7804. ## Remarks
  7805. The **Size** is inferred from the value of the `dbType` parameter if it is not explicitly set in the `size` parameter.
  7806. ## Examples
  7807. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7808. [!code-csharp[SqlParameter_SqlParameter4 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter4.cs#1)]
  7809. ]]></format>
  7810. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7811. </member>
  7812. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32,System.Data.ParameterDirection,System.Boolean,System.Byte,System.Byte,System.String,System.Data.DataRowVersion,System.Object)">
  7813. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The length of the parameter.</param><param name="direction">One of the <see cref="T:System.Data.ParameterDirection" /> values.</param><param name="isNullable">
  7814. <see langword="true" /> if the value of the field can be null; otherwise, <see langword="false" />.</param><param name="precision">The total number of digits to the left and right of the decimal point to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="scale">The total number of decimal places to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><param name="sourceVersion">One of the <see cref="T:System.Data.DataRowVersion" /> values.</param><param name="value">An <see cref="T:System.Object" /> that is the value of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name, the type of the parameter, the size of the parameter, a <see cref="T:System.Data.ParameterDirection" />, the precision of the parameter, the scale of the parameter, the source column, a <see cref="T:System.Data.DataRowVersion" /> to use, and the value of the parameter.</summary><remarks>
  7815. <format type="text/markdown"><![CDATA[
  7816. ## Remarks
  7817. The **Size** and <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> are inferred from the value of the `dbType` parameter if they are not explicitly set in the `size` and `precision` parameters.
  7818. ## Examples
  7819. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7820. [!code-csharp[SqlParameter_SqlParameter1 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter1.cs#1)]
  7821. ]]></format>
  7822. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7823. </member>
  7824. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32,System.Data.ParameterDirection,System.Byte,System.Byte,System.String,System.Data.DataRowVersion,System.Boolean,System.Object,System.String,System.String,System.String)">
  7825. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The length of the parameter.</param><param name="direction">One of the <see cref="T:System.Data.ParameterDirection" /> values.</param><param name="precision">The total number of digits to the left and right of the decimal point to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="scale">The total number of decimal places to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><param name="sourceVersion">One of the <see cref="T:System.Data.DataRowVersion" /> values.</param><param name="sourceColumnNullMapping">
  7826. <see langword="true" /> if the source column is nullable; <see langword="false" /> if it is not.</param><param name="value">An <see cref="T:System.Object" /> that is the value of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</param><param name="xmlSchemaCollectionDatabase">The name of the database where the schema collection for this XML instance is located.</param><param name="xmlSchemaCollectionOwningSchema">The owning relational schema where the schema collection for this XML instance is located.</param><param name="xmlSchemaCollectionName">The name of the schema collection for this parameter.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name, the type of the parameter, the length of the parameter the direction, the precision, the scale, the name of the source column, one of the <see cref="T:System.Data.DataRowVersion" /> values, a Boolean for source column mapping, the value of the <see langword="SqlParameter" />, the name of the database where the schema collection for this XML instance is located, the owning relational schema where the schema collection for this XML instance is located, and the name of the schema collection for this parameter.</summary><remarks>
  7827. <format type="text/markdown"><![CDATA[
  7828. ## Remarks
  7829. The <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> are inferred from the value of the `dbType` parameter if they are not explicitly set in the `size` and `precision` parameters.
  7830. ]]></format>
  7831. </remarks>
  7832. </member>
  7833. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32,System.String)">
  7834. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The length of the parameter.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name, the <see cref="T:System.Data.SqlDbType" />, the size, and the source column name.</summary><remarks>
  7835. <format type="text/markdown"><![CDATA[
  7836. ## Remarks
  7837. The **Size** is inferred from the value of the `dbType` parameter if it is not explicitly set in the `size` parameter.
  7838. ## Examples
  7839. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7840. [!code-csharp[SqlParameter_SqlParameter5 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter5.cs#1)]
  7841. ]]></format>
  7842. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7843. </member>
  7844. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Object)">
  7845. <param name="parameterName">The name of the parameter to map.</param><param name="value">An <see cref="T:System.Object" /> that is the value of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name and a value of the new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  7846. <format type="text/markdown"><![CDATA[
  7847. ## Remarks
  7848. When you specify an <xref:System.Object> in the `value` parameter, the <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> is inferred from the Microsoft .NET Framework type of the <xref:System.Object>.
  7849. Use caution when you use this overload of the <xref:Microsoft.Data.SqlClient.SqlParameter> constructor to specify integer parameter values. Because this overload takes a `value` of type <xref:System.Object>, you must convert the integral value to an <xref:System.Object> type when the value is zero, as the following C# example demonstrates.
  7850. ```csharp
  7851. Parameter = new SqlParameter("@pname", (object)0);
  7852. ```
  7853. If you do not perform this conversion, the compiler assumes that you are trying to call the <xref:Microsoft.Data.SqlClient.SqlParameter.%23ctor(System.String,System.Data.SqlDbType)> constructor overload.
  7854. ## Examples
  7855. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7856. [!code-csharp[SqlParameter_SqlParameter6 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter6.cs#1)]
  7857. ]]></format>
  7858. </remarks>
  7859. </member>
  7860. <member name="P:Microsoft.Data.SqlClient.SqlParameter.CompareInfo">
  7861. <summary>Gets or sets the <see cref="T:System.Globalization.CompareInfo" /> object that defines how string comparisons should be performed for this parameter.</summary><value>A <see cref="T:System.Globalization.CompareInfo" /> object that defines string comparison for this parameter.</value><remarks>To be added.</remarks>
  7862. </member>
  7863. <member name="P:Microsoft.Data.SqlClient.SqlParameter.DbType">
  7864. <summary>Gets or sets the <see cref="T:System.Data.SqlDbType" /> of the parameter.</summary><value>One of the <see cref="T:System.Data.SqlDbType" /> values. The default is <see langword="NVarChar" />.</value><remarks>
  7865. <format type="text/markdown"><![CDATA[
  7866. ## Remarks
  7867. The <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> are linked. Therefore, setting the <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> changes the <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> to a supporting <xref:System.Data.SqlDbType>.
  7868. For a list of the supported data types, see the appropriate <xref:System.Data.SqlDbType> member. For more information, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md).
  7869. ## Examples
  7870. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7871. [!code-csharp[SqlParameter_IsNullable Example#1](~/../sqlclient/doc/samples/SqlParameter_IsNullable.cs#1)]
  7872. ]]></format>
  7873. </remarks>
  7874. </member>
  7875. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Direction">
  7876. <summary>Gets or sets a value that indicates whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter.</summary><value>One of the <see cref="T:System.Data.ParameterDirection" /> values. The default is <see langword="Input" />.</value><remarks>
  7877. <format type="text/markdown"><![CDATA[
  7878. ## Remarks
  7879. If the <xref:System.Data.ParameterDirection> is output, and execution of the associated <xref:Microsoft.Data.SqlClient.SqlCommand> does not return a value, the <xref:Microsoft.Data.SqlClient.SqlParameter> contains a null value.
  7880. `Output`, `InputOut`, and `ReturnValue` parameters returned by calling <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader%2A> cannot be accessed until you close the <xref:Microsoft.Data.SqlClient.SqlDataReader>.
  7881. ## Examples
  7882. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7883. [Commands and Parameters](~/docs/framework/data/adonet/commands-and-parameters.md)
  7884. [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md)
  7885. [SQL Server and ADO.NET](~/docs/framework/data/adonet/sql/index.md)
  7886. ]]></format>
  7887. </remarks><exception cref="T:System.ArgumentException">The property was not set to one of the valid <see cref="T:System.Data.ParameterDirection" /> values.</exception>
  7888. </member>
  7889. <member name="P:Microsoft.Data.SqlClient.SqlParameter.ForceColumnEncryption">
  7890. <summary>Enforces encryption of a parameter when using <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>. If SQL Server informs the driver that the parameter does not need to be encrypted, the query using the parameter will fail. This property provides additional protection against security attacks that involve a compromised SQL Server providing incorrect encryption metadata to the client, which may lead to data disclosure.</summary><value>
  7891. <see langword="true" /> if the parameter has a force column encryption; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  7892. </member>
  7893. <member name="P:Microsoft.Data.SqlClient.SqlParameter.IsNullable">
  7894. <summary>Gets or sets a value that indicates whether the parameter accepts null values. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.IsNullable" /> is not used to validate the parameter's value and will not prevent sending or receiving a null value when executing a command.</summary><value>
  7895. <see langword="true" /> if null values are accepted; otherwise, <see langword="false" />. The default is <see langword="false" />.</value><remarks>
  7896. <format type="text/markdown"><![CDATA[
  7897. ## Remarks
  7898. Null values are handled using the <xref:System.DBNull> class.
  7899. ## Examples
  7900. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7901. [!code-csharp[SqlParameter#2](~/../sqlclient/doc/samples/SqlParameter.cs#2)]
  7902. ]]></format>
  7903. </remarks>
  7904. </member>
  7905. <member name="P:Microsoft.Data.SqlClient.SqlParameter.LocaleId">
  7906. <summary>Gets or sets the locale identifier that determines conventions and language for a particular region.</summary><value>The locale identifier associated with the parameter.</value><remarks>
  7907. <format type="text/markdown"><![CDATA[
  7908. ## Remarks
  7909. The locale identifies conventions and language for a particular geographical region. The codepage used to encode a specific string (the character set) is based on the locale used by that string or the environment that produced it. This property sets (for input parameters) or gets (for output parameters) the locale to be attached to a string when exchanging data with the server. This property is typically used together with the <xref:Microsoft.Data.SqlClient.SqlParameter.CompareInfo%2A> property.
  7910. ```csharp
  7911. static void CreateSqlParameterLocaleId(){
  7912. SqlParameter parameter = new SqlParameter("pName", SqlDbType.VarChar);
  7913. parameter.LocaleId = 1033; // English - United States
  7914. }
  7915. ```
  7916. ]]></format>
  7917. </remarks>
  7918. </member>
  7919. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Offset">
  7920. <summary>Gets or sets the offset to the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> property.</summary><value>The offset to the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />. The default is 0.</value><remarks>
  7921. <format type="text/markdown"><![CDATA[
  7922. ## Remarks
  7923. The `Offset` property is used for client-side chunking of binary and string data. For example, in order to insert 10MB of text into a column on a server, a user might execute 10 parameterized inserts of 1MB chunks, shifting the value of `Offset` on each iteration by 1MB.
  7924. `Offset` specifies the number of bytes for binary types, and the number of characters for strings. The count for strings does not include the terminating character.
  7925. ## Examples
  7926. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7927. [!code-csharp[SqlParameter#3](~/../sqlclient/doc/samples/SqlParameter.cs#3)]
  7928. ]]></format>
  7929. </remarks>
  7930. </member>
  7931. <member name="P:Microsoft.Data.SqlClient.SqlParameter.ParameterName">
  7932. <summary>Gets or sets the name of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><value>The name of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />. The default is an empty string.</value><remarks>
  7933. <format type="text/markdown"><![CDATA[
  7934. ## Remarks
  7935. The <xref:Microsoft.Data.SqlClient.SqlParameter.ParameterName%2A> is specified in the form @paramname. You must set <xref:Microsoft.Data.SqlClient.SqlParameter.ParameterName%2A> before executing a <xref:Microsoft.Data.SqlClient.SqlCommand> that relies on parameters.
  7936. ## Examples
  7937. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7938. [!code-csharp[SqlParameter_ParameterName Example#1](~/../sqlclient/doc/samples/SqlParameter_ParameterName.cs#1)]
  7939. ]]></format>
  7940. </remarks>
  7941. </member>
  7942. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Precision">
  7943. <summary>Gets or sets the maximum number of digits used to represent the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> property.</summary><value>The maximum number of digits used to represent the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> property. The default value is 0. This indicates that the data provider sets the precision for <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />.</value><remarks>
  7944. <format type="text/markdown"><![CDATA[
  7945. ## Remarks
  7946. The <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
  7947. You do not need to specify values for the <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> properties for input parameters, as they can be inferred from the parameter value. `Precision` and `Scale` are required for output parameters and for scenarios where you need to specify complete metadata for a parameter without indicating a value, such as specifying a null value with a specific precision and scale.
  7948. > [!NOTE]
  7949. > Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the <xref:System.Math> class that is part of the `System` namespace prior to assigning a value to the parameter's `Value` property.
  7950. > [!NOTE]
  7951. > Microsoft .NET Framework data providers that are included with the .NET Framework version 1.0 do not verify the <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> or <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> of <xref:System.Decimal> parameter values. This can cause truncated data being inserted at the data source. If you are using .NET Framework version 1.0, validate the <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> of <xref:System.Decimal> values before setting the parameter value. When you use .NET Framework version 1.1 or a later version, an exception is thrown if a <xref:System.Decimal> parameter value is set with an invalid <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A>. <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> values that exceed the <xref:System.Decimal> parameter scale are still truncated.
  7952. ## Examples
  7953. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7954. [!code-csharp[SqlParameter_Precision Example#1](~/../sqlclient/doc/samples/SqlParameter_Precision.cs#1)]
  7955. ]]></format>
  7956. </remarks>
  7957. </member>
  7958. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Scale">
  7959. <summary>Gets or sets the number of decimal places to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</summary><value>The number of decimal places to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved. The default is 0.</value><remarks>
  7960. <format type="text/markdown"><![CDATA[
  7961. ## Remarks
  7962. The <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
  7963. > [!WARNING]
  7964. > Data may be truncated if the <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> property is not explicitly specified and the data on the server does not fit in scale 0 (the default).
  7965. You do not need to specify values for the <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> properties for input parameters, as they can be inferred from the parameter value. `Precision` and `Scale` are required for output parameters and for scenarios where you need to specify complete metadata for a parameter without indicating a value, such as specifying a null value with a specific precision and scale.
  7966. > [!NOTE]
  7967. > Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the <xref:System.Math> class that is part of the `System` namespace prior to assigning a value to the parameter's `Value` property.
  7968. > [!NOTE]
  7969. > .NET Framework data providers that are included with the .NET Framework version 1.0 do not verify the <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> or <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> of <xref:System.Decimal> parameter values. This can cause truncated data to be inserted at the data source. If you are using .NET Framework version 1.0, validate the <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter> of <xref:System.Decimal> values before setting the parameter value. <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> values that exceed the <xref:System.Decimal> parameter scale are still truncated.
  7970. ## Examples
  7971. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7972. [!code-csharp[SqlParameter#4](~/../sqlclient/doc/samples/SqlParameter.cs#4)]
  7973. ]]></format>
  7974. </remarks>
  7975. </member>
  7976. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Size">
  7977. <summary>Gets or sets the maximum size, in bytes, of the data within the column.</summary><value>The maximum size, in bytes, of the data within the column. The default value is inferred from the parameter value.</value><remarks>
  7978. <format type="text/markdown"><![CDATA[
  7979. ## Remarks
  7980. Return values are not affected by this property; return parameters from stored procedures are always fixed-size integers.
  7981. For output parameters with a variable length type (nvarchar, for example), the size of the parameter defines the size of the buffer holding the output parameter. The output parameter can be truncated to a size specified with <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A>. For character types, the size specified with <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> is in characters.
  7982. The <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> property is used for binary and string types. For parameters of type `SqlType.String`, `Size` means length in Unicode characters. For parameters of type `SqlType.Xml`, `Size` is ignored.
  7983. For nonstring data types and ANSI string data, the <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> property refers to the number of bytes. For Unicode string data, <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> refers to the number of characters. The count for strings does not include the terminating character.
  7984. For variable-length data types, <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> describes the maximum amount of data to transmit to the server. For example, for a Unicode string value, <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> could be used to limit the amount of data sent to the server to the first one hundred characters.
  7985. If not explicitly set, the size is inferred from the actual size of the specified parameter value.
  7986. If the fractional part of the parameter value is greater than the size, then the value will be truncated to match the size.
  7987. For fixed length data types, the value of <xref:Microsoft.Data.SqlClient.SqlParameter.Size%2A> is ignored. It can be retrieved for informational purposes, and returns the maximum amount of bytes the provider uses when transmitting the value of the parameter to the server.
  7988. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  7989. ## Examples
  7990. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7991. [!code-csharp[SqlParameter#5](~/../sqlclient/doc/samples/SqlParameter.cs#5)]
  7992. ]]></format>
  7993. </remarks>
  7994. </member>
  7995. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn">
  7996. <summary>Gets or sets the name of the source column mapped to the <see cref="T:System.Data.DataSet" /> and used for loading or returning the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /></summary><value>The name of the source column mapped to the <see cref="T:System.Data.DataSet" />. The default is an empty string.</value><remarks>
  7997. <format type="text/markdown"><![CDATA[
  7998. ## Remarks
  7999. When <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumn%2A> is set to anything other than an empty string, the value of the parameter is retrieved from the column with the <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumn%2A> name. If <xref:Microsoft.Data.SqlClient.SqlParameter.Direction%2A> is set to `Input`, the value is taken from the <xref:System.Data.DataSet>. If <xref:Microsoft.Data.SqlClient.SqlParameter.Direction%2A> is set to `Output`, the value is taken from the data source. A <xref:Microsoft.Data.SqlClient.SqlParameter.Direction%2A> of `InputOutput` is a combination of both.
  8000. For more information about how to use the <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumn%2A> property, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md) and [Updating Data Sources with DataAdapters](~/docs/framework/data/adonet/updating-data-sources-with-dataadapters.md).
  8001. ## Examples
  8002. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8003. [!code-csharp[SqlParameter#6](~/../sqlclient/doc/samples/SqlParameter.cs#6)]
  8004. ]]></format>
  8005. </remarks>
  8006. </member>
  8007. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping">
  8008. <summary>Sets or gets a value which indicates whether the source column is nullable. This allows <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" /> to correctly generate Update statements for nullable columns.</summary><value>
  8009. <see langword="true" /> if the source column is nullable; <see langword="false" /> if it is not.</value><remarks>
  8010. <format type="text/markdown"><![CDATA[
  8011. ## Remarks
  8012. <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping%2A> is used by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> to correctly generate update commands when dealing with nullable columns. Generally, use of <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping%2A> is limited to developers inheriting from <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>.
  8013. <xref:System.Data.Common.DbCommandBuilder> uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> is generating its Update statement, it examines the <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping%2A> for each parameter. If the property is `true`, <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field):
  8014. ```
  8015. ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR
  8016. (FieldName = @Original_FieldName))
  8017. ```
  8018. If <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping%2A> for the field is false, <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> generates the following WHERE clause:
  8019. ```
  8020. FieldName = @OriginalFieldName
  8021. ```
  8022. In addition, @IsNull_FieldName contains 1 if the source field contains null, and 0 if it does not. This mechanism allows for a performance optimization in SQL Server, and provides for common code that works across multiple providers.
  8023. ]]></format>
  8024. </remarks>
  8025. </member>
  8026. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceVersion">
  8027. <summary>Gets or sets the <see cref="T:System.Data.DataRowVersion" /> to use when you load <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /></summary><value>One of the <see cref="T:System.Data.DataRowVersion" /> values. The default is <see langword="Current" />.</value><remarks>
  8028. <format type="text/markdown"><![CDATA[
  8029. ## Remarks
  8030. This property is used by the `SqlDataAdapter.UpdateCommand` during an update to determine whether the original or current value is used for a parameter value. This lets primary keys be updated. This property is set to the version of the <xref:System.Data.DataRow> used by the `DataRow.Item` property, or one of the `DataRow.GetChildRows` methods of the <xref:System.Data.DataRow> object.
  8031. ## Examples
  8032. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8033. [!code-csharp[SqlParameter#7](~/../sqlclient/doc/samples/SqlParameter.cs#7)]
  8034. ]]></format>
  8035. </remarks>
  8036. </member>
  8037. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType">
  8038. <summary>Gets or sets the <see cref="T:System.Data.SqlDbType" /> of the parameter.</summary><value>One of the <see cref="T:System.Data.SqlDbType" /> values. The default is <see langword="NVarChar" />.</value><remarks>
  8039. <format type="text/markdown"><![CDATA[
  8040. ## Remarks
  8041. The <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> are linked. Therefore, setting the <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> changes the <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> to a supporting <xref:System.Data.SqlDbType>.
  8042. For a list of the supported data types, see the appropriate <xref:System.Data.SqlDbType> member. For more information, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md).
  8043. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  8044. ]]></format>
  8045. </remarks>
  8046. </member>
  8047. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SqlValue">
  8048. <summary>Gets or sets the value of the parameter as an SQL type.</summary><value>An <see cref="T:System.Object" /> that is the value of the parameter, using SQL types. The default value is null.</value><remarks>
  8049. <format type="text/markdown"><![CDATA[
  8050. ## Remarks
  8051. For input parameters, the value is bound to the <xref:Microsoft.Data.SqlClient.SqlCommand> that is sent to the server. For output and return value parameters, the value is set on completion of the <xref:Microsoft.Data.SqlClient.SqlCommand> and after the <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed.
  8052. This property can be set to null or <xref:System.DBNull.Value?displayProperty=nameWithType>. Use <xref:System.DBNull.Value?displayProperty=nameWithType> to send a NULL value as the value of the parameter. Use null or do not set <xref:Microsoft.Data.SqlClient.SqlParameter.SqlValue%2A?displayProperty=nameWithType> to use the default value for the parameter.
  8053. If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. The provider tries to convert any type of value if it supports the <xref:System.IConvertible> interface. Conversion errors may result if the specified type is not compatible with the value.
  8054. Both the <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> properties can be inferred by setting the <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType>.
  8055. The <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType> property is overwritten by `SqlDataAdapter.UpdateCommand`.
  8056. Use the <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType> property to return parameter values as common language runtime (CLR) types.
  8057. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  8058. ]]></format>
  8059. </remarks>
  8060. </member>
  8061. <member name="P:Microsoft.Data.SqlClient.SqlParameter.TypeName">
  8062. <summary>Gets or sets the type name for a table-valued parameter.</summary><value>The type name of the specified table-valued parameter.</value><remarks>To be added.</remarks>
  8063. </member>
  8064. <member name="P:Microsoft.Data.SqlClient.SqlParameter.UdtTypeName">
  8065. <summary>Gets or sets a <see langword="string" /> that represents a user-defined type as a parameter.</summary><value>A <see langword="string" /> that represents the fully qualified name of a user-defined type in the database.</value><remarks>
  8066. <format type="text/markdown"><![CDATA[
  8067. ## Remarks
  8068. For a sample demonstrating <xref:Microsoft.Data.SqlClient.SqlParameter.UdtTypeName%2A>, see [Retrieving UDT Data](https://msdn.microsoft.com/library/ms131080.aspx).
  8069. ]]></format>
  8070. </remarks>
  8071. </member>
  8072. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Value">
  8073. <summary>Gets or sets the value of the parameter.</summary><value>An <see cref="T:System.Object" /> that is the value of the parameter. The default value is null.</value><remarks>
  8074. <format type="text/markdown"><![CDATA[
  8075. ## Remarks
  8076. For input parameters, the value is bound to the <xref:Microsoft.Data.SqlClient.SqlCommand> that is sent to the server. For output and return value parameters, the value is set on completion of the <xref:Microsoft.Data.SqlClient.SqlCommand> and after the <xref:Microsoft.Data.SqlClient.SqlDataReader> is closed.
  8077. This property can be set to `null` or <xref:System.DBNull.Value?displayProperty=nameWithType>. Use <xref:System.DBNull.Value?displayProperty=nameWithType> to send a NULL value as the value of the parameter. Use `null` or do not set <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A> to use the default value for the parameter.
  8078. An exception is thrown if non-Unicode XML data is passed as a string.
  8079. If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. The provider tries to convert any type of value if it supports the <xref:System.IConvertible> interface. Conversion errors may result if the specified type is not compatible with the value.
  8080. Both the <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> properties can be inferred by setting the Value.
  8081. The <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A> property is overwritten by `SqlDataAdapter.UpdateCommand`.
  8082. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  8083. ## Examples
  8084. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8085. [!code-csharp[SqlParameter#8](~/../sqlclient/doc/samples/SqlParameter.cs#8)]
  8086. ]]></format>
  8087. </remarks>
  8088. </member>
  8089. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionDatabase">
  8090. <summary>Gets the name of the database where the schema collection for this XML instance is located.</summary><value>The name of the database where the schema collection for this XML instance is located.</value><remarks>
  8091. <format type="text/markdown"><![CDATA[
  8092. ## Remarks
  8093. This value is null (`Nothing` in Microsoft Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case <xref:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionName%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionOwningSchema%2A> are also null.
  8094. ]]></format>
  8095. </remarks>
  8096. </member>
  8097. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionName">
  8098. <summary>Gets the name of the schema collection for this XML instance.</summary><value>The name of the schema collection for this XML instance.</value><remarks>
  8099. <format type="text/markdown"><![CDATA[
  8100. ## Remarks
  8101. This value is null (`Nothing` in Microsoft Visual Basic) if there is no associated schema collection. If the value is null, then <xref:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionDatabase%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionOwningSchema%2A> are also null.
  8102. ]]></format>
  8103. </remarks>
  8104. </member>
  8105. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionOwningSchema">
  8106. <summary>The owning relational schema where the schema collection for this XML instance is located.</summary><value>The owning relational schema for this XML instance.</value><remarks>
  8107. <format type="text/markdown"><![CDATA[
  8108. ## Remarks
  8109. This value is null (`Nothing` in Microsoft Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case <xref:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionDatabase%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionName%2A> are also null.
  8110. ]]></format>
  8111. </remarks>
  8112. </member>
  8113. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ResetDbType">
  8114. <summary>Resets the type associated with this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  8115. <format type="text/markdown"><![CDATA[
  8116. ## Remarks
  8117. When executing a command that includes parameter values, code can either set the type of a parameter explicitly, or the parameter can infer its type from its value. Calling this method resets the parameter so that it can again infer its type from the value passed in the parameter. Calling this method affects both the <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> properties of the <xref:Microsoft.Data.SqlClient.SqlParameter>.
  8118. ]]></format>
  8119. </remarks>
  8120. </member>
  8121. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ResetSqlDbType">
  8122. <summary>Resets the type associated with this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  8123. <format type="text/markdown"><![CDATA[
  8124. ## Remarks
  8125. When executing a command that includes parameter values, code can either set the type of a parameter explicitly, or the parameter can infer its type from its value. Calling this method resets the parameter so that it can again infer its type from the value passed in the parameter. Calling this method affects both the <xref:Microsoft.Data.SqlClient.SqlParameter.DbType%2A> and <xref:Microsoft.Data.SqlClient.SqlParameter.SqlDbType%2A> properties of the <xref:Microsoft.Data.SqlClient.SqlParameter>.
  8126. ]]></format>
  8127. </remarks>
  8128. </member>
  8129. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ToString">
  8130. <summary>Gets a string that contains the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.ParameterName" />.</summary><returns>A string that contains the <see cref="P:Microsoft.Data.SqlClient.SqlParameter.ParameterName" />.</returns><remarks>To be added.</remarks>
  8131. </member>
  8132. <member name="T:Microsoft.Data.SqlClient.SqlParameterCollection">
  8133. <summary>Represents a collection of parameters associated with a <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> and their respective mappings to columns in a <see cref="T:System.Data.DataSet" />. This class cannot be inherited.</summary><remarks>
  8134. <format type="text/markdown"><![CDATA[
  8135. ## Remarks
  8136. If the command contains an ad hoc SQL statement, as opposed to a stored-procedure name, the number of the parameters in the collection must be equal to the number of parameter placeholders within the command text, or SQL Server raises an error. With a stored procedure, all the parameters declared in the stored procedure without a default value must be provided. Parameters declared with a default value are optional. This lets you specify a value other than the default.
  8137. For more information with additional sample code demonstrating how to use parameters, see [Commands and Parameters](~/docs/framework/data/adonet/commands-and-parameters.md).
  8138. ## Examples
  8139. The following example creates multiple instances of <xref:Microsoft.Data.SqlClient.SqlParameter> through the <xref:Microsoft.Data.SqlClient.SqlParameterCollection> collection. The parameters are used to select data within the data source and populate the <xref:System.Data.DataSet>. This code assumes that a <xref:System.Data.DataSet> and a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> have already been created with the appropriate schema, commands, and connection.
  8140. [!code-csharp[SqlParameterCollection_Add6 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add6.cs#1)]
  8141. ]]></format>
  8142. </remarks>
  8143. </member>
  8144. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Count">
  8145. <summary>Returns an Integer that contains the number of elements in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />. Read-only.</summary><value>The number of elements in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> as an Integer.</value><remarks>To be added.</remarks>
  8146. </member>
  8147. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsFixedSize">
  8148. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> has a fixed size.</summary><value>
  8149. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> has a fixed size; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  8150. </member>
  8151. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsReadOnly">
  8152. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is read-only.</summary><value>
  8153. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is read-only; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  8154. </member>
  8155. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsSynchronized">
  8156. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is synchronized.</summary><value>
  8157. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is synchronized; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  8158. </member>
  8159. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Item(System.Int32)">
  8160. <param name="index">The zero-based index of the parameter to retrieve.</param><summary>Gets the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> at the specified index.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> at the specified index.</value><remarks>
  8161. <format type="text/markdown"><![CDATA[
  8162. ## Examples
  8163. The following example demonstrates creating <xref:Microsoft.Data.SqlClient.SqlParameter> objects to supply an input parameter to a stored procedure that returns results in an output parameter. The code iterates through the items in the <xref:Microsoft.Data.SqlClient.SqlParameterCollection> and displays some parameter properties in the console window. This example assumes a valid connection string to the **AdventureWorks** sample database on an instance of SQL Server.
  8164. [!code-csharp[SqlParameterCollection_Count Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Count.cs#1)]
  8165. ]]></format>
  8166. </remarks><exception cref="T:System.IndexOutOfRangeException">The specified index does not exist.</exception>
  8167. </member>
  8168. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Item(System.String)">
  8169. <param name="parameterName">The name of the parameter to retrieve.</param><summary>Gets the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> with the specified name.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> with the specified name.</value><remarks>
  8170. <format type="text/markdown"><![CDATA[
  8171. ## Remarks
  8172. The `parameterName` is used to look up the index value in the underlying <xref:Microsoft.Data.SqlClient.SqlParameterCollection>. If the `parameterName` is not valid, an <xref:System.IndexOutOfRangeException> will be thrown.
  8173. ]]></format>
  8174. </remarks><exception cref="T:System.IndexOutOfRangeException">The specified <paramref name="parameterName" /> is not valid.</exception>
  8175. </member>
  8176. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.SyncRoot">
  8177. <summary>Gets an object that can be used to synchronize access to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><value>An object that can be used to synchronize access to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</value><remarks>To be added.</remarks>
  8178. </member>
  8179. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(Microsoft.Data.SqlClient.SqlParameter)">
  8180. <param name="value">The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to add to the collection.</param><summary>Adds the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>A new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>
  8181. <format type="text/markdown"><![CDATA[
  8182. ## Examples
  8183. [!code-csharp[SqlParameterCollection_Add Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add.cs#1)]
  8184. ]]></format>
  8185. </remarks><exception cref="T:System.ArgumentException">The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> specified in the <paramref name="value" /> parameter is already added to this or another <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</exception><exception cref="T:System.InvalidCastException">The parameter passed was not a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</exception><exception cref="T:System.ArgumentNullException">The <paramref name="value" /> parameter is null.</exception>
  8186. </member>
  8187. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.Object)">
  8188. <param name="value">An <see cref="T:System.Object" />.</param><summary>Adds the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>The index of the new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>To be added.</remarks>
  8189. </member>
  8190. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType)">
  8191. <param name="parameterName">The name of the parameter.</param><param name="sqlDbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><summary>Adds a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> given the parameter name and the data type.</summary><returns>A new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>
  8192. <format type="text/markdown"><![CDATA[
  8193. ## Examples
  8194. [!code-csharp[SqlParameterCollection_Add3 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add3.cs#1)]
  8195. ]]></format>
  8196. </remarks>
  8197. </member>
  8198. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType,System.Int32)">
  8199. <param name="parameterName">The name of the parameter.</param><param name="sqlDbType">The <see cref="T:System.Data.SqlDbType" /> of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to add to the collection.</param><param name="size">The size as an <see cref="T:System.Int32" />.</param><summary>Adds a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />, given the specified parameter name, <see cref="T:System.Data.SqlDbType" /> and size.</summary><returns>A new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>
  8200. <format type="text/markdown"><![CDATA[
  8201. ## Remarks
  8202. This overload is useful when you are adding a parameter of a variable-length data type such as `varchar` or `binary`.
  8203. ## Examples
  8204. [!code-csharp[SqlParameterCollection_Add1 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add1.cs#1)]
  8205. ]]></format>
  8206. </remarks>
  8207. </member>
  8208. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType,System.Int32,System.String)">
  8209. <param name="parameterName">The name of the parameter.</param><param name="sqlDbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The column length.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><summary>Adds a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> with the parameter name, the data type, and the column length.</summary><returns>A new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>
  8210. <format type="text/markdown"><![CDATA[
  8211. ## Examples
  8212. [!code-csharp[SqlParameterCollection_Add5 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add5.cs#1)]
  8213. ]]></format>
  8214. </remarks>
  8215. </member>
  8216. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Object)">
  8217. <param name="parameterName">The name of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to add to the collection.</param><param name="value">A <see cref="T:System.Object" />.</param><summary>Adds the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>A new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  8218. Use caution when you are using this overload of the <see langword="SqlParameterCollection.Add" /> method to specify integer parameter values. Because this overload takes a <paramref name="value" /> of type <see cref="T:System.Object" />, you must convert the integral value to an <see cref="T:System.Object" /> type when the value is zero, as the following C# example demonstrates.
  8219. ```
  8220. parameters.Add("@pname", Convert.ToInt32(0));
  8221. ```
  8222. If you do not perform this conversion, the compiler assumes that you are trying to call the <see langword="SqlParameterCollection.Add" /> (<see langword="string" />, <see langword="SqlDbType" />) overload.</returns><remarks>
  8223. <format type="text/markdown"><![CDATA[
  8224. ## Examples
  8225. [!code-csharp[SqlParameterCollection_Add1 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add1.cs#1)]
  8226. ]]></format>
  8227. </remarks><exception cref="T:System.ArgumentException">The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> specified in the <paramref name="value" /> parameter is already added to this or another <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</exception><exception cref="T:System.ArgumentNullException">The <paramref name="value" /> parameter is null.</exception>
  8228. </member>
  8229. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddRange(Microsoft.Data.SqlClient.SqlParameter[])">
  8230. <param name="values">The <see cref="T:System.Array" /> values to add.</param><summary>Adds an array of values to the end of the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><remarks>To be added.</remarks>
  8231. </member>
  8232. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddRange(System.Array)">
  8233. <param name="values">The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> values to add.</param><summary>Adds an array of <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> values to the end of the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><remarks>To be added.</remarks>
  8234. </member>
  8235. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddWithValue(System.String,System.Object)">
  8236. <param name="parameterName">The name of the parameter.</param><param name="value">The value to be added. Use <see cref="F:System.DBNull.Value" /> instead of null, to indicate a null value.</param><summary>Adds a value to the end of the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>
  8237. <format type="text/markdown"><![CDATA[
  8238. ## Remarks
  8239. <xref:Microsoft.Data.SqlClient.SqlParameterCollection.AddWithValue%2A> replaces the `SqlParameterCollection.Add` method that takes a <xref:System.String> and an <xref:System.Object>. The overload of `Add` that takes a string and an object was deprecated because of possible ambiguity with the `SqlParameterCollection.Add` overload that takes a <xref:System.String> and a <xref:System.Data.SqlDbType> enumeration value where passing an integer with the string could be interpreted as being either the parameter value or the corresponding <xref:System.Data.SqlDbType> value. Use <xref:Microsoft.Data.SqlClient.SqlParameterCollection.AddWithValue%2A> whenever you want to add a parameter by specifying its name and value.
  8240. For <xref:System.Data.SqlDbType>`Xml` enumeration values, you can use a string, an XML value, an <xref:System.Xml.XmlReader> derived type instance, or a <xref:System.Data.SqlTypes.SqlXml> object.
  8241. ## Examples
  8242. The following example demonstrates how to use the `AddWithValue` method.
  8243. [!code-csharp[SqlParameterCollection_AddWithValue#1](~/../sqlclient/doc/samples/SqlParameterCollection_AddWithValue.cs#1)]
  8244. ]]></format>
  8245. </remarks>
  8246. </member>
  8247. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Clear">
  8248. <summary>Removes all the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> objects from the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><remarks>To be added.</remarks>
  8249. </member>
  8250. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(Microsoft.Data.SqlClient.SqlParameter)">
  8251. <param name="value">The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> value.</param><summary>Determines whether the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is in this <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>
  8252. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> contains the value; otherwise, <see langword="false" />.</returns><remarks>To be added.</remarks>
  8253. </member>
  8254. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(System.Object)">
  8255. <param name="value">The <see cref="T:System.Object" /> value.</param><summary>Determines whether the specified <see cref="T:System.Object" /> is in this <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>
  8256. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> contains the value; otherwise, <see langword="false" />.</returns><remarks>To be added.</remarks>
  8257. </member>
  8258. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(System.String)">
  8259. <param name="value">The <see cref="T:System.String" /> value.</param><summary>Determines whether the specified parameter name is in this <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>
  8260. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> contains the value; otherwise, <see langword="false" />.</returns><remarks>To be added.</remarks>
  8261. </member>
  8262. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.CopyTo(System.Array,System.Int32)">
  8263. <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from the current <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</param><param name="index">A 32-bit integer that represents the index in the <see cref="T:System.Array" /> at which copying starts.</param><summary>Copies all the elements of the current <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> to the specified one-dimensional <see cref="T:System.Array" /> starting at the specified destination <see cref="T:System.Array" /> index.</summary><remarks>To be added.</remarks>
  8264. </member>
  8265. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.CopyTo(Microsoft.Data.SqlClient.SqlParameter[],System.Int32)">
  8266. <param name="array">The <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> that is the destination of the elements copied from the current <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</param><param name="index">A 32-bit integer that represents the index in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> at which copying starts.</param><summary>Copies all the elements of the current <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> to the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> starting at the specified destination index.</summary><remarks>To be added.</remarks>
  8267. </member>
  8268. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetEnumerator">
  8269. <summary>Returns an enumerator that iterates through the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</summary><returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</returns><remarks>To be added.</remarks>
  8270. </member>
  8271. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetParameter(System.Int32)">
  8272. <param name="index">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  8273. </member>
  8274. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetParameter(System.String)">
  8275. <param name="parameterName">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  8276. </member>
  8277. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(Microsoft.Data.SqlClient.SqlParameter)">
  8278. <param name="value">The <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to find.</param><summary>Gets the location of the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> within the collection.</summary><returns>The zero-based location of the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> that is a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> within the collection. Returns -1 when the object does not exist in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</returns><remarks>To be added.</remarks>
  8279. </member>
  8280. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(System.Object)">
  8281. <param name="value">The <see cref="T:System.Object" /> to find.</param><summary>Gets the location of the specified <see cref="T:System.Object" /> within the collection.</summary><returns>The zero-based location of the specified <see cref="T:System.Object" /> that is a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> within the collection. Returns -1 when the object does not exist in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</returns><remarks>To be added.</remarks>
  8282. </member>
  8283. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(System.String)">
  8284. <param name="parameterName">The case-sensitive name of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to find.</param><summary>Gets the location of the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> with the specified name.</summary><returns>The zero-based location of the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> with the specified case-sensitive name. Returns -1 when the object does not exist in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</returns><remarks>To be added.</remarks>
  8285. </member>
  8286. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlParameter)">
  8287. <param name="index">The zero-based index at which value should be inserted.</param><param name="value">A <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object to be inserted in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</param><summary>Inserts a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object into the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> at the specified index.</summary><remarks>To be added.</remarks>
  8288. </member>
  8289. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Insert(System.Int32,System.Object)">
  8290. <param name="index">The zero-based index at which value should be inserted.</param><param name="value">An <see cref="T:System.Object" /> to be inserted in the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />.</param><summary>Inserts an <see cref="T:System.Object" /> into the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> at the specified index.</summary><remarks>To be added.</remarks>
  8291. </member>
  8292. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Remove(Microsoft.Data.SqlClient.SqlParameter)">
  8293. <param name="value">A <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object to remove from the collection.</param><summary>Removes the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> from the collection.</summary><remarks>
  8294. <format type="text/markdown"><![CDATA[
  8295. ## Examples
  8296. The following example searches for a <xref:Microsoft.Data.SqlClient.SqlParameter> object in a <xref:Microsoft.Data.SqlClient.SqlParameterCollection> collection. If the parameter exists, the example removes it. This example assumes that a <xref:Microsoft.Data.SqlClient.SqlParameterCollection> collection has already been created by a <xref:Microsoft.Data.SqlClient.SqlCommand>.
  8297. [!code-csharp[SqlParameterCollection_Remove Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Remove.cs#1)]
  8298. ]]></format>
  8299. </remarks><exception cref="T:System.InvalidCastException">The parameter is not a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</exception><exception cref="T:System.SystemException">The parameter does not exist in the collection.</exception>
  8300. </member>
  8301. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Remove(System.Object)">
  8302. <param name="value">The object to remove from the collection.</param><summary>Removes the specified <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> from the collection.</summary><remarks>To be added.</remarks>
  8303. </member>
  8304. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.RemoveAt(System.Int32)">
  8305. <param name="index">The zero-based index of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object to remove.</param><summary>Removes the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> from the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> at the specified index.</summary><remarks>To be added.</remarks>
  8306. </member>
  8307. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.RemoveAt(System.String)">
  8308. <param name="parameterName">The name of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to remove.</param><summary>Removes the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> from the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> at the specified parameter name.</summary><remarks>To be added.</remarks>
  8309. </member>
  8310. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.SetParameter(System.Int32,System.Data.Common.DbParameter)">
  8311. <param name="index">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  8312. </member>
  8313. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.SetParameter(System.String,System.Data.Common.DbParameter)">
  8314. <param name="parameterName">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  8315. </member>
  8316. <member name="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs">
  8317. <summary>Represents the set of arguments passed to the <see cref="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventHandler" />.</summary><remarks>To be added.</remarks>
  8318. </member>
  8319. <member name="M:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.#ctor(System.Int64)">
  8320. <param name="rowsCopied">An <see cref="T:System.Int64" /> that indicates the number of rows copied during the current bulk copy operation.</param><summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs" /> object.</summary><remarks>
  8321. <format type="text/markdown"><![CDATA[
  8322. ## Remarks
  8323. The value in the `rowsCopied` parameter is reset on each call to any one of the `SqlBulkCopy.WriteToServer` methods.
  8324. ]]></format>
  8325. </remarks>
  8326. </member>
  8327. <member name="P:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort">
  8328. <summary>Gets or sets a value that indicates whether the bulk copy operation should be aborted.</summary><value>
  8329. <see langword="true" /> if the bulk copy operation should be aborted; otherwise <see langword="false" />.</value><remarks>
  8330. <format type="text/markdown"><![CDATA[
  8331. ## Remarks
  8332. Use the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort%2A> property to cancel a bulk copy operation. Set <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort%2A> to `true` to abort the bulk copy operation.
  8333. If you call the **Close** method from <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied>, an exception is generated, and the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object state does not change.
  8334. If an application specifically creates a <xref:Microsoft.Data.SqlClient.SqlTransaction> object in the <xref:Microsoft.Data.SqlClient.SqlCommand> constructor, the transaction is not rolled back. The application is responsible for determining whether it is required to rollback the operation, and if so, it must call the <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A?displayProperty=nameWithType> method. If the application does not create a transaction, the internal transaction corresponding to the current batch is automatically rolled back. However, changes related to previous batches within the bulk copy operation are retained, because the transactions for them already have been committed.
  8335. ]]></format>
  8336. </remarks>
  8337. </member>
  8338. <member name="P:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.RowsCopied">
  8339. <summary>Gets a value that returns the number of rows copied during the current bulk copy operation.</summary><value>
  8340. <see langword="int" /> that returns the number of rows copied.</value><remarks>
  8341. <format type="text/markdown"><![CDATA[
  8342. ## Remarks
  8343. The value in the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.RowsCopied%2A> property is reset on each call to any of the `SqlBulkCopy.WriteToServer` methods.
  8344. ]]></format>
  8345. </remarks>
  8346. </member>
  8347. <member name="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventHandler">
  8348. <param name="sender">The source of the event.</param><param name="e">A <see cref="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs" /> object that contains the event data.</param><summary>Represents the method that handles the <see cref="E:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied" /> event of a <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />.</summary><remarks>To be added.</remarks>
  8349. </member>
  8350. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs">
  8351. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated" /> event.</summary><remarks>
  8352. <format type="text/markdown"><![CDATA[
  8353. ## Remarks
  8354. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event is raised when an <xref:System.Data.Common.DbDataAdapter.Update%2A> to a row is completed.
  8355. When using <xref:System.Data.Common.DbDataAdapter.Update%2A>, there are two events that occur for each data row updated. The order of execution is as follows:
  8356. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  8357. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  8358. 3. The command executes.
  8359. 4. If the command is set to `FirstReturnedRecord`, and the first returned result is placed in the <xref:System.Data.DataRow>.
  8360. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  8361. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  8362. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  8363. ## Examples
  8364. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  8365. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  8366. Event Arguments: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  8367. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  8368. Event Arguments: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  8369. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  8370. ]]></format>
  8371. </remarks>
  8372. </member>
  8373. <member name="M:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs.#ctor(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  8374. <param name="row">The <see cref="T:System.Data.DataRow" /> sent through an <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</param><param name="command">The <see cref="T:System.Data.IDbCommand" /> executed when <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> is called.</param><param name="statementType">One of the <see cref="T:System.Data.StatementType" /> values that specifies the type of query executed.</param><param name="tableMapping">The <see cref="T:System.Data.Common.DataTableMapping" /> sent through an <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs" /> class.</summary><remarks>To be added.</remarks>
  8375. </member>
  8376. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs.Command">
  8377. <summary>Gets or sets the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> executed when <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> is called.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> executed when <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" /> is called.</value><remarks>To be added.</remarks>
  8378. </member>
  8379. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventHandler">
  8380. <param name="sender">The source of the event.</param><param name="e">The <see cref="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs" /> that contains the event data.</param><summary>Represents the method that will handle the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated" /> event of a <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />.</summary><remarks>
  8381. <format type="text/markdown"><![CDATA[
  8382. ## Remarks
  8383. The handler is not required to perform any action, and your code should avoid generating exceptions or allowing exceptions to propagate to the calling method. Any exceptions that do reach the caller are ignored.
  8384. When you create a <xref:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
  8385. ]]></format>
  8386. </remarks>
  8387. </member>
  8388. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs">
  8389. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating" /> event.</summary><remarks>
  8390. <format type="text/markdown"><![CDATA[
  8391. ## Remarks
  8392. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event is raised before an <xref:System.Data.Common.DbDataAdapter.Update%2A> to a row.
  8393. When you are using <xref:System.Data.Common.DbDataAdapter.Update%2A>, there are two events that occur for each data row updated. The order of execution is as follows:
  8394. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  8395. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  8396. 3. The command executes.
  8397. 4. If the command is set to `FirstReturnedRecord`, and the first returned result is placed in the <xref:System.Data.DataRow>.
  8398. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  8399. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  8400. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  8401. ## Examples
  8402. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  8403. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  8404. event args: (command=Microsoft.Data.SqlClient.SQLCommand commandType=2 status=0)
  8405. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  8406. event args: (command=Microsoft.Data.SqlClient.SQLCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  8407. [!code-csharp[SqlRowUpdatingEventArgs Example#1](~/../sqlclient/doc/samples/SqlRowUpdatingEventArgs.cs#1)]
  8408. ]]></format>
  8409. </remarks>
  8410. </member>
  8411. <member name="M:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.#ctor(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  8412. <param name="row">The <see cref="T:System.Data.DataRow" /> to <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</param><param name="command">The <see cref="T:System.Data.IDbCommand" /> to execute during <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</param><param name="statementType">One of the <see cref="T:System.Data.StatementType" /> values that specifies the type of query executed.</param><param name="tableMapping">The <see cref="T:System.Data.Common.DataTableMapping" /> sent through an <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs" /> class.</summary><remarks>To be added.</remarks>
  8413. </member>
  8414. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.BaseCommand">
  8415. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  8416. </member>
  8417. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.Command">
  8418. <summary>Gets or sets the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> to execute when performing the <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> to execute when performing the <see cref="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</value><remarks>To be added.</remarks>
  8419. </member>
  8420. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventHandler">
  8421. <param name="sender">The source of the event.</param><param name="e">The <see cref="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs" /> that contains the event data.</param><summary>Represents the method that will handle the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating" /> event of a <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />.</summary><remarks>
  8422. <format type="text/markdown"><![CDATA[
  8423. ## Remarks
  8424. The handler is not required to perform any action, and your code should avoid generating exceptions or allowing exceptions to propagate to the calling method. Any exceptions that do reach the caller are ignored.
  8425. The handler may use the <xref:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs> to influence the processing of the updates. For example, the handler may opt to skip the update of the current row or skip the update of all remaining rows. Note that the rows are updated in the order that they were received from the data source.
  8426. When you create a <xref:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
  8427. ]]></format>
  8428. </remarks>
  8429. </member>
  8430. <member name="T:Microsoft.Data.SqlClient.SqlTransaction">
  8431. <summary>Represents a Transact-SQL transaction to be made in a SQL Server database. This class cannot be inherited.</summary><remarks>
  8432. <format type="text/markdown"><![CDATA[
  8433. ## Remarks
  8434. The application creates a <xref:Microsoft.Data.SqlClient.SqlTransaction> object by calling <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A> on the <xref:Microsoft.Data.SqlClient.SqlConnection> object. All subsequent operations associated with the transaction (for example, committing or aborting the transaction), are performed on the <xref:Microsoft.Data.SqlClient.SqlTransaction> object.
  8435. > [!NOTE]
  8436. > `Try`/`Catch` exception handling should always be used when committing or rolling back a <xref:Microsoft.Data.SqlClient.SqlTransaction>. Both <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> generate an <xref:System.InvalidOperationException> if the connection is terminated or if the transaction has already been rolled back on the server.
  8437. For more information on SQL Server transactions, see [Explicit Transactions](https://msdn.microsoft.com/library/ms175127\(SQL.105\).aspx) and [Coding Efficient Transactions](https://msdn.microsoft.com/library/ms187484\(SQL.105\).aspx).
  8438. ## Examples
  8439. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods. The transaction is rolled back on any error, or if it is disposed without first being committed. `Try`/`Catch` error handling is used to handle any errors when attempting to commit or roll back the transaction.
  8440. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  8441. ]]></format>
  8442. </remarks>
  8443. </member>
  8444. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.Connection">
  8445. <summary>Gets the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> object associated with the transaction, or <see langword="null" /> if the transaction is no longer valid.</summary><value>The <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> object associated with the transaction.</value><remarks>
  8446. <format type="text/markdown"><![CDATA[
  8447. ## Remarks
  8448. A single application may have multiple database connections, each with zero or more transactions. This property lets you determine the connection object associated with a particular transaction created by <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>.
  8449. ]]></format>
  8450. </remarks>
  8451. </member>
  8452. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.DbConnection">
  8453. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  8454. </member>
  8455. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.IsolationLevel">
  8456. <summary>Specifies the <see cref="T:System.Data.IsolationLevel" /> for this transaction.</summary><value>The <see cref="T:System.Data.IsolationLevel" /> for this transaction. The default is <see langword="ReadCommitted" />.</value><remarks>
  8457. <format type="text/markdown"><![CDATA[
  8458. ## Remarks
  8459. Parallel transactions are not supported. Therefore, the <xref:System.Data.IsolationLevel> applies to the whole transaction.
  8460. For more information on SQL Server isolation levels, see [Transaction Isolation Levels](/sql/t-sql/language-elements/transaction-isolation-levels).
  8461. ]]></format>
  8462. </remarks>
  8463. </member>
  8464. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Commit">
  8465. <summary>Commits the database transaction.</summary><remarks>
  8466. <format type="text/markdown"><![CDATA[
  8467. ## Remarks
  8468. The <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> method is equivalent to the Transact-SQL COMMIT TRANSACTION statement. You cannot roll back a transaction once it has been committed, because all modifications have become a permanent part of the database. For more information, see [COMMIT TRANSACTION (Transact-SQL)](/sql/t-sql/language-elements/commit-transaction-transact-sql).
  8469. > [!NOTE]
  8470. > `Try`/`Catch` exception handling should always be used when committing or rolling back a <xref:Microsoft.Data.SqlClient.SqlTransaction>. Both `Commit` and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> generates an <xref:System.InvalidOperationException> if the connection is terminated or if the transaction has already been rolled back on the server.
  8471. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  8472. ## Examples
  8473. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods. The transaction is rolled back on any error. `Try`/`Catch` error handling is used to handle any errors when attempting to commit or roll back the transaction.
  8474. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  8475. ]]></format>
  8476. </remarks><exception cref="T:System.Exception">An error occurred while trying to commit the transaction.</exception><exception cref="T:System.InvalidOperationException">The transaction has already been committed or rolled back.
  8477. -or-
  8478. The connection is broken.</exception>
  8479. </member>
  8480. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Dispose(System.Boolean)">
  8481. <summary>Releases the resources that are held by the object.</summary><remarks>To be added.</remarks>
  8482. </member>
  8483. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Rollback">
  8484. <summary>Rolls back a transaction from a pending state.</summary>
  8485. </member>
  8486. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Rollback(System.String)">
  8487. <summary>Rolls back a transaction from a pending state.</summary><remarks>
  8488. <format type="text/markdown"><![CDATA[
  8489. ## Remarks
  8490. The <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> method is equivalent to the Transact-SQL ROLLBACK TRANSACTION statement. For more information, see [ROLLBACK TRANSACTION (Transact-SQL)
  8491. ](/sql/t-sql/language-elements/rollback-transaction-transact-sql).
  8492. The transaction can only be rolled back from a pending state (after <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A> has been called, but before <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A> is called). The transaction is rolled back in the event it is disposed before `Commit` or `Rollback` is called.
  8493. > [!NOTE]
  8494. > `Try`/`Catch` exception handling should always be used when rolling back a transaction. A `Rollback` generates an <xref:System.InvalidOperationException> if the connection is terminated or if the transaction has already been rolled back on the server.
  8495. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  8496. ## Examples
  8497. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlTransaction>. It also demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A>, <xref:Microsoft.Data.SqlClient.SqlTransaction.Commit%2A>, and <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> methods. The transaction is rolled back on any error. `Try`/`Catch` error handling is used to handle any errors when attempting to commit or roll back the transaction.
  8498. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  8499. ]]></format>
  8500. </remarks><exception cref="T:System.Exception">An error occurred while trying to commit the transaction.</exception><exception cref="T:System.InvalidOperationException">The transaction has already been committed or rolled back.
  8501. -or-
  8502. The connection is broken.</exception>
  8503. </member>
  8504. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Save(System.String)">
  8505. <param name="savePointName">The name of the savepoint.</param><summary>Creates a savepoint in the transaction that can be used to roll back a part of the transaction, and specifies the savepoint name.</summary><remarks>
  8506. <format type="text/markdown"><![CDATA[
  8507. ## Remarks
  8508. <xref:Microsoft.Data.SqlClient.SqlTransaction.Save%2A> method is equivalent to the Transact-SQL SAVE TRANSACTION statement.
  8509. The value used in the `savePoint` parameter can be the same value used in the `transactionName` parameter of some implementations of the <xref:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction%2A> method.
  8510. Savepoints offer a mechanism to roll back parts of transactions. You create a savepoint using the <xref:Microsoft.Data.SqlClient.SqlTransaction.Save%2A> method, and then later call the <xref:Microsoft.Data.SqlClient.SqlTransaction.Rollback%2A> method to roll back to the savepoint instead of rolling back to the start of the transaction.
  8511. ]]></format>
  8512. </remarks><exception cref="T:System.Exception">An error occurred while trying to commit the transaction.</exception><exception cref="T:System.InvalidOperationException">The transaction has already been committed or rolled back.
  8513. -or-
  8514. The connection is broken.</exception>
  8515. </member>
  8516. <member name="T:Microsoft.Data.SqlClient.Server.DataAccessKind">
  8517. <summary>Describes the type of access to user data for a user-defined method or function.</summary><remarks>
  8518. <format type="text/markdown"><![CDATA[
  8519. ## Remarks
  8520. Describes the type of access to user data for a user-defined method or function.
  8521. This enumeration is used in <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> and <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute> to indicate whether the method or function uses ADO.NET to connect back to the database using the "context connection."
  8522. Note that methods and functions are not allowed to make changes to the database, so the options for this enumeration are `None` (meaning no data-access performed by the method or function) and `Read` (meaning that the method or function perform read-only data-access operations, such as executing SELECT statements).
  8523. ]]></format>
  8524. </remarks>
  8525. </member>
  8526. <member name="F:Microsoft.Data.SqlClient.Server.DataAccessKind.None">
  8527. <summary>The method or function does not access user data.</summary>
  8528. </member>
  8529. <member name="F:Microsoft.Data.SqlClient.Server.DataAccessKind.Read">
  8530. <summary>The method or function reads user data.</summary>
  8531. </member>
  8532. <member name="T:Microsoft.Data.SqlClient.Server.Format">
  8533. <summary>Used by <see cref="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute" /> and <see cref="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute" /> to indicate the serialization format of a user-defined type (UDT) or aggregate.</summary><remarks>
  8534. <format type="text/markdown"><![CDATA[
  8535. ## Remarks
  8536. This enumeration is used by <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute> and <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute> to indicate the serialization format of a user-defined type (UDT) or aggregate. Use of the `Native` and `UserDefined` enumeration members has special requirements.
  8537. - `Format.Native`
  8538. The requirements for the `Format.Native` format are:
  8539. - The <xref:System.Runtime.InteropServices.StructLayoutAttribute> with a <xref:System.Runtime.InteropServices.StructLayoutAttribute.Value> property value of <xref:System.Runtime.InteropServices.LayoutKind.Sequential?displayProperty=nameWithType> must be applied to the aggregate or UDT if it is defined in a class and not a structure. This controls the physical layout of the data fields and is used to force the members to be laid out sequentially in the order they appear. SQL Server uses this attribute to determine the field order for UDTs with multiple fields.
  8540. - The type must contain at least one member (serialized values cannot be zero bytes in size).
  8541. - All the fields of the aggregate must be *blittable*; that is, they must have a common representation in both managed and unmanaged memory and not require special handling by the interop marshaler.
  8542. - All the fields of the UDT should be of one of the following types that can be serialized: `bool`, `byte`, `sbyte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `float`, `double`, <xref:System.Data.SqlTypes.SqlByte>, <xref:System.Data.SqlTypes.SqlInt16>, <xref:System.Data.SqlTypes.SqlInt32>, <xref:System.Data.SqlTypes.SqlInt64>, <xref:System.Data.SqlTypes.SqlDateTime>, <xref:System.Data.SqlTypes.SqlSingle>, <xref:System.Data.SqlTypes.SqlDouble>, <xref:System.Data.SqlTypes.SqlMoney>, or other value types defined by the user that contain fields of one of these types.
  8543. - The aggregate must not specify a value for `MaxByteSize`.
  8544. - The aggregate must not have any [NonSerialized] fields.
  8545. - Fields must not be marked as an explicit layout (with a <xref:System.Runtime.InteropServices.StructLayoutAttribute.Value?displayProperty=nameWithType> of <xref:System.Runtime.InteropServices.LayoutKind.Explicit?displayProperty=nameWithType>).
  8546. - `Format.UserDefined`
  8547. The requirements for the `Format.UserDefined` format are:
  8548. - The aggregate must specify a value for `MaxByteSize`.
  8549. - Specify the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A?displayProperty=nameWithType> attribute property. The default value is `false`.
  8550. - If you omit any field in the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A?displayProperty=nameWithType> or <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write%2A?displayProperty=nameWithType> methods, the state of that field is not serialized.
  8551. ## Examples
  8552. The following example shows the `UserDefinedType` attribute of the Point UDT. The UDT is byte-ordered, is named "Point", has a validation method named "ValidatePoint", and uses the native serialization format.
  8553. [!code-csharp[SqlUserDefinedType Example#1](~/../sqlclient/doc/samples/SqlUserDefinedType.cs#1)]
  8554. ]]></format>
  8555. </remarks>
  8556. </member>
  8557. <member name="F:Microsoft.Data.SqlClient.Server.Format.Unknown">
  8558. <summary>The serialization format is unknown.</summary>
  8559. </member>
  8560. <member name="F:Microsoft.Data.SqlClient.Server.Format.Native">
  8561. <summary>This serialization format uses a very simple algorithm that enables SQL Server to store an efficient representation of the UDT on disk. Types marked for <see langword="Native" /> serialization can only have value types (structs in Microsoft Visual C# and structures in Microsoft Visual Basic .NET) as members. Members of reference types (such as classes in Visual C# and Visual Basic), either user-defined or those existing in .NET class libraries (such as <see cref="T:System.String" />), are not supported.</summary>
  8562. </member>
  8563. <member name="F:Microsoft.Data.SqlClient.Server.Format.UserDefined">
  8564. <summary>This serialization format gives the developer full control over the binary format through the <see cref="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write(System.IO.BinaryWriter)" /> and <see cref="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read(System.IO.BinaryReader)" /> methods.</summary>
  8565. </member>
  8566. <member name="T:Microsoft.Data.SqlClient.Server.IBinarySerialize">
  8567. <summary>Provides custom implementation for user-defined type (UDT) and user-defined aggregate serialization and deserialization.</summary><remarks>
  8568. <format type="text/markdown"><![CDATA[
  8569. ## Remarks
  8570. User-defined types (UDTs) and user-defined aggregates are required to define a storage format, which can be either <xref:Microsoft.Data.SqlClient.Server.Format>.`Native` or <xref:Microsoft.Data.SqlClient.Server.Format>.`UserDefined`.
  8571. <xref:Microsoft.Data.SqlClient.Server.Format>.`Native` allows SQL Server to handle serialization and deserialization automatically, but the format has restrictions on the kind of types it can handle. <xref:Microsoft.Data.SqlClient.Server.Format>.`UserDefined` allows user-defined types and aggregates to handle their own serialization. User-defined types and aggregates must be marked with <xref:Microsoft.Data.SqlClient.Server.Format>.`UserDefined` in the `SqlUserDefinedType` or `SqlUserDefinedAggregate` attribute, and must implement the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize> interface.
  8572. Note that even with custom serialization, the total size of each instance must be under the maximum allowed limit, currently 8000 bytes.
  8573. ]]></format>
  8574. </remarks>
  8575. </member>
  8576. <member name="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read(System.IO.BinaryReader)">
  8577. <param name="r">The <see cref="T:System.IO.BinaryReader" /> stream from which the object is deserialized.</param><summary>Generates a user-defined type (UDT) or user-defined aggregate from its binary form.</summary><remarks>
  8578. <format type="text/markdown"><![CDATA[
  8579. ## Remarks
  8580. The <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A> method must reconstitute your object using the information written by the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write%2A> method.
  8581. ## Examples
  8582. The following example shows the implementation of the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A> method of a UDT, which uses a <xref:System.IO.BinaryReader> to de-serialize a previously persisted UDT. This example assumes that the UDT has two data properties: `StringValue` and `DoubleValue`.
  8583. [!code-csharp[IBinarySerialize Samples#1](~/../sqlclient/doc/samples/IBinarySerialize.cs#1)]
  8584. ]]></format>
  8585. </remarks>
  8586. </member>
  8587. <member name="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write(System.IO.BinaryWriter)">
  8588. <param name="w">The <see cref="T:System.IO.BinaryWriter" /> stream to which the UDT or user-defined aggregate is serialized.</param><summary>Converts a user-defined type (UDT) or user-defined aggregate into its binary format so that it may be persisted.</summary><remarks>
  8589. <format type="text/markdown"><![CDATA[
  8590. ## Remarks
  8591. Write sufficient information to the binary stream to allow the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A> method to reconstitute your UDT or user-defined aggregate.
  8592. ## Examples
  8593. The following example shows the implementation of the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write%2A> method of a UDT, which uses a <xref:System.IO.BinaryWriter> to serialize the UDT in the user-defined binary format. The purpose of the null character padding is to ensure that the string value is completely separated from the double value, so that one UDT is compared to another in Transact-SQL code, string bytes are compared to string bytes and double bytes are compared to double bytes.
  8594. [!code-csharp[IBinarySerialize Samples#2](~/../sqlclient/doc/samples/IBinarySerialize.cs#2)]
  8595. ]]></format>
  8596. </remarks>
  8597. </member>
  8598. <member name="T:Microsoft.Data.SqlClient.Server.InvalidUdtException">
  8599. <summary>Thrown when SQL Server or the ADO.NET <see cref="N:Microsoft.Data.SqlClient" /> provider detects an invalid user-defined type (UDT).</summary><remarks>To be added.</remarks>
  8600. </member>
  8601. <member name="T:Microsoft.Data.SqlClient.Server.SqlDataRecord">
  8602. <summary>Represents a single row of data and its metadata. This class cannot be inherited.</summary><remarks>
  8603. <format type="text/markdown"><![CDATA[
  8604. ## Remarks
  8605. This class is used together with <xref:Microsoft.SqlServer.Server.SqlPipe> to send result sets to the client from managed code stored-procedures.
  8606. When writing common language runtime (CLR) applications, you should re-use existing `SqlDataRecord` objects instead of creating new ones every time. Creating many new `SqlDataRecord` objects could severely deplete memory and adversely affect performance.
  8607. ## Examples
  8608. The following example shows how to create several <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> objects, which describe the column metadata of a record, and creating a <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord>. The column values of the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> are set and the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> is sent to the calling program by using the <xref:Microsoft.SqlServer.Server.SqlContext> class.
  8609. [!code-csharp[SqlDataRecord Samples#1](~/../sqlclient/doc/samples/SqlDataRecord.cs#1)]
  8610. ]]></format>
  8611. </remarks>
  8612. </member>
  8613. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.#ctor(Microsoft.Data.SqlClient.Server.SqlMetaData[])">
  8614. <param name="metaData">An array of <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> objects that describe each column in the <see cref="T:Microsoft.Data.SqlClient.Server.SqlDataRecord" />.</param><summary>Inititializes a new <see cref="T:Microsoft.Data.SqlClient.Server.SqlDataRecord" /> instance with the schema based on the array of <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> objects passed as an argument.</summary><remarks>
  8615. <format type="text/markdown"><![CDATA[
  8616. ## Examples
  8617. The following example shows how to create a new <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> object from two <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> objects, which indicate the column name and data type.
  8618. [!code-csharp[SqlDataRecord Samples#2](~/../sqlclient/doc/samples/SqlDataRecord.cs#2)]
  8619. ]]></format>
  8620. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="metaData" /> is <see langword="null" />.</exception>
  8621. </member>
  8622. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount">
  8623. <summary>Gets the number of columns in the data row. This property is read-only.</summary><value>The number of columns in the data row as an integer.</value><remarks>To be added.</remarks>
  8624. </member>
  8625. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.Item(System.Int32)">
  8626. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the common language runtime (CLR) type value for the column specified by the column <paramref name="ordinal" /> argument.</summary><value>The CLR type value of the column specified by the <paramref name="ordinal" />.</value><remarks>
  8627. <format type="text/markdown"><![CDATA[
  8628. ## Remarks
  8629. For columns with null value, <xref:System.DBNull.Value> is returned.
  8630. ]]></format>
  8631. </remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8632. </member>
  8633. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.Item(System.String)">
  8634. <param name="name">The name of the column.</param><summary>Gets the common language runtime (CLR) type value for the column specified by the column <paramref name="name" /> argument.</summary><value>The CLR type value of the column specified by the <paramref name="name" />.</value><remarks>
  8635. <format type="text/markdown"><![CDATA[
  8636. ## Remarks
  8637. For columns with null value, <xref:System.DBNull.Value> is returned.
  8638. ]]></format>
  8639. </remarks>
  8640. </member>
  8641. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBoolean(System.Int32)">
  8642. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Boolean" />.</summary><returns>The column value as a <see cref="T:System.Boolean" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8643. </member>
  8644. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetByte(System.Int32)">
  8645. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Byte" />.</summary><returns>The column value as a <see cref="T:System.Byte" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8646. </member>
  8647. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  8648. <param name="ordinal">The zero-based ordinal of the column.</param><param name="fieldOffset">The offset into the field value to start retrieving bytes.</param><param name="buffer">The target buffer to which to copy bytes.</param><param name="bufferOffset">The offset into the buffer to which to start copying bytes.</param><param name="length">The number of bytes to copy to the buffer.</param><summary>Gets the value for the column specified by the ordinal as an array of <see cref="T:System.Byte" /> objects.</summary><returns>The number of bytes copied.</returns><remarks>
  8649. <format type="text/markdown"><![CDATA[
  8650. ## Remarks
  8651. This method enables you to obtain a binary value either in a single call or in chunks. Getting the value in chunks is useful for large values or values of unknown size.
  8652. To obtain the value in several chunks, allocate a byte array of the chunk-size and call <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBytes%2A> repeatedly, adjusting the `fieldOffset` parameter accordingly in each call.
  8653. ]]></format>
  8654. </remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8655. </member>
  8656. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChar(System.Int32)">
  8657. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Char" />.</summary><returns>The column value as a <see cref="T:System.Char" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8658. </member>
  8659. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  8660. <param name="ordinal">The zero-based ordinal of the column.</param><param name="fieldOffset">The offset into the field value to start retrieving characters.</param><param name="buffer">The target buffer to copy chars to.</param><param name="bufferOffset">The offset into the buffer to start copying chars to.</param><param name="length">The number of chars to copy to the buffer.</param><summary>Gets the value for the column specified by the ordinal as an array of <see cref="T:System.Char" /> objects.</summary><returns>The number of characters copied.</returns><remarks>
  8661. <format type="text/markdown"><![CDATA[
  8662. ## Remarks
  8663. This method enables you to obtain a character value either in a single call or in chunks. Getting the value in chunks is useful for large values or values of unknown size.
  8664. To obtain the value in several chunks, allocate a char array of the chunk-size and call <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChars%2A> repeatedly adjusting the `fieldOffset` parameter accordingly in each call.
  8665. ]]></format>
  8666. </remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8667. </member>
  8668. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.System#Data#IDataRecord#GetData(System.Int32)">
  8669. <param name="ordinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  8670. </member>
  8671. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDataTypeName(System.Int32)">
  8672. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns the name of the data type for the column specified by the ordinal argument.</summary><returns>A <see cref="T:System.String" /> that contains the data type of the column.</returns><remarks>
  8673. <format type="text/markdown"><![CDATA[
  8674. ## Remarks
  8675. This method returns the type name as known in the SQL Server type-system. For user-defined types (UDTs), it returns the three-part name that was used to register the type with SQL Server.
  8676. ]]></format>
  8677. </remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8678. </member>
  8679. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDateTime(System.Int32)">
  8680. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.DateTime" />.</summary><returns>The column value as a <see cref="T:System.DateTime" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8681. </member>
  8682. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDateTimeOffset(System.Int32)">
  8683. <param name="ordinal">The zero-based column ordinal.</param><summary>Returns the specified column's data as a <see cref="T:System.DateTimeOffset" />.</summary><returns>The value of the specified column as a <see cref="T:System.DateTimeOffset" />.</returns><remarks>To be added.</remarks>
  8684. </member>
  8685. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDecimal(System.Int32)">
  8686. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Decimal" />.</summary><returns>The column value as a <see cref="T:System.Decimal" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8687. </member>
  8688. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDouble(System.Int32)">
  8689. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Double" />.</summary><returns>The column value as a <see cref="T:System.Double" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8690. </member>
  8691. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetFieldType(System.Int32)">
  8692. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns a <see cref="T:System.Type" /> object representing the common language runtime (CLR) type that maps to the SQL Server type of the column specified by the <paramref name="ordinal" /> argument.</summary><returns>The column type as a <see cref="T:System.Type" /> object.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.TypeLoadException">The column is of a user-defined type that is not available to the calling application domain.</exception><exception cref="T:System.IO.FileNotFoundException">The column is of a user-defined type that is not available to the calling application domain.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8693. </member>
  8694. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetFloat(System.Int32)">
  8695. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see langword="float" />.</summary><returns>The column value as a <see langword="float" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8696. </member>
  8697. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetGuid(System.Int32)">
  8698. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Guid" />.</summary><returns>The column value as a <see cref="T:System.Guid" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8699. </member>
  8700. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt16(System.Int32)">
  8701. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Int16" />.</summary><returns>The column value as a <see cref="T:System.Int16" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8702. </member>
  8703. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt32(System.Int32)">
  8704. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Int32" />.</summary><returns>The column value as a <see cref="T:System.Int32" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8705. </member>
  8706. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt64(System.Int32)">
  8707. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Int64" />.</summary><returns>The column value as a <see cref="T:System.Int64" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The column specified by <paramref name="ordinal" /> is null.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8708. </member>
  8709. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetName(System.Int32)">
  8710. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns the name of the column specified by the ordinal argument.</summary><returns>A <see cref="T:System.String" /> containing the column name.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8711. </member>
  8712. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetOrdinal(System.String)">
  8713. <param name="name">The name of the column to look up.</param><summary>Returns the column ordinal specified by the column name.</summary><returns>The zero-based ordinal of the column as an integer.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentNullException">
  8714. <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.IndexOutOfRangeException">The column name could not be found.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8715. </member>
  8716. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBinary(System.Int32)">
  8717. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlBinary" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlBinary" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8718. </member>
  8719. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBoolean(System.Int32)">
  8720. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlBoolean" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlBoolean" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8721. </member>
  8722. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlByte(System.Int32)">
  8723. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlByte" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlByte" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8724. </member>
  8725. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBytes(System.Int32)">
  8726. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlBytes" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlBytes" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8727. </member>
  8728. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlChars(System.Int32)">
  8729. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlChars" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlChars" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8730. </member>
  8731. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDateTime(System.Int32)">
  8732. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlDateTime" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlDateTime" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8733. </member>
  8734. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDecimal(System.Int32)">
  8735. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlDecimal" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlDecimal" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8736. </member>
  8737. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDouble(System.Int32)">
  8738. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlDouble" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlDouble" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8739. </member>
  8740. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlFieldType(System.Int32)">
  8741. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns a <see cref="T:System.Type" /> object that represents the type (as a SQL Server type, defined in <see cref="N:System.Data.SqlTypes" />) that maps to the SQL Server type of the column.</summary><returns>The column type as a <see cref="T:System.Type" /> object.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.TypeLoadException">The column is of a user-defined type that is not available to the calling application domain.</exception><exception cref="T:System.IO.FileNotFoundException">The column is of a user-defined type that is not available to the calling application domain.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8742. </member>
  8743. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlGuid(System.Int32)">
  8744. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlGuid" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlGuid" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8745. </member>
  8746. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt16(System.Int32)">
  8747. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlInt16" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlInt16" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8748. </member>
  8749. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt32(System.Int32)">
  8750. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlInt32" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlInt32" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8751. </member>
  8752. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt64(System.Int32)">
  8753. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlInt64" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlInt64" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8754. </member>
  8755. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlMetaData(System.Int32)">
  8756. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns a <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> object, describing the metadata of the column specified by the column ordinal.</summary><returns>The column metadata as a <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> object.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8757. </member>
  8758. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlMoney(System.Int32)">
  8759. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlMoney" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlMoney" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8760. </member>
  8761. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlSingle(System.Int32)">
  8762. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlSingle" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlSingle" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8763. </member>
  8764. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlString(System.Int32)">
  8765. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlString" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlString" />.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8766. </member>
  8767. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlValue(System.Int32)">
  8768. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns the data value stored in the column, expressed as a SQL Server type, specified by the column ordinal.</summary><returns>The value of the column, expressed as a SQL Server type, as a <see cref="T:System.Object" />.</returns><remarks>
  8769. <format type="text/markdown"><![CDATA[
  8770. ## Remarks
  8771. For null values, a SQL Server type instance is returned where the <xref:System.Data.SqlTypes.INullable.IsNull%2A> property is true.
  8772. ]]></format>
  8773. </remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception><altmember cref="N:System.Data.SqlTypes" />
  8774. </member>
  8775. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlValues(System.Object[])">
  8776. <param name="values">The array into which to copy the values column values.</param><summary>Returns the values for all the columns in the record, expressed as SQL Server types, in an array.</summary><returns>An <see cref="T:System.Int32" /> that indicates the number of columns copied.</returns><remarks>
  8777. <format type="text/markdown"><![CDATA[
  8778. ## Remarks
  8779. The SQL Server type values of the column are copied into the `values` array that is passed as a parameter. For null values, a Sql type instance is returned where the <xref:System.Data.SqlTypes.INullable.IsNull%2A> property is true.
  8780. The length of the `values` array does not need to match the number of columns in the record. If the array length is greater than the number of columns, all of the column values are copied into the array; if it is less, only the array length number of column values are copied into the array, starting at the column value with ordinal 0.
  8781. ]]></format>
  8782. </remarks><exception cref="T:System.ArgumentNullException">
  8783. <paramref name="values" /> is <see langword="null" />.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception><altmember cref="N:System.Data.SqlTypes" />
  8784. </member>
  8785. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlXml(System.Int32)">
  8786. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.Data.SqlTypes.SqlXml" />.</summary><returns>The column value as a <see cref="T:System.Data.SqlTypes.SqlXml" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8787. </member>
  8788. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetString(System.Int32)">
  8789. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Gets the value for the column specified by the ordinal as a <see cref="T:System.String" />.</summary><returns>The column value as a <see cref="T:System.String" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8790. </member>
  8791. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetTimeSpan(System.Int32)">
  8792. <param name="ordinal">The zero-based column ordinal.</param><summary>Returns the specified column's data as a <see cref="T:System.TimeSpan" />.</summary><returns>The value of the specified column as a <see cref="T:System.TimeSpan" />.</returns><remarks>To be added.</remarks>
  8793. </member>
  8794. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetValue(System.Int32)">
  8795. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns the common language runtime (CLR) type value for the column specified by the ordinal argument.</summary><returns>The CLR type value of the column specified by the ordinal.</returns><remarks>
  8796. <format type="text/markdown"><![CDATA[
  8797. ## Remarks
  8798. For columns with null value, <xref:System.DBNull.Value> is returned.
  8799. ]]></format>
  8800. </remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8801. </member>
  8802. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetValues(System.Object[])">
  8803. <param name="values">The array into which to copy the values column values.</param><summary>Returns the values for all the columns in the record, expressed as common language runtime (CLR) types, in an array.</summary><returns>An <see cref="T:System.Int32" /> that indicates the number of columns copied.</returns><remarks>
  8804. <format type="text/markdown"><![CDATA[
  8805. ## Remarks
  8806. The CLR type values of the column are copied into the `values` array that is passed as a parameter. For columns with null value, <xref:System.DBNull.Value> is returned.
  8807. The length of the `values` array does not need to match the number of columns in the record. If the array length is greater than the number of columns, all of the column values are copied into the array; if it is less, only the array length number of column values is copied into the array, starting at the column value with ordinal 0.
  8808. ]]></format>
  8809. </remarks><exception cref="T:System.ArgumentNullException">
  8810. <paramref name="values" /> is <see langword="null" />.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8811. </member>
  8812. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.IsDBNull(System.Int32)">
  8813. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Returns true if the column specified by the column ordinal parameter is null.</summary><returns>
  8814. <see langword="true" /> if the column is null; <see langword="false" /> otherwise.</returns><remarks>To be added.</remarks><exception cref="T:System.IndexOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8815. </member>
  8816. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetBoolean(System.Int32,System.Boolean)">
  8817. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Boolean" /> value.</summary><remarks>To be added.</remarks>
  8818. </member>
  8819. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetByte(System.Int32,System.Byte)">
  8820. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Byte" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8821. </member>
  8822. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  8823. <param name="ordinal">The zero-based ordinal of the column.</param><param name="fieldOffset">The offset into the field value to start copying bytes.</param><param name="buffer">The target buffer from which to copy bytes.</param><param name="bufferOffset">The offset into the buffer from which to start copying bytes.</param><param name="length">The number of bytes to copy from the buffer.</param><summary>Sets the data stored in the column to the specified array of <see cref="T:System.Byte" /> values.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8824. </member>
  8825. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetChar(System.Int32,System.Char)">
  8826. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Char" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8827. </member>
  8828. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  8829. <param name="ordinal">The zero-based ordinal of the column.</param><param name="fieldOffset">The offset into the field value to start copying characters.</param><param name="buffer">The target buffer from which to copy chars.</param><param name="bufferOffset">The offset into the buffer from which to start copying chars.</param><param name="length">The number of chars to copy from the buffer.</param><summary>Sets the data stored in the column to the specified array of <see cref="T:System.Char" /> values.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8830. </member>
  8831. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDateTime(System.Int32,System.DateTime)">
  8832. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.DateTime" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8833. </member>
  8834. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDateTimeOffset(System.Int32,System.DateTimeOffset)">
  8835. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the value of the column specified to the <see cref="T:System.DateTimeOffset" /> value.</summary><remarks>To be added.</remarks>
  8836. </member>
  8837. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDBNull(System.Int32)">
  8838. <param name="ordinal">The zero-based ordinal of the column.</param><summary>Sets the value in the specified column to <see cref="T:System.DBNull" />.</summary><remarks>To be added.</remarks>
  8839. </member>
  8840. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDecimal(System.Int32,System.Decimal)">
  8841. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Decimal" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8842. </member>
  8843. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDouble(System.Int32,System.Double)">
  8844. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Double" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8845. </member>
  8846. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetFloat(System.Int32,System.Single)">
  8847. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see langword="float" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8848. </member>
  8849. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetGuid(System.Int32,System.Guid)">
  8850. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Guid" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8851. </member>
  8852. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt16(System.Int32,System.Int16)">
  8853. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Int16" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8854. </member>
  8855. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt32(System.Int32,System.Int32)">
  8856. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Int32" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8857. </member>
  8858. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt64(System.Int32,System.Int64)">
  8859. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Int64" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8860. </member>
  8861. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBinary(System.Int32,System.Data.SqlTypes.SqlBinary)">
  8862. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlBinary" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8863. </member>
  8864. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBoolean(System.Int32,System.Data.SqlTypes.SqlBoolean)">
  8865. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlBoolean" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8866. </member>
  8867. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlByte(System.Int32,System.Data.SqlTypes.SqlByte)">
  8868. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlByte" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8869. </member>
  8870. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBytes(System.Int32,System.Data.SqlTypes.SqlBytes)">
  8871. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlBytes" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8872. </member>
  8873. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlChars(System.Int32,System.Data.SqlTypes.SqlChars)">
  8874. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlChars" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8875. </member>
  8876. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDateTime(System.Int32,System.Data.SqlTypes.SqlDateTime)">
  8877. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlDateTime" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8878. </member>
  8879. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDecimal(System.Int32,System.Data.SqlTypes.SqlDecimal)">
  8880. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlDecimal" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8881. </member>
  8882. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDouble(System.Int32,System.Data.SqlTypes.SqlDouble)">
  8883. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlDouble" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8884. </member>
  8885. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlGuid(System.Int32,System.Data.SqlTypes.SqlGuid)">
  8886. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlGuid" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8887. </member>
  8888. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt16(System.Int32,System.Data.SqlTypes.SqlInt16)">
  8889. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlInt16" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8890. </member>
  8891. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt32(System.Int32,System.Data.SqlTypes.SqlInt32)">
  8892. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlInt32" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8893. </member>
  8894. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt64(System.Int32,System.Data.SqlTypes.SqlInt64)">
  8895. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlInt64" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8896. </member>
  8897. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlMoney(System.Int32,System.Data.SqlTypes.SqlMoney)">
  8898. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlMoney" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8899. </member>
  8900. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlSingle(System.Int32,System.Data.SqlTypes.SqlSingle)">
  8901. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlSingle" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8902. </member>
  8903. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlString(System.Int32,System.Data.SqlTypes.SqlString)">
  8904. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlString" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8905. </member>
  8906. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlXml(System.Int32,System.Data.SqlTypes.SqlXml)">
  8907. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.Data.SqlTypes.SqlXml" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8908. </member>
  8909. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetString(System.Int32,System.String)">
  8910. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the data stored in the column to the specified <see cref="T:System.String" /> value.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8911. </member>
  8912. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetTimeSpan(System.Int32,System.TimeSpan)">
  8913. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value of the column.</param><summary>Sets the value of the column specified to the <see cref="T:System.TimeSpan" />.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> passed in is a negative number.</exception><exception cref="T:System.ArgumentException">The <see cref="T:System.TimeSpan" /> value passed in is greater than 24 hours in length.</exception>
  8914. </member>
  8915. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetValue(System.Int32,System.Object)">
  8916. <param name="ordinal">The zero-based ordinal of the column.</param><param name="value">The new value for the specified column.</param><summary>Sets a new value, expressed as a common language runtime (CLR) type, for the column specified by the column ordinal.</summary><remarks>
  8917. <format type="text/markdown"><![CDATA[
  8918. ## Remarks
  8919. `value` is a SQL type boxed as a <xref:System.Object> instance.
  8920. ]]></format>
  8921. </remarks><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="ordinal" /> is less than 0 or greater than the number of columns (that is, <see cref="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount" />).</exception>
  8922. </member>
  8923. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetValues(System.Object[])">
  8924. <param name="values">The array of new values, expressed as CLR types boxed as <see cref="T:System.Object" /> references, for the <see cref="T:Microsoft.Data.SqlClient.Server.SqlDataRecord" /> instance.</param><summary>Sets new values for all of the columns in the <see cref="T:Microsoft.Data.SqlClient.Server.SqlDataRecord" />. These values are expressed as common language runtime (CLR) types.</summary><returns>The number of column values set as an integer.</returns><remarks>
  8925. <format type="text/markdown"><![CDATA[
  8926. ## Remarks
  8927. The length of values must match the number of columns in the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> instance.
  8928. ]]></format>
  8929. </remarks><exception cref="T:System.ArgumentNullException">
  8930. <paramref name="values" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">The size of values does not match the number of columns in the <see cref="T:Microsoft.Data.SqlClient.Server.SqlDataRecord" /> instance.</exception>
  8931. </member>
  8932. <member name="T:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute">
  8933. <summary>Used to mark a method definition of a user-defined aggregate as a function in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server.</summary><remarks>
  8934. <format type="text/markdown"><![CDATA[
  8935. ## Examples
  8936. The following example shows an aggregate function that returns a list of files in the specified directory path.
  8937. [!code-csharp[SqlFunctionAttribute Sample#1](~/../sqlclient/doc/samples/SqlFunctionAttribute.cs#1)]
  8938. ]]></format>
  8939. </remarks>
  8940. </member>
  8941. <member name="M:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.#ctor">
  8942. <summary>An optional attribute on a user-defined aggregate, used to indicate that the method should be registered in SQL Server as a function. Also used to set the <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.FillRowMethodName" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsPrecise" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.Name" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.SystemDataAccess" />, and <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.TableDefinition" /> properties of the function attribute.</summary><remarks>To be added.</remarks>
  8943. </member>
  8944. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic">
  8945. <summary>Indicates whether the user-defined function is deterministic.</summary><value>
  8946. <see langword="true" /> if the function is deterministic; otherwise <see langword="false" />.</value><remarks>
  8947. <format type="text/markdown"><![CDATA[
  8948. ## Remarks
  8949. A user-defined function is said to be deterministic if it always produces the same output values given the same input values and the same database state.
  8950. The <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic%2A> property is also useful for indexing the result of the function in the form of indexed computed columns and indexed views. If this property is not specified, the function is assumed to be non-deterministic.
  8951. Functions that access local data can be deterministic. The data access characteristic is captured separately by the <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess%2A> and <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.SystemDataAccess%2A> properties.
  8952. Note that data access to remote servers (for example, using a <xref:Microsoft.Data.SqlClient.SqlConnection> to connect to another SQL Server instance) is available in user-defined functions. However, you must still honor the <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic%2A> declaration. If the common language runtime (CLR) function is marked as deterministic, it should not cause side-effects in the remote server. While side-effects against the context connection are restricted, SQL Server will not enforce the restriction for side-effects over remote connections.
  8953. The default value of this attribute is `false`.
  8954. Do not mark a function as deterministic if the function does not always produce the same output values, given the same input values and the same database state. Marking a function as deterministic when the function is not truly deterministic can result in corrupted indexed views and computed columns.
  8955. ]]></format>
  8956. </remarks>
  8957. </member>
  8958. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess">
  8959. <summary>Indicates whether the function involves access to user data stored in the local instance of SQL Server.</summary><value>
  8960. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="None" />: Does not access data. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="Read" />: Only reads user data.</value><remarks>
  8961. <format type="text/markdown"><![CDATA[
  8962. ## Remarks
  8963. The default is <xref:Microsoft.Data.SqlClient.Server.DataAccessKind.None>.<xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess%2A> is also required when connecting to remote servers if transactions integration is required (the default).
  8964. If a Transact-SQL query is executed from inside a table-valued function (TVF), the <xref:Microsoft.Data.SqlClient.Server.DataAccessKind.Read> property should be set.
  8965. ]]></format>
  8966. </remarks>
  8967. </member>
  8968. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.SystemDataAccess">
  8969. <summary>Indicates whether the function requires access to data stored in the system catalogs or virtual system tables of SQL Server.</summary><value>
  8970. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="None" />: Does not access system data. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="Read" />: Only reads system data.</value><remarks>
  8971. <format type="text/markdown"><![CDATA[
  8972. ## Remarks
  8973. The default is <xref:Microsoft.Data.SqlClient.Server.SystemDataAccessKind.None>.
  8974. ]]></format>
  8975. </remarks>
  8976. </member>
  8977. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsPrecise">
  8978. <summary>Indicates whether the function involves imprecise computations, such as floating point operations.</summary><value>
  8979. <see langword="true" /> if the function involves precise computations; otherwise <see langword="false" />.</value><remarks>
  8980. <format type="text/markdown"><![CDATA[
  8981. ## Remarks
  8982. Precision of a function is one of the properties used to determine if computed columns that use this function can be indexed.
  8983. The default value of this attribute is `false`.
  8984. ]]></format>
  8985. </remarks>
  8986. </member>
  8987. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.Name">
  8988. <summary>The name under which the function should be registered in SQL Server.</summary><value>A <see cref="T:System.String" /> value representing the name under which the function should be registered.</value><remarks>
  8989. <format type="text/markdown"><![CDATA[
  8990. ## Remarks
  8991. This attribute is used only by Microsoft Visual Studio to automatically register the specified method as a user-defined function. It is not used by SQL Server.
  8992. Thee following example specifies that the user-defined function is referenced using the name `sp_scalarFunc`.
  8993. ## Examples
  8994. [!code-csharp[SqlFunction#10](~/../sqlclient/doc/samples/SqlFunction.cs#10)]
  8995. ]]></format>
  8996. </remarks>
  8997. </member>
  8998. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.TableDefinition">
  8999. <summary>A string that represents the table definition of the results, if the method is used as a table-valued function (TVF).</summary><value>A <see cref="T:System.String" /> value representing the table definition of the results.</value><remarks>
  9000. <format type="text/markdown"><![CDATA[
  9001. ## Remarks
  9002. This attribute is used only by Microsoft Visual Studio to automatically register the specified method as a TVF. It is not used by SQL Server.
  9003. The following example specifies that the user-defined function is referenced using the name `sp_tableFunc`. The `TableDefinition` property has the value `letter nchar(1)`.
  9004. ## Examples
  9005. [!code-csharp[SqlFunction#11](~/../sqlclient/doc/samples/SqlFunction.cs#11)]
  9006. ]]></format>
  9007. </remarks>
  9008. </member>
  9009. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.FillRowMethodName">
  9010. <summary>The name of a method in the same class which is used to fill a row of data in the table returned by the table-valued function.</summary><value>A <see cref="T:System.String" /> value representing the name of a method in the same class which is used to fill a row of data in the table returned by the table-valued function.</value>
  9011. </member>
  9012. <member name="T:Microsoft.Data.SqlClient.Server.SqlMetaData">
  9013. <summary>Specifies and retrieves metadata information from parameters and columns of <see cref="T:Microsoft.Data.SqlClient.Server.SqlDataRecord" /> objects. This class cannot be inherited.</summary><remarks>
  9014. <format type="text/markdown"><![CDATA[
  9015. ## Examples
  9016. The following example shows the creation of several <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> objects, which describe the column metadata of a record, and the creation of a <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord>. The column values of the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> are set and the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> is sent to the calling program using the <xref:Microsoft.SqlServer.Server.SqlContext> class.
  9017. [!code-csharp[SqlMetaData Samples#1](~/../sqlclient/doc/samples/SqlMetaData.cs#1)]
  9018. ]]></format>
  9019. </remarks>
  9020. </member>
  9021. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType)">
  9022. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name and type.</summary><remarks>
  9023. <format type="text/markdown"><![CDATA[
  9024. ## Remarks
  9025. Only the following are allowed to be passed to the constructor as `dbType`: `Bit`, `BigInt`, `DateTime`, `Decimal`, `Float`, `Int`, `Money`, `Numeric`, `SmallDateTime`, `SmallInt`, `SmallMoney`, `TimeStamp`, `TinyInt`, `UniqueIdentifier`, `Xml`.
  9026. The following are the default values assigned to `dbType`, depending on the `SqlDbType` (the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A>, and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Type%2A> properties are set to `null`):
  9027. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9028. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9029. |`Bit`|1|1|0|0|None|
  9030. |`BigInt`|8|19|0|0|None|
  9031. |`DateTime`|8|23|3|0|None|
  9032. |`Decimal`|9|18|0|0|None|
  9033. |`Float`|8|53|0|0|None|
  9034. |`Int`|4|10|0|0|None|
  9035. |`Money`|8|19|4|0|None|
  9036. |`Numeric`|9|18|0|0|None|
  9037. |`SmallDateTime`|4|16|0|0|None|
  9038. |`SmallInt`|2|5|0|0|None|
  9039. |`SmallMoney`|4|10|4|0|None|
  9040. |`TimeStamp`|8|0|0|0|None|
  9041. |`TinyInt`|1|3|0|0|None|
  9042. |`UniqueIdentifier`|16|0|0|0|None|
  9043. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9044. ## Examples
  9045. The following example creates a new <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> object by specifying the column name and a column data type of <xref:System.Data.SqlDbType>.`Int`.
  9046. [!code-csharp[SqlMetaData Samples#3](~/../sqlclient/doc/samples/SqlMetaData.cs#3)]
  9047. ]]></format>
  9048. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">A <see langword="SqlDbType" /> that is not allowed was passed to the constructor as <paramref name="dbType" />.</exception>
  9049. </member>
  9050. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9051. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, and default server. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9052. <format type="text/markdown"><![CDATA[
  9053. ## Remarks
  9054. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9055. ]]></format>
  9056. </remarks>
  9057. </member>
  9058. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Byte,System.Byte)">
  9059. <param name="name">The name of the parameter or column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="precision">The precision of the parameter or column.</param><param name="scale">The scale of the parameter or column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, precision, and scale.</summary><remarks>
  9060. <format type="text/markdown"><![CDATA[
  9061. ## Remarks
  9062. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `Decimal`.
  9063. The following are the default values assigned to `dbType`, depending on the `SqlDbType` (the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A>, and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Type%2A> properties are set to `null`):
  9064. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9065. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9066. |Decimal|9|18|0|0|None|
  9067. ]]></format>
  9068. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">A <see langword="SqlDbType" /> that is not allowed was passed to the constructor as <paramref name="dbType" />, or <paramref name="scale" /> was greater than <paramref name="precision" />.</exception>
  9069. </member>
  9070. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Byte,System.Byte,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9071. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="precision">The precision of the parameter or column.</param><param name="scale">The scale of the parameter or column.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, precision, scale, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9072. <format type="text/markdown"><![CDATA[
  9073. ## Remarks
  9074. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9075. ]]></format>
  9076. </remarks>
  9077. </member>
  9078. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64)">
  9079. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="maxLength">The maximum length of the specified type.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, and maximum length.</summary><remarks>
  9080. <format type="text/markdown"><![CDATA[
  9081. ## Remarks
  9082. Only the following are allowed to be passed to the constructor as `dbType`: `Binary`, `Char`, `Image`, `NChar`, `Ntext`, `NVarChar`, `Text`, `VarBinary`, `VarChar`.
  9083. Only a `maxLength` specification of <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Max%2A>, or -1 is allowed for a `dbType` of `Text`, `NText`, or `Image`.
  9084. For a `dbType` of `Varchar`, `Nvarchar`, or `VarBinary`, a length specification of <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Max%2A>, or -1, declares the metadata as varchar(max), nvarchar(max), or nvarbinary(max), respectively.
  9085. The following are the default values assigned to `dbType`, depending on the `SqlDbType` (the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A>, and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Type%2A> properties are set to `null`):
  9086. |SqlDbType|Precision|Scale|Locale|Compare options|
  9087. |---------------|---------------|-----------|------------|---------------------|
  9088. |Binary|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9089. |Char|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9090. |Image|0|0|0|None|
  9091. |NChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9092. |NText|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9093. |NVarChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9094. |Text|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9095. |VarBinary|0|0||IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9096. |VarChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9097. ## Examples
  9098. The following example creates a new <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> object by specifying the column name, a column data type of <xref:System.Data.SqlDbType>`.NVarChar`, and a maximum length of 12 characters.
  9099. [!code-csharp[SqlMetaData Samples#2](~/../sqlclient/doc/samples/SqlMetaData.cs#2)]
  9100. ]]></format>
  9101. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">A SqlDbType that is not allowed was passed to the constructor as <paramref name="dbType" />.</exception>
  9102. </member>
  9103. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9104. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="maxLength">The maximum length of the specified type.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, maximum length, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9105. <format type="text/markdown"><![CDATA[
  9106. ## Remarks
  9107. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9108. ]]></format>
  9109. </remarks>
  9110. </member>
  9111. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Byte,System.Byte,System.Int64,System.Data.SqlTypes.SqlCompareOptions,System.Type)">
  9112. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="maxLength">The maximum length of the specified type.</param><param name="precision">The precision of the parameter or column.</param><param name="scale">The scale of the parameter or column.</param><param name="locale">The locale ID of the parameter or column.</param><param name="compareOptions">The comparison rules of the parameter or column.</param><param name="userDefinedType">A <see cref="T:System.Type" /> instance that points to the UDT.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, maximum length, precision, scale, locale ID, compare options, and user-defined type (UDT).</summary><remarks>
  9113. <format type="text/markdown"><![CDATA[
  9114. ## Remarks
  9115. Only the following are allowed to be passed to the constructor as `dbType`: `BigInt`, `Bit`, `BitInt`, `DateTime`, `Decimal`, `Float`, `Image`, `Int`, `Money`, `Ntext`, `Numeric`, `Real`, `SmallDateTime`, `SmallInt`, `SmallMoney`, `Text`, `TimeStamp`, `TinyInt`, `UniqueIdentifier`, `Variant`, `Xml`.
  9116. The following are the default values assigned to `dbType`, depending on the `SqlDbType` (the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A>, and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Type%2A> properties are set to `null`):
  9117. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9118. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9119. |`BigInt`|8|19|0|0|None|
  9120. |`Bit`|1|1|0|0|None|
  9121. |`DateTime`|8|23|3|0|None|
  9122. |`Decimal`|9|18|0|0|None|
  9123. |`Float`|8|53|0|0|None|
  9124. |`Image`|Max (-1)|0|0|0|None|
  9125. |`Int`|4|10|0|0|None|
  9126. |`Money`|8|19|4|0|None|
  9127. |`Ntext`|Max (-1)|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9128. |`Real`|4|24|0|0|None|
  9129. |`Row`|\<number of columns>|0|0|0|None|
  9130. |`SmallDateTime`|4|16|0|0|None|
  9131. |`SmallInt`|2|5|0|0|None|
  9132. |`SmallMoney`|4|10|4|0|None|
  9133. |`Text`|Max (-1)|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9134. |`TimeStamp`|8|0|0|0|None|
  9135. |`TinyInt`|1|3|0|0|None|
  9136. |`UniqueIdentifier`|16|0|0|0|None|
  9137. |`UDT`|\<Max length of the type> or -1|0|0|0|None|
  9138. |`Variant`|8016|0|0|0|None|
  9139. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9140. ]]></format>
  9141. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">A <see langword="SqlDbType" /> that is not allowed was passed to the constructor as <paramref name="dbType" />, or <paramref name="userDefinedType" /> points to a type that does not have <see cref="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute" /> declared.</exception>
  9142. </member>
  9143. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Byte,System.Byte,System.Int64,System.Data.SqlTypes.SqlCompareOptions,System.Type,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9144. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="maxLength">The maximum length of the specified type.</param><param name="precision">The precision of the parameter or column.</param><param name="scale">The scale of the parameter or column.</param><param name="localeId">The locale ID of the parameter or column.</param><param name="compareOptions">The comparison rules of the parameter or column.</param><param name="userDefinedType">A <see cref="T:System.Type" /> instance that points to the UDT.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, maximum length, precision, scale, locale ID, compare options, and user-defined type (UDT). This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9145. <format type="text/markdown"><![CDATA[
  9146. ## Remarks
  9147. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9148. ]]></format>
  9149. </remarks>
  9150. </member>
  9151. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Int64,System.Data.SqlTypes.SqlCompareOptions)">
  9152. <param name="name">The name of the parameter or column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="maxLength">The maximum length of the specified type.</param><param name="locale">The locale ID of the parameter or column.</param><param name="compareOptions">The comparison rules of the parameter or column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, maximum length, locale, and compare options.</summary><remarks>
  9153. <format type="text/markdown"><![CDATA[
  9154. ## Remarks
  9155. Only the following are allowed to be passed to the constructor as `dbType`: `Char`, `NChar`, `Ntext`, `NVarChar`, `Text`, `VarChar`.
  9156. Only a `maxLength` specification of <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Max%2A>, or -1, is allowed for a `dbType` of `Text` or `NText`.
  9157. For a `dbType` of `Varchar` or `Nvarchar`, a length specification of <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Max%2A>, or -1, declares the metadata as varchar(max) and nvarchar(max), respectively.
  9158. The following are the default values assigned to `dbType`, depending on the `SqlDbType` (the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A>, and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Type%2A> properties are set to `null`):
  9159. |SqlDbType|Precision|Scale|
  9160. |---------------|---------------|-----------|
  9161. |`Char`|0|0|
  9162. |`NChar`|0|0|
  9163. |`NText`|0|0|
  9164. |`NVarChar`|0|0|
  9165. |`Text`|0|0|
  9166. |`VarChar`|0|0|
  9167. ]]></format>
  9168. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">A SqlDbType that is not allowed was passed to the constructor as <paramref name="dbType" />.</exception>
  9169. </member>
  9170. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Int64,System.Data.SqlTypes.SqlCompareOptions,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9171. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="maxLength">The maximum length of the specified type.</param><param name="locale">The locale ID of the parameter or column.</param><param name="compareOptions">The comparison rules of the parameter or column.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, maximum length, locale, compare options, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9172. <format type="text/markdown"><![CDATA[
  9173. ## Remarks
  9174. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9175. ]]></format>
  9176. </remarks>
  9177. </member>
  9178. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.String,System.String,System.String)">
  9179. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="database">The database name of the XML schema collection of a typed XML instance.</param><param name="owningSchema">The relational schema name of the XML schema collection of a typed XML instance.</param><param name="objectName">The name of the XML schema collection of a typed XML instance.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, database name, owning schema, and object name.</summary><remarks>
  9180. <format type="text/markdown"><![CDATA[
  9181. ## Remarks
  9182. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `Xml`.
  9183. The following are the default values assigned to `dbType`, depending on the `SqlDbType`:
  9184. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9185. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9186. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9187. ]]></format>
  9188. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />, or <paramref name="objectName" /> is <see langword="null" /> when <paramref name="database" /> and <paramref name="owningSchema" /> are non-<see langword="null" />.</exception><exception cref="T:System.ArgumentException">A SqlDbType that is not allowed was passed to the constructor as <paramref name="dbType" />.</exception>
  9189. </member>
  9190. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.String,System.String,System.String,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9191. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="database">The database name of the XML schema collection of a typed XML instance.</param><param name="owningSchema">The relational schema name of the XML schema collection of a typed XML instance.</param><param name="objectName">The name of the XML schema collection of a typed XML instance.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, database name, owning schema, object name, and default server. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9192. <format type="text/markdown"><![CDATA[
  9193. ## Remarks
  9194. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9195. ]]></format>
  9196. </remarks>
  9197. </member>
  9198. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type)">
  9199. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="userDefinedType">A <see cref="T:System.Type" /> instance that points to the UDT.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, and user-defined type (UDT).</summary><remarks>
  9200. <format type="text/markdown"><![CDATA[
  9201. ## Remarks
  9202. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `UDT`.
  9203. The following are the default values assigned to `dbType`, depending on the `SqlDbType` (the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A>, <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A>, and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Type%2A> properties are set to `null`):
  9204. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9205. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9206. |UDT|\<Max length of the type> or -1|0|0|0|None|
  9207. ]]></format>
  9208. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="name" /> is <see langword="null" />.</exception><exception cref="T:System.ArgumentException">A SqlDbType that is not allowed was passed to the constructor as <paramref name="dbType" />, or <paramref name="userDefinedType" /> points to a type that does not have <see cref="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute" /> declared.</exception>
  9209. </member>
  9210. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type,System.String)">
  9211. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="userDefinedType">A <see cref="T:System.Type" /> instance that points to the UDT.</param><param name="serverTypeName">The SQL Server type name for <paramref name="userDefinedType" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, user-defined type (UDT), and SQLServer type.</summary>
  9212. </member>
  9213. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type,System.String,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9214. <param name="name">The name of the column.</param><param name="dbType">The SQL Server type of the parameter or column.</param><param name="userDefinedType">A <see cref="T:System.Type" /> instance that points to the UDT.</param><param name="serverTypeName">The SQL Server type name for <paramref name="userDefinedType" />.</param><param name="useServerDefault">Specifies whether this column should use the default server value.</param><param name="isUniqueKey">Specifies if the column in the table-valued parameter is unique.</param><param name="columnSortOrder">Specifies the sort order for a column.</param><param name="sortOrdinal">Specifies the ordinal of the sort column.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> class with the specified column name, type, user-defined type, SQL Server type, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.</summary><remarks>
  9215. <format type="text/markdown"><![CDATA[
  9216. ## Remarks
  9217. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9218. ]]></format>
  9219. </remarks>
  9220. </member>
  9221. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.CompareOptions">
  9222. <summary>Gets the comparison rules used for the column or parameter.</summary><value>The comparison rules used for the column or parameter as a <see cref="T:System.Data.SqlTypes.SqlCompareOptions" />.</value><remarks>To be added.</remarks>
  9223. </member>
  9224. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.DbType">
  9225. <summary>Gets the data type of the column or parameter.</summary><value>The data type of the column or parameter as a <see cref="T:System.Data.DbType" />.</value><remarks>
  9226. <format type="text/markdown"><![CDATA[
  9227. ## Remarks
  9228. The default type is <xref:System.Data.DbType>.`String`.
  9229. ]]></format>
  9230. </remarks>
  9231. </member>
  9232. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.IsUniqueKey">
  9233. <summary>Indicates if the column in the table-valued parameter is unique.</summary><value>A <see langword="Boolean" /> value.</value><remarks>
  9234. <format type="text/markdown"><![CDATA[
  9235. ## Remarks
  9236. The default is `FALSE`.
  9237. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  9238. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9239. ]]></format>
  9240. </remarks>
  9241. </member>
  9242. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.LocaleId">
  9243. <summary>Gets the locale ID of the column or parameter.</summary><value>The locale ID of the column or parameter as a <see cref="T:System.Int64" />.</value><remarks>
  9244. <format type="text/markdown"><![CDATA[
  9245. ## Remarks
  9246. The default value is the current locale of the current thread for string-valued SqlDbTypes, and 0 for SqlDbTypes that do not support collation.
  9247. Returns 0 if the collation of the underlying column type is not defined.
  9248. ]]></format>
  9249. </remarks>
  9250. </member>
  9251. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Max">
  9252. <summary>Gets the length of <see langword="text" />, <see langword="ntext" />, and <see langword="image" /> data types.</summary><value>The length of <see langword="text" />, <see langword="ntext" />, and <see langword="image" /> data types.</value><remarks>
  9253. <format type="text/markdown"><![CDATA[
  9254. ## Remarks
  9255. The default value is -1.
  9256. ]]></format>
  9257. </remarks>
  9258. </member>
  9259. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.MaxLength">
  9260. <summary>Gets the maximum length of the column or parameter.</summary><value>The maximum length of the column or parameter as a <see cref="T:System.Int64" />.</value><remarks>
  9261. <format type="text/markdown"><![CDATA[
  9262. ## Remarks
  9263. The potential maximum length for values of the specified column. Returns 0 for types other than fixed and varying length character and binary types. For variable size columns or parameters declared with the `Max` constructor parameter, it returns -1.
  9264. For <xref:System.Data.DbType>.`Row` this returns the number of columns in the row metadata instance.
  9265. The default value is 0.
  9266. ]]></format>
  9267. </remarks>
  9268. </member>
  9269. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Name">
  9270. <summary>Gets the name of the column or parameter.</summary><value>The name of the column or parameter as a <see cref="T:System.String" />.</value><remarks>To be added.</remarks>
  9271. </member>
  9272. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Precision">
  9273. <summary>Gets the precision of the column or parameter.</summary><value>The precision of the column or parameter as a <see cref="T:System.Byte" />.</value><remarks>
  9274. <format type="text/markdown"><![CDATA[
  9275. ## Remarks
  9276. Returns 0 if the precision of the underlying column type is not defined.
  9277. ]]></format>
  9278. </remarks>
  9279. </member>
  9280. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Scale">
  9281. <summary>Gets the scale of the column or parameter.</summary><value>The scale of the column or parameter.</value><remarks>
  9282. <format type="text/markdown"><![CDATA[
  9283. ## Remarks
  9284. Returns 0 if the scale of the underlying column type is not defined.
  9285. ]]></format>
  9286. </remarks>
  9287. </member>
  9288. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SortOrder">
  9289. <summary>Returns the sort order for a column.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SortOrder" /> object.</value><remarks>
  9290. <format type="text/markdown"><![CDATA[
  9291. ## Remarks
  9292. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  9293. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9294. ]]></format>
  9295. </remarks>
  9296. </member>
  9297. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SortOrdinal">
  9298. <summary>Returns the ordinal of the sort column.</summary><value>The ordinal of the sort column.</value><remarks>
  9299. <format type="text/markdown"><![CDATA[
  9300. ## Remarks
  9301. The default is 1.
  9302. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  9303. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  9304. ]]></format>
  9305. </remarks>
  9306. </member>
  9307. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SqlDbType">
  9308. <summary>Gets the data type of the column or parameter.</summary><value>The data type of the column or parameter as a <see cref="T:System.Data.DbType" />.</value><remarks>
  9309. <format type="text/markdown"><![CDATA[
  9310. ## Remarks
  9311. The default value is `NVarChar`.
  9312. ]]></format>
  9313. </remarks>
  9314. </member>
  9315. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Type">
  9316. <summary>Gets the common language runtime (CLR) type of a user-defined type (UDT).</summary><value>The CLR type name of a user-defined type as a <see cref="T:System.Type" />.</value><remarks>
  9317. <format type="text/markdown"><![CDATA[
  9318. ## Remarks
  9319. The default value is `null`.
  9320. Returns `null` if <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.SqlDbType%2A> is not a UDT type. `Null` may also returned for valid UDT result sets where the assembly is not available to the application.
  9321. ]]></format>
  9322. </remarks>
  9323. </member>
  9324. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.TypeName">
  9325. <summary>Gets the three-part name of the user-defined type (UDT) or the SQL Server type represented by the instance.</summary><value>The name of the UDT or SQL Server type as a <see cref="T:System.String" />.</value><remarks>
  9326. <format type="text/markdown"><![CDATA[
  9327. ## Remarks
  9328. The default value is `null`.
  9329. ]]></format>
  9330. </remarks>
  9331. </member>
  9332. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.UseServerDefault">
  9333. <summary>Reports whether this column should use the default server value.</summary><value>A <see langword="Boolean" /> value.</value><remarks>
  9334. <format type="text/markdown"><![CDATA[
  9335. ## Remarks
  9336. The default is `FALSE`.
  9337. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  9338. ]]></format>
  9339. </remarks>
  9340. </member>
  9341. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase">
  9342. <summary>Gets the name of the database where the schema collection for this XML instance is located.</summary><value>The name of the database where the schema collection for this XML instance is located as a <see cref="T:System.String" />.</value><remarks>
  9343. <format type="text/markdown"><![CDATA[
  9344. ## Remarks
  9345. The default value is `null`.
  9346. This property may be `null` if the collection is defined within the current database. It is also `null` if there is no schema collection, in which case <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A> and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A> are also null.
  9347. ]]></format>
  9348. </remarks>
  9349. </member>
  9350. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName">
  9351. <summary>Gets the name of the schema collection for this XML instance.</summary><value>The name of the schema collection for this XML instance as a <see cref="T:System.String" />.</value><remarks>
  9352. <format type="text/markdown"><![CDATA[
  9353. ## Remarks
  9354. The default value is `null`.
  9355. This value is `null` if there is no associated schema collection. If the value is `null`, then <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A> and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema%2A> are also `null`.
  9356. ]]></format>
  9357. </remarks>
  9358. </member>
  9359. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema">
  9360. <summary>Gets the owning relational schema where the schema collection for this XML instance is located.</summary><value>The owning relational schema where the schema collection for this XML instance is located as a <see cref="T:System.String" />.</value><remarks>
  9361. <format type="text/markdown"><![CDATA[
  9362. ## Remarks
  9363. The default value is `null`.
  9364. This value may be `null` if the collection is defined within the current database and default schema. It is also null if there is no schema collection, in which case <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase%2A> and <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName%2A> are also `null`.
  9365. ]]></format>
  9366. </remarks>
  9367. </member>
  9368. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Boolean)">
  9369. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Boolean" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Boolean" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9370. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9371. </member>
  9372. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Byte)">
  9373. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Byte" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Byte" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9374. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9375. </member>
  9376. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Byte[])">
  9377. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified array of <see cref="T:System.Byte" /> values against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as an array of <see cref="T:System.Byte" /> values.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9378. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9379. </member>
  9380. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Char)">
  9381. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Char" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Char" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9382. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9383. </member>
  9384. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Char[])">
  9385. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified array of <see cref="T:System.Char" /> values against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as an array <see cref="T:System.Char" /> values.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9386. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9387. </member>
  9388. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBinary)">
  9389. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlBinary" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlBinary" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9390. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9391. </member>
  9392. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBoolean)">
  9393. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlBoolean" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlBoolean" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9394. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9395. </member>
  9396. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlByte)">
  9397. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlByte" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlByte" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9398. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9399. </member>
  9400. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBytes)">
  9401. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlBytes" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlBytes" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9402. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9403. </member>
  9404. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlChars)">
  9405. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlChars" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlChars" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9406. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9407. </member>
  9408. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDateTime)">
  9409. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlDateTime" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlDateTime" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9410. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9411. </member>
  9412. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDecimal)">
  9413. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlDecimal" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlDecimal" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9414. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9415. </member>
  9416. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDouble)">
  9417. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlDouble" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlDouble" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9418. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9419. </member>
  9420. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlGuid)">
  9421. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlGuid" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlGuid" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9422. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9423. </member>
  9424. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt16)">
  9425. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlInt16" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlInt16" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9426. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9427. </member>
  9428. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt32)">
  9429. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlInt32" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlInt32" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9430. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9431. </member>
  9432. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt64)">
  9433. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlInt64" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlInt64" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9434. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9435. </member>
  9436. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlMoney)">
  9437. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlMoney" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlMoney" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9438. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9439. </member>
  9440. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlSingle)">
  9441. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlSingle" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlSingle" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9442. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9443. </member>
  9444. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlString)">
  9445. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlString" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlString" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9446. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9447. </member>
  9448. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlXml)">
  9449. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Data.SqlTypes.SqlXml" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Data.SqlTypes.SqlXml" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9450. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9451. </member>
  9452. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.DateTime)">
  9453. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.DateTime" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.DateTime" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9454. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9455. </member>
  9456. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.DateTimeOffset)">
  9457. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.DateTimeOffset" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as an array of <see cref="T:System.DateTimeOffset" /> values.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9458. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9459. </member>
  9460. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Decimal)">
  9461. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Decimal" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Decimal" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9462. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9463. </member>
  9464. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Double)">
  9465. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Double" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Double" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9466. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9467. </member>
  9468. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Guid)">
  9469. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Guid" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Guid" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9470. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9471. </member>
  9472. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int16)">
  9473. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Int16" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Int16" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9474. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9475. </member>
  9476. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int32)">
  9477. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Int32" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Int32" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9478. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9479. </member>
  9480. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int64)">
  9481. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Int64" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Int64" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9482. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9483. </member>
  9484. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Object)">
  9485. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Object" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Object" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9486. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9487. </member>
  9488. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Single)">
  9489. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.Single" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.Single" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9490. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9491. </member>
  9492. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.String)">
  9493. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.String" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as a <see cref="T:System.String" />.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9494. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9495. </member>
  9496. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.TimeSpan)">
  9497. <param name="value">The value to validate against the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Validates the specified <see cref="T:System.TimeSpan" /> value against the metadata, and adjusts the value if necessary.</summary><returns>The adjusted value as an array of <see cref="T:System.TimeSpan" /> values.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">
  9498. <paramref name="value" /> does not match the <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> type, or <paramref name="value" /> could not be adjusted.</exception>
  9499. </member>
  9500. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.InferFromValue(System.Object,System.String)">
  9501. <param name="value">The object used from which the metadata is inferred.</param><param name="name">The name assigned to the returned <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</param><summary>Infers the metadata from the specified object and returns it as a <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</summary><returns>The inferred metadata as a <see cref="T:Microsoft.Data.SqlClient.Server.SqlMetaData" /> instance.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentNullException">The <paramref name="value" /> is <see langword="null" />.</exception>
  9502. </member>
  9503. <member name="T:Microsoft.Data.SqlClient.Server.SqlMethodAttribute">
  9504. <summary>Indicates the determinism and data access properties of a method or property on a user-defined type (UDT). The properties on the attribute reflect the physical characteristics that are used when the type is registered with SQL Server.</summary><remarks>
  9505. <format type="text/markdown"><![CDATA[
  9506. ## Remarks
  9507. For a property, the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> should be used on the setter or the getter directly.
  9508. <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> inherits from a <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute>, so <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> inherits the `FillRowMethodName` and `TableDefinition` fields from <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute>. Note that it is not possible to write a table-valued method, although the names of these fields might suggest that it is possible.
  9509. ## Examples
  9510. The following example shows a UDT method that is attributed to indicate that the method will not be invoked on null instances of the type, that the method will not change the state of the type, and that the method will not be called when `null` parameters are supplied to the method invocation.
  9511. [!code-csharp[SqlMethod Sample#1](~/../sqlclient/doc/samples/SqlMethod.cs#1)]
  9512. ]]></format>
  9513. </remarks>
  9514. </member>
  9515. <member name="M:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.#ctor">
  9516. <summary>An attribute on a user-defined type (UDT), used to indicate the determinism and data access properties of a method or a property on a UDT.</summary><remarks>To be added.</remarks>
  9517. </member>
  9518. <member name="P:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.OnNullCall">
  9519. <summary>Indicates whether the method on a user-defined type (UDT) is called when <see langword="null" /> input arguments are specified in the method invocation.</summary><value> <see langword="true" /> if the method is called when <see langword="null" /> input arguments are specified in the method invocation; <see langword="false" /> if the method returns a <see langword="null" /> value when any of its input parameters are <see langword="null" />. If the method cannot be invoked (because of an attribute on the method), the SQL Server <see langword="DbNull" /> is returned.</value><remarks>
  9520. <format type="text/markdown"><![CDATA[
  9521. ## Remarks
  9522. The default value of the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.OnNullCall%2A> property is `true`.
  9523. ]]></format>
  9524. </remarks>
  9525. </member>
  9526. <member name="P:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator">
  9527. <summary>Indicates whether a method on a user-defined type (UDT) is a mutator.</summary><value> <see langword="true" /> if the method is a mutator; otherwise <see langword="false" />.</value><remarks>
  9528. <format type="text/markdown"><![CDATA[
  9529. ## Remarks
  9530. If the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> property is set to `true` and the return type of the method is `void`, SQL Server marks the method as a mutator. A mutator method is one that causes a state change in the UDT instance. Mutator methods can be called in assignment statements or data modification statements, but cannot be used in queries. If a method is marked as a mutator but does not return void, then CREATE TYPE does not fail with an error. Even though a returned value other than `void` does not raise an error, the returned value is not accessible and cannot be used.
  9531. The default value of the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> property is `false`.
  9532. A property can be a mutator if <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> is used on the setter and <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> is set to `true`. However, a property setter is implicitly treated as a mutator, so it is not necessary to set the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> property of the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> to `true`.
  9533. ]]></format>
  9534. </remarks>
  9535. </member>
  9536. <member name="P:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.InvokeIfReceiverIsNull">
  9537. <summary>Indicates whether SQL Server should invoke the method on null instances.</summary><value> <see langword="true" /> if SQL Server should invoke the method on null instances; otherwise, <see langword="false" />. If the method cannot be invoked (because of an attribute on the method), the SQL Server <see langword="DbNull" /> is returned.</value><remarks>
  9538. <format type="text/markdown"><![CDATA[
  9539. ## Remarks
  9540. The default value of the `InvokeIfReceiverIsNull` property is `false`. That is, the method is not invoked on a null instance. If `InvokeIfReceiverIsNull` is `true`, the return value of the method depends upon its type. If the return type of the method is nullable, the distinguished null value for the type is returned. If the return type is non-nullable, the default CLR value for the type is returned. The default value for reference types is `null`. The default value for a value type is the value that is returned when you call the parameterless constructor for the type.
  9541. ]]></format>
  9542. </remarks>
  9543. </member>
  9544. <member name="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute">
  9545. <summary>Indicates that the type should be registered as a user-defined aggregate. The properties on the attribute reflect the physical attributes used when the type is registered with SQL Server. This class cannot be inherited.</summary><remarks>
  9546. <format type="text/markdown"><![CDATA[
  9547. ## Remarks
  9548. SQL Server creates a user-defined aggregate that is bound to the class definition that has the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute> custom attribute. Every user-defined aggregate must be annotated with this attribute.
  9549. See "CLR User-Defined Aggregates" in SQL Server 2005 Books Online for more information on user-defined aggregates and examples.
  9550. ## Examples
  9551. The following example shows the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute> attribute for a user-defined aggregate. The aggregate uses custom serialization, has a maximum size of 8000 bytes when serialized, and is invariant to nulls, duplicates, and order.
  9552. [!code-csharp[SqlUserDefinedAggregate Sample#1](~/../sqlclient/doc/samples/SqlUserDefinedAggregate.cs#1)]
  9553. ]]></format>
  9554. </remarks>
  9555. </member>
  9556. <member name="F:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSizeValue">
  9557. <summary>The maximum size, in bytes, required to store the state of this aggregate instance during computation.</summary><remarks>
  9558. <format type="text/markdown"><![CDATA[
  9559. ## Remarks
  9560. An <xref:System.Int32> value representing the maximum size of the aggregate instance.
  9561. ]]></format>
  9562. </remarks>
  9563. </member>
  9564. <member name="M:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.#ctor(Microsoft.Data.SqlClient.Server.Format)">
  9565. <param name="format">One of the <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> values representing the serialization format of the aggregate.</param><summary>A required attribute on a user-defined aggregate, used to indicate that the given type is a user-defined aggregate and the storage format of the user-defined aggregate.</summary>
  9566. </member>
  9567. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize">
  9568. <summary>The maximum size, in bytes, of the aggregate instance.</summary><value>An <see cref="T:System.Int32" /> value representing the maximum size of the aggregate instance.</value><remarks>
  9569. <format type="text/markdown"><![CDATA[
  9570. ## Remarks
  9571. This property does not have to be specified for Native format serialization.
  9572. You must specify the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize%2A> property with the UserDefined serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9573. The maximum allowed value for this property is specified by the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSizeValue> field.
  9574. The maximum size allowed is 2 gigabytes (GB). You can specify a number from 1 to 8000 bytes, or -1 to represent a value larger than 8000 bytes, up to 2 gigabytes.
  9575. For an aggregate with user-defined serialization specified, <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize%2A> refers to the total size of the serialized data. Consider an aggregate serializing a string of 10 characters (<xref:System.Char>). When the string is serialized using a <xref:System.IO.BinaryWriter>, the total size of the serialized string is 22 bytes: 2 bytes per Unicode UTF-16 character, multiplied by the maximum number of characters, plus 2 control bytes of overhead incurred from serializing a binary stream. So, when determining the value of <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize%2A>, the total size of the serialized data must be considered: the size of the data serialized in binary form plus the overhead incurred by serialization.
  9576. ]]></format>
  9577. </remarks>
  9578. </member>
  9579. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsInvariantToDuplicates">
  9580. <summary>Indicates whether the aggregate is invariant to duplicates.</summary><value> <see langword="true" /> if the aggregate is invariant to duplicates; otherwise <see langword="false" />.</value><remarks>
  9581. <format type="text/markdown"><![CDATA[
  9582. ## Remarks
  9583. Used by the query processor, this property is `true` if the aggregate is invariant to duplicates. That is, the aggregate of S, {X} is the same as aggregate of S when X is already in S. For example, aggregate functions such as MIN and MAX satisfy this property, while SUM does not.
  9584. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects both the plan selected and the results returned by the query.
  9585. ]]></format>
  9586. </remarks>
  9587. </member>
  9588. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsInvariantToNulls">
  9589. <summary>Indicates whether the aggregate is invariant to nulls.</summary><value> <see langword="true" /> if the aggregate is invariant to nulls; otherwise <see langword="false" />.</value><remarks>
  9590. <format type="text/markdown"><![CDATA[
  9591. ## Remarks
  9592. Used by the query processor, this property is `true` if the aggregate is invariant to nulls. That is, the aggregate of S, {NULL} is the same as aggregate of S. For example, aggregate functions such as MIN and MAX satisfy this property, while COUNT(*) does not.
  9593. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects the plan selected and the results returned by the query.
  9594. ]]></format>
  9595. </remarks>
  9596. </member>
  9597. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsInvariantToOrder">
  9598. <summary>Indicates whether the aggregate is invariant to order.</summary><value> <see langword="true" /> if the aggregate is invariant to order; otherwise <see langword="false" />.</value><remarks>
  9599. <format type="text/markdown"><![CDATA[
  9600. ## Remarks
  9601. Reserved for future use. This property is not currently used by the query processor: order is currently not guaranteed.
  9602. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects the plan selected and the results returned by the query.
  9603. The default value for this property is `false`.
  9604. ]]></format>
  9605. </remarks>
  9606. </member>
  9607. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsNullIfEmpty">
  9608. <summary>Indicates whether the aggregate returns <see langword="null" /> if no values have been accumulated.</summary><value> <see langword="true" /> if the aggregate returns <see langword="null" /> if no values have been accumulated; otherwise <see langword="false" />.</value><remarks>
  9609. <format type="text/markdown"><![CDATA[
  9610. ## Remarks
  9611. Used by the query processor, this property is `true` if the aggregate returns `null` if no values have been accumulated.
  9612. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects the plan selected and the results returned by the query.
  9613. ]]></format>
  9614. </remarks>
  9615. </member>
  9616. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.Format">
  9617. <summary>The serialization format as a <see cref="T:Microsoft.Data.SqlClient.Server.Format" />.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> representing the serialization format.</value><remarks>
  9618. <format type="text/markdown"><![CDATA[
  9619. ## Examples
  9620. [!code-csharp[SqlUserDefinedAggregate1#6](~/../sqlclient/doc/samples/SqlUserDefinedAggregate1.cs#6)]
  9621. ]]></format>
  9622. </remarks>
  9623. </member>
  9624. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.Name">
  9625. <summary>The name of the aggregate.</summary><value>A <see cref="T:System.String" /> value representing the name of the aggregate.</value>
  9626. </member>
  9627. <member name="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute">
  9628. <summary>Used to mark a type definition in an assembly as a user-defined type (UDT) in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server. This class cannot be inherited.</summary><remarks>
  9629. <format type="text/markdown"><![CDATA[
  9630. ## Remarks
  9631. SQL Server creates a user-defined type that is bound to the type definition that has the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute> custom attribute. Every UDT must be annotated with this attribute. See [CLR User-Defined Types](https://go.microsoft.com/fwlink/?LinkId=128028) for more information about UDTs, including an example of a UDT.
  9632. ## Examples
  9633. The following example shows the `UserDefinedType` attribute of the Point UDT. The UDT is byte-ordered, is named "Point", has a validation method named "ValidatePoint", and uses the native serialization format.
  9634. [!code-csharp[SqlUserDefinedType Example#1](~/../sqlclient/doc/samples/SqlUserDefinedType.cs#1)]
  9635. ]]></format>
  9636. </remarks>
  9637. </member>
  9638. <member name="M:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.#ctor(Microsoft.Data.SqlClient.Server.Format)">
  9639. <param name="format">One of the <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> values representing the serialization format of the type.</param><summary>A required attribute on a user-defined type (UDT), used to confirm that the given type is a UDT and to indicate the storage format of the UDT.</summary><remarks>
  9640. <format type="text/markdown"><![CDATA[
  9641. ## Remarks
  9642. The following example specifies that the `Format` of the user-defined type is `SerializedDataWithMetadata` and the `MaxByteSize` is 8000 bytes.
  9643. ## Examples
  9644. [!code-csharp[SqlUserDefinedType1#12](~/../sqlclient/doc/samples/SqlUserDefinedType1.cs#12)]
  9645. ]]></format>
  9646. </remarks>
  9647. </member>
  9648. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize">
  9649. <summary>The maximum size of the instance, in bytes.</summary><value>An <see cref="T:System.Int32" /> value representing the maximum size of the instance.</value><remarks>
  9650. <format type="text/markdown"><![CDATA[
  9651. ## Remarks
  9652. You must specify the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> property with the `UserDefined` serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9653. When connecting to SQL Server 2005 or earlier, <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> must be between 1 and 8000.
  9654. When connecting to SQL Server 2008 or later, set <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> between 1 and 8000, for a type whose instances are always 8,000 bytes or less. For types that can have instances larger than 8000, specify -1.
  9655. For a UDT with user-defined serialization specified, <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> refers to the total size of the UDT in its serialized form as defined by the user. Consider a UDT with a property of a string of 10 characters (<xref:System.Char>). When the UDT is serialized using a <xref:System.IO.BinaryWriter>, the total size of the serialized string is 22 bytes: 2 bytes per Unicode UTF-16 character, multiplied by the maximum number of characters, plus 2 control bytes of overhead incurred from serializing a binary stream. So, when determining the value of <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A>, the total size of the serialized UDT must be considered: the size of the data serialized in binary form plus the overhead incurred by serialization.
  9656. This property should not be used with `Native` serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9657. ]]></format>
  9658. </remarks>
  9659. </member>
  9660. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsFixedLength">
  9661. <summary>Indicates whether all instances of this user-defined type are the same length.</summary><value>
  9662. <see langword="true" /> if all instances of this type are the same length; otherwise <see langword="false" />.
  9663. </value><remarks>
  9664. <format type="text/markdown"><![CDATA[
  9665. ## Remarks
  9666. If set to `true`, all instances of UDTs corresponding to this common language runtime (CLR) type must have a length in bytes exactly equal to <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A>. This attribute is only relevant for UDTs with `UserDefined` serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9667. ]]></format>
  9668. </remarks>
  9669. </member>
  9670. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered">
  9671. <summary>Indicates whether the user-defined type is byte ordered.</summary><value>
  9672. <see langword="true" /> if the user-defined type is byte ordered; otherwise <see langword="false" /> .</value><remarks>
  9673. <format type="text/markdown"><![CDATA[
  9674. ## Remarks
  9675. When set to `true`, the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A> property in effect guarantees that the serialized binary data can be used for semantic ordering of the information. Thus, each instance of a byte-ordered UDT object can only have one serialized representation. When a comparison operation is performed in SQL Server on the serialized bytes, its results should be the same as if the same comparison operation had taken place in managed code.
  9676. The following features are supported when <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A> is set to `true`:
  9677. - The ability to create indexes on columns of this type.
  9678. - The ability to create primary and foreign keys as well as CHECK and UNIQUE constraints on columns of this type.
  9679. - The ability to use Transact-SQL ORDER BY, GROUP BY, and PARTITION BY clauses. In these cases, the binary representation of the type is used to determine the order.
  9680. - The ability to use comparison operators in Transact-SQL statements.
  9681. - The ability to persist computed columns of this type.
  9682. Note that both the `Native` and `UserDefined` serialization formats support the following comparison operators when <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A> is set to `true`:
  9683. - Equal to (=)
  9684. - Not equal to (!=)
  9685. - Greater than (>)
  9686. - Less than (\<)
  9687. - Greater than or equal to (>=)
  9688. - Less than or equal to (<=)
  9689. ]]></format>
  9690. </remarks>
  9691. </member>
  9692. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.Format">
  9693. <summary>The serialization format as a <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> .</summary><value>A <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> value representing the serialization format.</value>
  9694. </member>
  9695. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.ValidationMethodName">
  9696. <summary>The name of the method used to validate instances of the user-defined type.</summary><value>A <see cref="T:System.String" /> representing the name of the method used to validate instances of the user-defined type.</value><remarks>
  9697. <format type="text/markdown"><![CDATA[
  9698. ## Remarks
  9699. The method specified by this attribute validates instances of the UDT when the UDT has been deserialized from a binary value that is not trusted.
  9700. ]]></format>
  9701. </remarks>
  9702. </member>
  9703. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.Name">
  9704. <summary>The SQL Server name of the user-defined type.</summary><value>A <see cref="T:System.String" /> value representing the SQL Server name of the user-defined type.</value><remarks>
  9705. <format type="text/markdown"><![CDATA[
  9706. ## Remarks
  9707. The <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.Name%2A> property is not used within SQL Server, but is used by the Microsoft Visual Studio .NET Integrated Development Environment (IDE).
  9708. ]]></format>
  9709. </remarks>
  9710. </member>
  9711. <member name="T:Microsoft.Data.SqlClient.Server.SystemDataAccessKind">
  9712. <summary>Describes the type of access to system data for a user-defined method or function.</summary><remarks>
  9713. <format type="text/markdown"><![CDATA[
  9714. ## Remarks
  9715. Describes the type of access to system data for a user-defined method or function.
  9716. This enumeration is used in <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> and <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute> to indicate what type of access to system data the method or function has.
  9717. Note that methods and functions are not allowed to make changes to the database, so the options for this enumeration are `None` (meaning no data-access performed by the method or function) and `Read` (meaning that the method or function performs read-only data-access operations, such as executing SELECT statements).
  9718. ]]></format>
  9719. </remarks>
  9720. </member>
  9721. <member name="F:Microsoft.Data.SqlClient.Server.SystemDataAccessKind.None">
  9722. <summary>The method or function does not access system data.</summary>
  9723. </member>
  9724. <member name="F:Microsoft.Data.SqlClient.Server.SystemDataAccessKind.Read">
  9725. <summary>The method or function reads system data.</summary>
  9726. </member>
  9727. <member name="T:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity">
  9728. <summary>Represents the Data Classification Sensitivity Information for columns as configured in Database.</summary><remarks>To be added.</remarks>
  9729. </member>
  9730. <member name="M:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity.#ctor(System.Collections.Generic.IList{Microsoft.Data.SqlClient.DataClassification.SensitivityProperty})">
  9731. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity" /> class.</summary>
  9732. </member>
  9733. <member name="P:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity.SensitivityProperties">
  9734. <summary>Returns the list of sensitivity properties as received from Server for this 'ColumnSensitivity' information</summary><value>List of sensitivity properties.</value><remarks>To be added.</remarks>
  9735. </member>
  9736. <member name="T:Microsoft.Data.SqlClient.DataClassification.InformationType">
  9737. <summary>Represents the Data Classification Information Types as received from SQL Server for the active 'SqlDataReader'</summary><remarks>To be added.</remarks>
  9738. </member>
  9739. <member name="M:Microsoft.Data.SqlClient.DataClassification.InformationType.#ctor(System.String,System.String)">
  9740. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.InformationType" /> class.</summary>
  9741. </member>
  9742. <member name="P:Microsoft.Data.SqlClient.DataClassification.InformationType.Id">
  9743. <summary>Gets the ID for this 'InformationType' object</summary><value>ID of InformationType.</value><remarks>To be added.</remarks>
  9744. </member>
  9745. <member name="P:Microsoft.Data.SqlClient.DataClassification.InformationType.Name">
  9746. <summary>Gets the name for this 'InformationType' object</summary><value>Name of InformationType.</value><remarks>To be added.</remarks>
  9747. </member>
  9748. <member name="T:Microsoft.Data.SqlClient.DataClassification.Label">
  9749. <summary>Represents the Data Classification Labels as received from SQL Server for the active 'SqlDataReader'</summary><remarks>To be added.</remarks>
  9750. </member>
  9751. <member name="M:Microsoft.Data.SqlClient.DataClassification.Label.#ctor(System.String,System.String)">
  9752. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.Label" /> class.</summary>
  9753. </member>
  9754. <member name="P:Microsoft.Data.SqlClient.DataClassification.Label.Id">
  9755. <summary>Gets the ID for this 'Label' object</summary><value>ID of label.</value><remarks>To be added.</remarks>
  9756. </member>
  9757. <member name="P:Microsoft.Data.SqlClient.DataClassification.Label.Name">
  9758. <summary>Gets the name for this 'Label' object</summary><value>Name of label.</value><remarks>To be added.</remarks>
  9759. </member>
  9760. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification">
  9761. <summary>Provides the functionlity to retrieve Sensitivity Classification data as received from SQL Server for the active 'SqlDataReader'</summary><remarks>To be added.</remarks>
  9762. </member>
  9763. <member name="M:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.#ctor(System.Collections.Generic.IList{Microsoft.Data.SqlClient.DataClassification.Label},System.Collections.Generic.IList{Microsoft.Data.SqlClient.DataClassification.InformationType},System.Collections.Generic.IList{Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity})">
  9764. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification" />
  9765. class.</summary>
  9766. </member>
  9767. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.ColumnSensitivities">
  9768. <summary>Returns the column sensitivity for this 'SensitivityClassification' Object</summary><value>List of column sensitivities.</value><remarks>To be added.</remarks>
  9769. </member>
  9770. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.InformationTypes">
  9771. <summary>Returns the information types collection for this 'SensitivityClassification' Object</summary><value>List of information types.</value><remarks>To be added.</remarks>
  9772. </member>
  9773. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.Labels">
  9774. <summary>Returns the labels collection for this 'SensitivityClassification' Object</summary><value>List of labels.</value><remarks>To be added.</remarks>
  9775. </member>
  9776. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty">
  9777. <summary>Represents the Data Classification Sensitivity Information for columns as configured in Database.</summary><remarks>To be added.</remarks>
  9778. </member>
  9779. <member name="M:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.#ctor(Microsoft.Data.SqlClient.DataClassification.Label,Microsoft.Data.SqlClient.DataClassification.InformationType)">
  9780. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty" /> class.</summary>
  9781. </member>
  9782. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.InformationType">
  9783. <summary>Returns the information type for this 'SensitivityProperty' Object</summary><value>Information type for this SensitivityProperty.</value><remarks>To be added.</remarks>
  9784. </member>
  9785. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.Label">
  9786. <summary>Returns the label for this 'SensitivityProperty' Object</summary><value>Label for this SensitivityProperty.</value><remarks>To be added.</remarks>
  9787. </member>
  9788. <member name="T:Microsoft.Data.SqlTypes.SqlFileStream">
  9789. <summary>Exposes SQL Server data that is stored with the FILESTREAM column attribute as a sequence of bytes.</summary><remarks>
  9790. <format type="text/markdown"><![CDATA[
  9791. ## Remarks
  9792. The <xref:Microsoft.Data.SqlTypes.SqlFileStream> class is used to work with `varbinary(max)` data stored with the FILESTREAM attribute in a SQL Server 2008 database. You must install the .NET Framework 3.5 SP1 (or later) to use <xref:Microsoft.Data.SqlTypes.SqlFileStream> to work with FILESTREAM data.
  9793. Specifying the FILESTREAM attribute on a `varbinary(max)` column causes SQL Server to store the data in the local NTFS file system instead of in the database file. Transact-SQL statements provide data manipulation capabilities within the server, and Win32 file system interfaces provide streaming access to the data.
  9794. > [!NOTE]
  9795. > Individual files stored in a FILESTREAM column cannot be opened directly from the NTFS file system. Streaming FILESTREAM data works only in the context of a SQL Server transaction.
  9796. The <xref:Microsoft.Data.SqlTypes.SqlFileStream> class is derived from the <xref:System.IO.Stream> class, which represents an abstraction of a sequence of bytes from some arbitrary data source such as a file or a block of memory. You can read from a FILESTREAM by transferring data from a stream into a data structure such as an array of bytes. You can write to a FILESTREAM by transferring the data from a data structure into a stream. You can also seek within the stream, which allows you to query and modify data at the current position within the stream.
  9797. For conceptual documentation and code examples, see [FILESTREAM Data](~/docs/framework/data/adonet/sql/filestream-data.md).
  9798. For documentation about setting up and configuring FILESTREAM data on SQL Server, see [Designing and Implementing FILESTREAM Storage](https://go.microsoft.com/fwlink/?LinkId=121499) in SQL Server 2008 Books Online.
  9799. ]]></format>
  9800. </remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related><related type="Article" href="https://msdn.microsoft.com/library/fafdc31a-f435-4cd3-883f-1dfadd971277">SQL Server Data Type Mappings (ADO.NET)</related><related type="Article" href="https://msdn.microsoft.com/library/e00827b3-7511-4b2d-91d7-851ca86cc6b5">SQL Server Binary and Large-Value Data (ADO.NET)</related>
  9801. </member>
  9802. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.#ctor(System.String,System.Byte[],System.IO.FileAccess)">
  9803. <param name="path">The logical path to the file. The path can be retrieved by using the Transact-SQL Pathname function on the underlying FILESTREAM column in the table.</param><param name="transactionContext">The transaction context for the <see langword="SqlFileStream" /> object. Applications should return the byte array returned by calling the GET_FILESTREAM_TRANSACTION_CONTEXT method.</param><param name="access">The access mode to use when opening the file. Supported <see cref="T:System.IO.FileAccess" /> enumeration values are <see cref="F:System.IO.FileAccess.Read" />, <see cref="F:System.IO.FileAccess.Write" />, and <see cref="F:System.IO.FileAccess.ReadWrite" />.
  9804. When using <see langword="FileAccess.Read" />, the <see langword="SqlFileStream" /> object can be used to read all of the existing data.
  9805. When using <see langword="FileAccess.Write" />, <see langword="SqlFileStream" /> points to a zero byte file. Existing data will be overwritten when the object is closed and the transaction is committed.
  9806. When using <see langword="FileAccess.ReadWrite" />, the <see langword="SqlFileStream" /> points to a file which has all the existing data in it. The handle is positioned at the beginning of the file. You can use one of the <see langword="System.IO" /><see langword="Seek" /> methods to move the handle position within the file to write or append new data.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" /> class.</summary><remarks>
  9807. <format type="text/markdown"><![CDATA[
  9808. ## Remarks
  9809. The following table lists the code access security (CAS) permissions that all callers in the stack must have to use the `SqlFileStream` constructors.
  9810. |File access|Permission|
  9811. |-----------------|----------------|
  9812. |Read|<xref:System.Security.Permissions.FileIOPermissionAccess.Read>|
  9813. |Write|<xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  9814. |ReadWrite|<xref:System.Security.Permissions.FileIOPermissionAccess.Read> and <xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  9815. For more information about CAS, see [Code Access Security and ADO.NET](~/docs/framework/data/adonet/code-access-security.md).
  9816. If an exception is thrown, any open transactions should be rolled back. Otherwise, data loss can occur.
  9817. ]]></format>
  9818. </remarks><exception cref="T:System.ArgumentNullException">
  9819. <paramref name="path" /> is a null reference, or <paramref name="transactionContext" /> is null.</exception><exception cref="T:System.ArgumentOutOfRangeException">
  9820. <paramref name="path" /> is an empty string (""), contains only white space, or contains one or more invalid characters.
  9821. <paramref name="path" /> begins with "\\\\.\\", for example "\\\\.\PHYSICALDRIVE0 ".
  9822. The handle returned by the call to NTCreateFile is not of type FILE_TYPE_DISK.
  9823. <paramref name="path" /> contains an unsupported value.</exception><exception cref="T:System.IO.FileNotFoundException">The file cannot be found.</exception><exception cref="T:System.IO.IOException">An I/O error occurred.</exception><exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception><exception cref="T:System.IO.DirectoryNotFoundException">The specified <paramref name="path" /> is invalid, such as being on an unmapped drive.</exception><exception cref="T:System.UnauthorizedAccessException">The access requested is not permitted by the operating system for the specified path. This occurs when Write or ReadWrite access is specified, and the file or directory is set for read-only access.</exception><exception cref="T:System.InvalidOperationException">NtCreateFile fails with error code set to ERROR_SHARING_VIOLATION.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9824. </member>
  9825. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.#ctor(System.String,System.Byte[],System.IO.FileAccess,System.IO.FileOptions,System.Int64)">
  9826. <param name="path">The logical path to the file. The path can be retrieved by using the Transact-SQL Pathname function on the underlying FILESTREAM column in the table.</param><param name="transactionContext">The transaction context for the <see langword="SqlFileStream" /> object. When set to null, an implicit transaction will be used for the <see langword="SqlFileStream" /> object. Applications should return the byte array returned by calling the GET_FILESTREAM_TRANSACTION_CONTEXT method.</param><param name="access">The access mode to use when opening the file. Supported <see cref="T:System.IO.FileAccess" /> enumeration values are <see cref="F:System.IO.FileAccess.Read" />, <see cref="F:System.IO.FileAccess.Write" />, and <see cref="F:System.IO.FileAccess.ReadWrite" />.
  9827. When using <see langword="FileAccess.Read" />, the <see langword="SqlFileStream" /> object can be used to read all of the existing data.
  9828. When using <see langword="FileAccess.Write" />, <see langword="SqlFileStream" /> points to a zero byte file. Existing data will be overwritten when the object is closed and the transaction is committed.
  9829. When using <see langword="FileAccess.ReadWrite" />, the <see langword="SqlFileStream" /> points to a file which has all the existing data in it. The handle is positioned at the beginning of the file. You can use one of the <see langword="System.IO" /><see langword="Seek" /> methods to move the handle position within the file to write or append new data.</param><param name="options">Specifies the option to use while opening the file. Supported <see cref="T:System.IO.FileOptions" /> values are <see cref="F:System.IO.FileOptions.Asynchronous" />, <see cref="F:System.IO.FileOptions.WriteThrough" />, <see cref="F:System.IO.FileOptions.SequentialScan" />, and <see cref="F:System.IO.FileOptions.RandomAccess" />.</param><param name="allocationSize">The allocation size to use while creating a file. If set to 0, the default value is used.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" /> class.</summary><remarks>
  9830. <format type="text/markdown"><![CDATA[
  9831. ## Remarks
  9832. The following table lists the code access security (CAS) permissions that all callers in the stack must have to use the `SqlFileStream` constructors.
  9833. |File access|Permission|
  9834. |-----------------|----------------|
  9835. |Read|<xref:System.Security.Permissions.FileIOPermissionAccess.Read>|
  9836. |Write|<xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  9837. |ReadWrite|<xref:System.Security.Permissions.FileIOPermissionAccess.Read> and <xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  9838. For more information about CAS, see [Code Access Security and ADO.NET](~/docs/framework/data/adonet/code-access-security.md).
  9839. If an exception is thrown, any open transactions should be rolled back. Otherwise, data loss can occur.
  9840. ]]></format>
  9841. </remarks><exception cref="T:System.ArgumentNullException">
  9842. <paramref name="path" /> is a null reference, or <paramref name="transactionContext" /> is null.</exception><exception cref="T:System.ArgumentOutOfRangeException">
  9843. <paramref name="path" /> is an empty string (""), contains only white space, or contains one or more invalid characters.
  9844. <paramref name="path" /> begins with "\\\\.\\", for example "\\\\.\PHYSICALDRIVE0 "
  9845. The handle returned by call to NTCreateFile is not of type FILE_TYPE_DISK.
  9846. <paramref name="options" /> contains an unsupported value.</exception><exception cref="T:System.IO.FileNotFoundException">The file cannot be found.</exception><exception cref="T:System.IO.IOException">An I/O error occurred.</exception><exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception><exception cref="T:System.IO.DirectoryNotFoundException">The specified <paramref name="path" /> is invalid, such as being on an unmapped drive.</exception><exception cref="T:System.UnauthorizedAccessException">The access requested is not permitted by the operating system for the specified path. This occurs when Write or ReadWrite access is specified, and the file or directory is set for read-only access.</exception><exception cref="T:System.InvalidOperationException">NtCreateFile fails with error code set to ERROR_SHARING_VIOLATION.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9847. </member>
  9848. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.Name">
  9849. <summary>Gets the logical path of the <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" /> passed to the constructor.</summary><value>A string value indicating the name of the <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" />.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9850. </member>
  9851. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.TransactionContext">
  9852. <summary>Gets or sets the transaction context for this <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" /> object.</summary><value>The <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream.TransactionContext" /> array that was passed to the constructor for this <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" /> object.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9853. </member>
  9854. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanRead">
  9855. <summary>Gets a value indicating whether the current stream supports reading.</summary><value>
  9856. <see langword="true" /> if the current stream supports reading; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9857. </member>
  9858. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanSeek">
  9859. <summary>Gets a value indicating whether the current stream supports seeking.</summary><value>
  9860. <see langword="true" /> if the current stream supports seeking; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9861. </member>
  9862. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanTimeout">
  9863. <summary>Gets a value indicating whether the current stream can time out.</summary><value>
  9864. <see langword="true" /> if the current stream can time out; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  9865. </member>
  9866. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite">
  9867. <summary>Gets a value indicating whether the current stream supports writing.</summary><value>
  9868. <see langword="true" /> if the current stream supports writing; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9869. </member>
  9870. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.Length">
  9871. <summary>Gets a value indicating the length of the current stream in bytes.</summary><value>An <see cref="T:System.Int64" /> indicating the length of the current stream in bytes.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9872. </member>
  9873. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.Position">
  9874. <summary>Gets or sets the position within the current stream.</summary><value>The current position within the <see cref="T:Microsoft.Data.SqlTypes.SqlFileStream" />.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9875. </member>
  9876. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.ReadTimeout">
  9877. <summary>Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.</summary><value>A value, in milliseconds, that determines how long the stream will attempt to read before timing out.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9878. </member>
  9879. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.WriteTimeout">
  9880. <summary>Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.</summary><value>A value, in milliseconds, that determines how long the stream will attempt to write before timing out.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9881. </member>
  9882. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Flush">
  9883. <summary>Clears all buffers for this stream and causes any buffered data to be written to the underlying device.</summary><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9884. </member>
  9885. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)">
  9886. <param name="buffer">The buffer to read the data into.</param><param name="offset">The byte offset in <paramref name="buffer" /> at which to begin writing data read from the stream.</param><param name="count">The maximum number of bytes to read.</param><param name="callback">An optional asynchronous callback, to be called when the read is complete.</param><param name="state">A user-provided object that distinguishes this particular asynchronous read request from other requests</param><summary>Begins an asynchronous read operation.</summary><returns>An <see cref="T:System.IAsyncResult" /> that represents the asynchronous read, which could still be pending.</returns><remarks>
  9887. <format type="text/markdown"><![CDATA[
  9888. ## Remarks
  9889. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports reading.
  9890. ]]></format>
  9891. </remarks><exception cref="T:System.NotSupportedException">Reading data is not supported on the stream.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9892. </member>
  9893. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.EndRead(System.IAsyncResult)">
  9894. <param name="asyncResult">The reference to the pending asynchronous request to finish.</param><summary>Waits for the pending asynchronous read to complete.</summary><returns>The number of bytes read from the stream, between zero (0) and the number of bytes you requested. Streams return zero (0) only at the end of the stream, otherwise, they should block until at least one byte is available.</returns><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">The <see cref="T:System.IAsyncResult" /> object did not come from the corresponding <see langword="BeginRead" /> method.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9895. </member>
  9896. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)">
  9897. <param name="buffer">The buffer to write data from.</param><param name="offset">The byte offset in <paramref name="buffer" /> from which to begin writing.</param><param name="count">The maximum number of bytes to write.</param><param name="callback">An optional asynchronous callback, to be called when the write is complete.</param><param name="state">A user-provided object that distinguishes this particular asynchronous write request from other requests.</param><summary>Begins an asynchronous write operation.</summary><returns>An <see cref="T:System.IAsyncResult" /> that represents the asynchronous write, which could still be pending.</returns><remarks>
  9898. <format type="text/markdown"><![CDATA[
  9899. ## Remarks
  9900. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite%2A> property to determine whether the current instance supports writing.
  9901. ]]></format>
  9902. </remarks><exception cref="T:System.NotSupportedException">Writing data is not supported on the stream.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9903. </member>
  9904. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.EndWrite(System.IAsyncResult)">
  9905. <param name="asyncResult">A reference to the outstanding asynchronous I/O request.</param><summary>Ends an asynchronous write operation.</summary><remarks>To be added.</remarks><exception cref="T:System.ArgumentException">The <see cref="T:System.IAsyncResult" /> object did not come from the corresponding <see langword="BeginWrite" /> method.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9906. </member>
  9907. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Seek(System.Int64,System.IO.SeekOrigin)">
  9908. <param name="offset">A byte offset relative to the <paramref name="origin" /> parameter</param><param name="origin">A value of type <see cref="T:System.IO.SeekOrigin" /> indicating the reference point used to obtain the new position</param><summary>Sets the position within the current stream.</summary><returns>The new position within the current stream.</returns><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9909. </member>
  9910. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.SetLength(System.Int64)">
  9911. <param name="value">The desired length of the current stream in bytes.</param><summary>Sets the length of the current stream.</summary><remarks>
  9912. <format type="text/markdown"><![CDATA[
  9913. ## Remarks
  9914. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports reading.
  9915. ]]></format>
  9916. </remarks><exception cref="T:System.NotSupportedException">The object does not support reading of data.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9917. </member>
  9918. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Read(System.Byte[],System.Int32,System.Int32)">
  9919. <param name="buffer">An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.</param><param name="offset">The zero-based byte offset in buffer at which to begin storing the data read from the current stream.</param><param name="count">The maximum number of bytes to be read from the current stream.</param><summary>Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.</summary><returns>The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.</returns><remarks>
  9920. <format type="text/markdown"><![CDATA[
  9921. ## Remarks
  9922. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports writing.
  9923. ]]></format>
  9924. </remarks><exception cref="T:System.NotSupportedException">The object does not support reading of data.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9925. </member>
  9926. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.ReadByte">
  9927. <summary>Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.</summary><returns>The unsigned byte cast to an <see cref="T:System.Int32" />, or -1 if at the end of the stream.</returns><remarks>
  9928. <format type="text/markdown"><![CDATA[
  9929. ## Remarks
  9930. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports reading.
  9931. ]]></format>
  9932. </remarks><exception cref="T:System.NotSupportedException">The object does not support reading of data.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9933. </member>
  9934. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Write(System.Byte[],System.Int32,System.Int32)">
  9935. <param name="buffer">An array of bytes. This method copies <paramref name="count" /> bytes from <paramref name="buffer" /> to the current stream.</param><param name="offset">The zero-based byte offset in <paramref name="buffer" /> at which to begin copying bytes to the current stream.</param><param name="count">The number of bytes to be written to the current stream.</param><summary>Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.</summary><remarks>
  9936. <format type="text/markdown"><![CDATA[
  9937. ## Remarks
  9938. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite%2A> property to determine whether the current instance supports writing.
  9939. ]]></format>
  9940. </remarks><exception cref="T:System.NotSupportedException">The object does not support writing of data.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9941. </member>
  9942. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.WriteByte(System.Byte)">
  9943. <param name="value">The byte to write to the stream.</param><summary>Writes a byte to the current position in the stream and advances the position within the stream by one byte.</summary><remarks>
  9944. <format type="text/markdown"><![CDATA[
  9945. ## Remarks
  9946. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite%2A> property to determine whether the current instance supports writing.
  9947. ]]></format>
  9948. </remarks><exception cref="T:System.NotSupportedException">The object does not support writing of data.</exception><related type="Article" href="https://msdn.microsoft.com/library/bd8b845c-0f09-4295-b466-97ef106eefa8">FILESTREAM Data in SQL Server 2008 (ADO.NET)</related>
  9949. </member>
  9950. </members>
  9951. </doc>