Microsoft.Data.SqlClient.xml 1.0 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231
  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="/sql/connect/ado-net/sql/query-notifications-sql-server">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="/sql/connect/ado-net/sql/query-notifications-sql-server">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="/sql/connect/ado-net/sql/query-notifications-sql-server">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="/sql/connect/ado-net/sql/query-notifications-sql-server">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="/sql/connect/ado-net/sql/query-notifications-sql-server">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="/sql/connect/ado-net/sql/query-notifications-sql-server">Using Query Notifications</related>
  68. </member>
  69. <member name="T:Microsoft.Data.Sql.SqlDataSourceEnumerator">
  70. <summary>Provides a mechanism for enumerating all available instances of SQL Server within the local network.</summary><remarks>
  71. <format type="text/markdown"><![CDATA[
  72. ## Remarks
  73. SQL Server makes it possible for applications to determine the existence of its instances within the current network. The <xref:Microsoft.Data.Sql.SqlDataSourceEnumerator> class exposes this information to the application developer, providing a <xref:System.Data.DataTable> containing information about all the available servers. This returned table contains a list of server instances that matches the list provided when a user attempts to create a new connection, and on the `Connection Properties` dialog box, expands the drop-down list containing all the available servers.
  74. ]]></format>
  75. </remarks><related type="Article" href="/dotnet/framework/data/adonet/sql/enumerating-instances-of-sql-server">Enumerating Instances of SQL Server</related>
  76. </member>
  77. <member name="P:Microsoft.Data.Sql.SqlDataSourceEnumerator.Instance">
  78. <summary>Gets an instance of the <see cref="T:Microsoft.Data.Sql.SqlDataSourceEnumerator" />, which can be used to retrieve information about available SQL Server instances.</summary><value>An instance of the <see cref="T:Microsoft.Data.Sql.SqlDataSourceEnumerator" /> used to retrieve information about available SQL Server instances.</value><remarks>
  79. <format type="text/markdown"><![CDATA[
  80. ## Remarks
  81. The <xref:Microsoft.Data.Sql.SqlDataSourceEnumerator> class does not provide a constructor. Use the <xref:Microsoft.Data.Sql.SqlDataSourceEnumerator.Instance%2A> property to retrieve an instance of the class instead.
  82. [!code-csharp[SqlDataSourceEnumeratorExample#1](~/../sqlclient/doc/samples/SqlDataSourceEnumeratorExample.cs#1)]
  83. ## Examples
  84. The following console application displays a list of all the available SQL Server 2005 instances within the local network. This code uses the <xref:System.Data.DataTable.Select%2A> method to filter the rows in the table returned by the <xref:Microsoft.Data.Sql.SqlDataSourceEnumerator.GetDataSources%2A> method.
  85. [!code-csharp[SqlDataSourceEnumeratorVersionExample#1](~/../sqlclient/doc/samples/SqlDataSourceEnumeratorVersionExample.cs#1)]
  86. ]]></format>
  87. </remarks><related type="Article" href="/dotnet/framework/data/adonet/sql/enumerating-instances-of-sql-server">Enumerating Instances of SQL Server</related>
  88. </member>
  89. <member name="M:Microsoft.Data.Sql.SqlDataSourceEnumerator.GetDataSources">
  90. <summary>Retrieves a <see cref="T:System.Data.DataTable" /> containing information about all visible SQL Server instances.</summary><returns>A <see cref="T:System.Data.DataTable" /> containing information about the visible SQL Server instances.</returns><remarks>
  91. <format type="text/markdown"><![CDATA[
  92. ## Remarks
  93. The table returned by this method contains the following columns, all of which contain strings:
  94. |Column|Description|
  95. |------------|-----------------|
  96. |**ServerName**|Name of the server.|
  97. |**InstanceName**|Name of the server instance. Blank if the server is running as the default instance.|
  98. |**IsClustered**|Indicates whether the server is part of a cluster.|
  99. |**Version**|Version of the server:<br /><br />10.0.xx for SQL Server 2008<br />10.50.x for SQL Server 2008 R2<br />11.0.xx for SQL Server 2012<br />12.0.xx for SQL Server 2014<br />13.0.xx for SQL Server 2016<br />14.0.xx for SQL Server 2017|
  100. > [!NOTE]
  101. > Due to the nature of the mechanism used by <xref:Microsoft.Data.Sql.SqlDataSourceEnumerator> to locate data sources on a network, the method will not always return a complete list of the available servers, and the list might not be the same on every call. If you plan to use this function to let users select a server from a list, make sure that you always also supply an option to type in a name that is not in the list, in case the server enumeration does not return all the available servers. In addition, this method may take a significant amount of time to execute, so be careful about calling it when performance is critical.
  102. ## Examples
  103. The following console application retrieves information about all the visible SQL Server instances and displays the information in the console window.
  104. [!code-csharp[SqlDataSourceEnumerator.Example#1](~/../sqlclient/doc/samples/SqlDataSourceEnumeratorExample.cs#1)]
  105. ]]></format>
  106. </remarks><related type="Article" href="/dotnet/framework/data/adonet/sql/enumerating-instances-of-sql-server">Enumerating Instances of SQL Server</related>
  107. </member>
  108. <member name="T:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider">
  109. <summary>
  110. This class implements <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider" /> and is used for active directory federated authentication mechanisms.
  111. </summary>
  112. </member>
  113. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.#ctor">
  114. <summary>
  115. Initializes the <see cref="T:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider" /> class.
  116. </summary>
  117. </member>
  118. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.#ctor(System.String)">
  119. <param name="applicationClientId">Client Application Id to be used for acquiring an access token for federated authentication. The driver uses its own application client id by default.</param><summary>
  120. Initializes the <see cref="T:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider" /> class with the provided application client id.
  121. </summary><remarks>
  122. <format type="text/markdown">
  123. <![CDATA[
  124. ## Examples
  125. The following example demonstrates providing a user-defined application client id to SqlClient for the "Active Directory Interactive" authentication method:
  126. [!code-csharp[ActiveDirectory_ApplicationClientId Example#1](~/../sqlclient/doc/samples/ApplicationClientIdAzureAuthenticationProvider.cs#1)]
  127. ]]>
  128. </format>
  129. </remarks>
  130. </member>
  131. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.ClearUserTokenCache">
  132. <summary>Clears cached user tokens from the token provider.</summary><remarks>This will cause interactive authentication prompts to appear again if tokens were previously being obtained from the cache.</remarks>
  133. </member>
  134. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.#ctor(System.Func{Microsoft.Identity.Client.DeviceCodeResult,System.Threading.Tasks.Task},System.String)">
  135. <param name="deviceCodeFlowCallbackMethod">The callback method to be used with 'Active Directory Device Code Flow' authentication.</param><param name="applicationClientId">(Optional) Client Application Id to be used for acquiring an access token for federated authentication. The driver uses its own application client id by default.</param><summary>
  136. Initializes the <see cref="T:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider" /> class with the provided device code flow callback method and application client id.
  137. </summary>
  138. </member>
  139. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.AcquireTokenAsync(Microsoft.Data.SqlClient.SqlAuthenticationParameters)">
  140. <param name="parameters">The Active Directory authentication parameters passed to authentication providers.</param><summary>Acquires a security token from the authority.</summary><returns>Represents an asynchronous operation that returns the authentication token.</returns>
  141. </member>
  142. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.SetDeviceCodeFlowCallback(System.Func{Microsoft.Identity.Client.DeviceCodeResult,System.Threading.Tasks.Task})">
  143. <param name="deviceCodeFlowCallbackMethod">The callback method to be used with 'Active Directory Device Code Flow' authentication.</param><summary>Sets the callback method, overriding the default implementation that processes the result for 'Active Directory Device Code Flow' authentication.</summary><remarks>
  144. <format type="text/markdown">
  145. <![CDATA[
  146. ## Examples
  147. The following example demonstrates providing a custom device flow callback to SqlClient for the Device Code Flow authentication method:
  148. [!code-csharp[ActiveDirectory_DeviceCodeFlowCallback Example#1](~/../sqlclient/doc/samples/AADAuthenticationCustomDeviceFlowCallback.cs#1)]
  149. ]]>
  150. </format>
  151. </remarks>
  152. </member>
  153. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.SetAcquireAuthorizationCodeAsyncCallback(System.Func{System.Uri,System.Uri,System.Threading.CancellationToken,System.Threading.Tasks.Task{System.Uri}})">
  154. <param name="acquireAuthorizationCodeAsyncCallback">The callback method to be called by MSAL.NET to delegate the Web user interface with the Secure Token Service (STS).</param><summary>Sets a callback method which is invoked with a custom Web UI instance that will let the user sign-in with Azure Active Directory, present consent if needed, and get back the authorization code. Applicable when working with Active Directory Interactive authentication.</summary><remarks>The "authorizationUri" is crafted to leverage PKCE in order to protect the token from a man in the middle attack. Only MSAL.NET can redeem the code. In the event of cancellation, the implementer should return <see cref="T:System.OperationCanceledException" />.</remarks>
  155. </member>
  156. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.SetIWin32WindowFunc(System.Func{System.Windows.Forms.IWin32Window})">
  157. <param name="iWin32WindowFunc">A function to return the current window.</param><summary>Sets a reference to the current <see cref="T:System.Windows.Forms.IWin32Window" /> that triggers the browser to be shown. Used to center the browser pop-up onto this window."</summary>
  158. </member>
  159. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.IsSupported(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  160. <param name="authentication">The authentication method.</param><summary>Indicates whether the specified authentication method is supported.</summary><returns>
  161. <see langword="true" /> if the specified authentication method is supported; otherwise, <see langword="false" />.
  162. </returns><remarks>
  163. <format type="text/markdown">
  164. <![CDATA[
  165. ## Remarks
  166. The supported authentication modes with <xref=Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider> are:
  167. - Active Directory Password
  168. - Active Directory Integrated
  169. - Active Directory Interactive
  170. - Active Directory Service Principal
  171. - Active Directory Device Code Flow
  172. - Active Directory Managed Identity
  173. - Active Directory MSI
  174. - Active Directory Default
  175. ]]>
  176. </format>
  177. </remarks>
  178. </member>
  179. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.BeforeLoad(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  180. <param name="authentication">The authentication method.</param><summary>This method is called immediately before the provider is added to authentication provider registry. </summary><remarks>Avoid performing long-waiting tasks in this method, since it can block other threads from accessing the provider registry.</remarks>
  181. </member>
  182. <member name="M:Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider.BeforeUnload(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  183. <param name="authentication">The authentication method.</param><summary>This method is called immediately before the provider is removed from the authentication provider registry. </summary><remarks>For example, this method is called when a different provider with the same authentication method overrides this provider in the authentication provider registry. Avoid performing long-waiting task in this method, since it can block other threads from accessing the provider registry.</remarks>
  184. </member>
  185. <member name="T:Microsoft.Data.SqlClient.ApplicationIntent">
  186. <summary>
  187. Specifies a value for <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationIntent" />. Possible values are <see langword="ReadWrite" /> and <see langword="ReadOnly" />.
  188. </summary><remarks>To be added.</remarks>
  189. </member>
  190. <member name="F:Microsoft.Data.SqlClient.ApplicationIntent.ReadOnly">
  191. <summary>The application workload type when connecting to a server is read only.</summary><returns>1</returns><value>1</value>
  192. </member>
  193. <member name="F:Microsoft.Data.SqlClient.ApplicationIntent.ReadWrite">
  194. <summary>The application workload type when connecting to a server is read write.</summary><returns>0</returns><value>0</value>
  195. </member>
  196. <member name="T:Microsoft.Data.SqlClient.OnChangeEventHandler">
  197. <OnChangeEventHandler>
  198. <param name="sender">The source of the event.</param>
  199. <param name="e">A <see cref="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs" /> object that contains the event data.</param>
  200. <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>
  201. <remarks>
  202. <format type="text/markdown"><![CDATA[
  203. ## Remarks
  204. 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>.
  205. ]]></format>
  206. </remarks>
  207. </OnChangeEventHandler>
  208. </member>
  209. <member name="T:Microsoft.Data.SqlClient.PoolBlockingPeriod">
  210. <summary>Specifies a value for the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod" /> property. </summary><remarks>To be added.</remarks>
  211. </member>
  212. <member name="F:Microsoft.Data.SqlClient.PoolBlockingPeriod.AlwaysBlock">
  213. <summary>Blocking period ON for all SQL servers including Azure SQL servers.</summary><value>1</value>
  214. </member>
  215. <member name="F:Microsoft.Data.SqlClient.PoolBlockingPeriod.Auto">
  216. <summary>Blocking period OFF for Azure SQL servers, but ON for all other SQL servers.</summary><value>0</value>
  217. </member>
  218. <member name="F:Microsoft.Data.SqlClient.PoolBlockingPeriod.NeverBlock">
  219. <summary>Blocking period OFF for Azure SQL servers, but ON for all other SQL servers.</summary><value>2</value>
  220. </member>
  221. <member name="T:Microsoft.Data.SqlClient.SortOrder">
  222. <summary>
  223. Specifies how rows of data are sorted.
  224. </summary><remarks>To be added.</remarks>
  225. </member>
  226. <member name="F:Microsoft.Data.SqlClient.SortOrder.Unspecified">
  227. <summary>The default. No sort order is specified.</summary><value>-1</value><returns>-1</returns>
  228. </member>
  229. <member name="F:Microsoft.Data.SqlClient.SortOrder.Ascending">
  230. <summary>Rows are sorted in ascending order.</summary><value>0</value><returns>0</returns>
  231. </member>
  232. <member name="F:Microsoft.Data.SqlClient.SortOrder.Descending">
  233. <summary>Rows are sorted in descending order.</summary><value>1</value><returns>1</returns>
  234. </member>
  235. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer">
  236. <summary>Called from constructors in derived classes to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer" /> class.</summary><remarks>To be added.</remarks>
  237. </member>
  238. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.#ctor">
  239. <summary>Default Constructor to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer" /> class.</summary>
  240. </member>
  241. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.Initialize">
  242. <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>
  243. </member>
  244. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationMethod">
  245. <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>.
  246. </summary><remarks>To be added.</remarks>
  247. </member>
  248. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryIntegrated">
  249. <summary>The authentication method uses Active Directory Integrated. Use Active Directory Integrated to connect to a SQL Database using integrated Windows authentication.</summary><value>3</value>
  250. </member>
  251. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryInteractive">
  252. <summary>The authentication method uses Active Directory Interactive. Use Active Directory Interactive to connect to a SQL Database with an interactive authentication flow.</summary><value>4</value>
  253. </member>
  254. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryPassword">
  255. <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>
  256. </member>
  257. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryServicePrincipal">
  258. <summary>The authentication method uses Active Directory Service Principal. Use Active Directory Service Principal to connect to a SQL Database using the client ID and secret of a service principal identity.</summary><value>5</value>
  259. </member>
  260. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryDeviceCodeFlow">
  261. <summary>The authentication method uses Active Directory Device Code Flow. Use Active Directory Device Code Flow to connect to a SQL Database from devices and operating systems that do not provide a Web browser, using another device to perform interactive authentication.</summary><value>6</value>
  262. </member>
  263. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryManagedIdentity">
  264. <summary>The authentication method uses Active Directory Managed Identity. Use System Assigned or User Assigned Managed Identity to connect to SQL Database from Azure client environments that have enabled support for Managed Identity. For User Assigned Managed Identity, 'User Id' or 'UID' is required to be set to the "client ID" of the user identity.</summary><value>7</value>
  265. </member>
  266. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryMSI">
  267. <summary>Alias for "Active Directory Managed Identity" authentication method. Use System Assigned or User Assigned Managed Identity to connect to SQL Database from Azure client environments that have enabled support for Managed Identity. For User Assigned Managed Identity, 'User Id' or 'UID' is required to be set to the "client ID" of the user identity.</summary><value>8</value>
  268. </member>
  269. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryDefault">
  270. <summary>The authentication method uses Active Directory Default. Use this mode to connect to a SQL Database using multiple non-interactive authentication methods tried sequentially to acquire an access token. This method does not fallback to the "Active Directory Interactive" authentication method.</summary><value>9</value>
  271. </member>
  272. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.NotSpecified">
  273. <summary>The authentication method is not specified.</summary><value>0</value>
  274. </member>
  275. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.SqlPassword">
  276. <summary>The authentication method is Sql Password.</summary><value>1</value>
  277. </member>
  278. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationParameters">
  279. <summary>Represents AD authentication parameters passed by a driver to authentication providers.</summary>
  280. </member>
  281. <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,System.Int32)">
  282. <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><param name="connectionTimeout">The connection timeout value in seconds.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationParameters" /> class using the specified authentication method, server name, database name, resource URI, authority URI, user login name/ID, user password, connection ID and connection timeout value.</summary>
  283. </member>
  284. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.AuthenticationMethod">
  285. <summary>Gets the authentication method.</summary><value>The authentication method.</value>
  286. </member>
  287. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Authority">
  288. <summary>Gets the authority URI.</summary><value>The authority URI.</value>
  289. </member>
  290. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ConnectionId">
  291. <summary>Gets the connection ID.</summary><value>The connection ID.</value>
  292. </member>
  293. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.DatabaseName">
  294. <summary>Gets the database name.</summary><value>The database name.</value>
  295. </member>
  296. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Password">
  297. <summary>Gets the user password.</summary><value>The user password.</value>
  298. </member>
  299. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Resource">
  300. <summary>The resource URIs.</summary><value>The resource URI.</value>
  301. </member>
  302. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ServerName">
  303. <summary>Gets the server name.</summary><value>The server name.</value>
  304. </member>
  305. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.UserId">
  306. <summary>Gets the user login name/ID.</summary><value>The user login name/ID.</value>
  307. </member>
  308. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ConnectionTimeout">
  309. <summary>Gets the connection timeout value.</summary><value>The connection timeout value to be passed to Cancellation Token Source.</value>
  310. </member>
  311. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider">
  312. <summary>Defines the core behavior of authentication providers and provides a base class for derived classes. </summary><remarks>
  313. <format type="text/markdown">
  314. <![CDATA[
  315. ## Remarks
  316. Derived classes must provide a parameterless constructor if they can be instantiated from the app.config file.
  317. ## Examples
  318. The following example demonstrates implementing a custom SqlAuthenticationProvider and providing the same to SqlClient for overriding Device Code Flow authentication mode:
  319. [!code-csharp[ActiveDirectory_DeviceCodeFlowCallback Example#1](~/../sqlclient/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs#1)]
  320. ]]>
  321. </format>
  322. </remarks>
  323. </member>
  324. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.#ctor">
  325. <summary>
  326. Called from constructors in derived classes to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider" /> class.
  327. </summary>
  328. </member>
  329. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.AcquireTokenAsync(Microsoft.Data.SqlClient.SqlAuthenticationParameters)">
  330. <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>
  331. </member>
  332. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.BeforeLoad(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  333. <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>
  334. </member>
  335. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.BeforeUnload(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  336. <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>
  337. </member>
  338. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.GetProvider(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  339. <param name="authenticationMethod">The authentication method.</param><summary>Gets an authentication provider by method.</summary><returns>
  340. The authentication provider or <see langword="null" /> if not found.
  341. </returns><remarks>To be added.</remarks>
  342. </member>
  343. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.IsSupported(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  344. <param name="authenticationMethod">The authentication method.</param><summary>Indicates whether the specified authentication method is supported.</summary><returns>
  345. <see langword="true" /> if the specified authentication method is supported; otherwise, <see langword="false" />.
  346. </returns><remarks>To be added.</remarks>
  347. </member>
  348. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.SetProvider(Microsoft.Data.SqlClient.SqlAuthenticationMethod,Microsoft.Data.SqlClient.SqlAuthenticationProvider)">
  349. <param name="authenticationMethod">The authentication method.</param><param name="provider">The authentication provider.</param><summary>Sets an authentication provider by method.</summary><returns>
  350. <see langword="true" /> if the operation succeeded; otherwise, <see langword="false" /> (for example, the existing provider disallows overriding).
  351. </returns><remarks>To be added.</remarks>
  352. </member>
  353. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationToken">
  354. <summary>Represents an AD authentication token.</summary>
  355. </member>
  356. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationToken.#ctor(System.String,System.DateTimeOffset)">
  357. <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>
  358. </member>
  359. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationToken.AccessToken">
  360. <summary>Gets the token string.</summary><value>The token string.</value>
  361. </member>
  362. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationToken.ExpiresOn">
  363. <summary>Gets the token expiration time.</summary><value>The token expiration time.</value>
  364. </member>
  365. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopy">
  366. <summary>
  367. Lets you efficiently bulk load a SQL Server table with data from another source.
  368. </summary><remarks>
  369. <format ttype="text/markdown"><![CDATA[
  370. ## Remarks
  371. 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 <xref: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 <xref:Microsoft.Data.SqlClient.SqlBulkCopy> offers a significant performance advantage over them. The <xref: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 <xref:System.Data.DataTable> instance or read with a <xref:System.Data.IDataReader> instance. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> will fail when bulk loading a <xref:System.Data.DataTable> column of type <xref:System.Data.SqlTypes.SqlDateTime> into a SQL Server column whose type is one of the date/time types added in SQL Server 2008.
  372. ## Examples
  373. The following console application demonstrates how to load data using the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> class.
  374. 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.
  375. > [!IMPORTANT]
  376. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  377. 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,
  378. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  379. [!code-csharp[BulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  380. ]]></format>
  381. </remarks>
  382. </member>
  383. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)">
  384. <param name="connection">
  385. The already open
  386. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  387. instance that will be used to perform the bulk copy operation. If your connection string does not use
  388. <see langword="Integrated Security = true" />
  389. , you can use
  390. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  391. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  392. </param><summary>
  393. Initializes a new instance of the
  394. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  395. class using the specified open instance of
  396. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  397. .
  398. </summary><remarks>
  399. <format type="text/markdown"><![CDATA[
  400. ## Remarks
  401. 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.
  402. If the `connection` argument is null, an <xref:System.ArgumentNullException> is thrown.
  403. ## Examples
  404. 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>
  405. 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
  406. purposes only. You would not use `SqlBulkCopy` to move data from one table to another in the same database in a production application.
  407. 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
  408. <xref:System.Data.DataTable>.
  409. > [!IMPORTANT]
  410. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  411. 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
  412. Transact-SQL `INSERT … SELECT` statement to copy the data.
  413. [!code-csharp[BulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  414. ]]></format>
  415. </remarks>
  416. </member>
  417. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)">
  418. <param name="connection">
  419. The already open
  420. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  421. instance that will be used to perform the bulk copy. If your connection string does not use
  422. <see langword="Integrated Security = true" />
  423. , you can use
  424. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  425. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  426. </param><param name="copyOptions">
  427. A combination of values from the
  428. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions" />
  429. enumeration that determines which data source rows are copied to the destination table.
  430. </param><param name="externalTransaction">
  431. An existing
  432. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  433. instance under which the bulk copy will occur.
  434. </param><summary>
  435. Initializes a new instance of the
  436. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  437. class using the supplied existing open instance of
  438. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  439. . The
  440. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  441. instance behaves according to options supplied in the
  442. <paramref name="copyOptions" />
  443. parameter. If a non-null
  444. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  445. is supplied, the copy operations will be performed within that transaction.
  446. </summary><remarks>
  447. <format type="text/markdown"><![CDATA[
  448. ## Remarks
  449. If options include `UseInternalTransaction` and the `externalTransaction` argument is not null, an **InvalidArgumentException** is thrown.
  450. For examples demonstrating how to use `SqlBulkCopy` in a transaction, see [Transaction and Bulk Copy Operations](/sql/connect/ado-net/sql/transaction-bulk-copy-operations).
  451. ]]></format>
  452. </remarks><related type="Article" href="https://msdn.microsoft.com/library/83a7a0d2-8018-4354-97b9-0b1d99f8342b">
  453. Performing Bulk Copy Operations
  454. </related><related type="Article" href="/sql/connect/ado-net/overview-sqlclient-driver">
  455. Overview of the SqlClient driver
  456. </related>
  457. </member>
  458. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(System.String)">
  459. <param name="connectionString">
  460. The string defining the connection that will be opened for use by the
  461. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  462. instance.
  463. If your connection string does not use
  464. <see langword="Integrated Security = true" />
  465. , you can use
  466. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)" />
  467. or
  468. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)" />
  469. and
  470. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  471. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  472. </param><summary>
  473. Initializes and opens a new instance of
  474. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  475. based on the supplied
  476. <paramref name="connectionString" />
  477. . The constructor uses the
  478. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  479. to initialize a new instance of the
  480. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  481. class.
  482. </summary><remarks>
  483. <format type="text/markdown"><![CDATA[
  484. ## Remarks
  485. The connection is automatically closed at the end of the bulk copy operation.
  486. If `connectionString` is null, an <xref:System.ArgumentNullException> is thrown. If `connectionString` is an empty string, an <xref:System.ArgumentException> is thrown.
  487. ## Examples
  488. The following console application demonstrates how to bulk load data by using a connection specified as a string. The connection is automatically
  489. closed when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance is closed.
  490. In this example, the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  491. 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>.
  492. > [!IMPORTANT]
  493. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  494. 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,
  495. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  496. [!code-csharp[SqlBulkCopy.ConnectionString#1](~/../sqlclient/doc/samples/SqlBulkCopy_ConnectionString.cs#1)]
  497. ]]></format>
  498. </remarks><exception cref="T:System.ArgumentException">
  499. If `connectionString` is an empty string, an
  500. <see cref="T:System.ArgumentException" />
  501. is thrown.
  502. </exception>
  503. </member>
  504. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(System.String,Microsoft.Data.SqlClient.SqlBulkCopyOptions)">
  505. <param name="connectionString">
  506. The string defining the connection that will be opened for use by the
  507. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  508. instance. If your connection string does not use
  509. <see langword="Integrated Security = true" />
  510. , you can use
  511. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)" />
  512. or
  513. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)" />
  514. and
  515. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  516. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  517. </param><param name="copyOptions">
  518. A combination of values from the
  519. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions" />
  520. enumeration that determines which data source rows are copied to the destination table.
  521. </param><summary>
  522. Initializes and opens a new instance of
  523. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  524. based on the supplied
  525. <paramref name="connectionString" />
  526. . The constructor uses that
  527. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  528. to initialize a new instance of the
  529. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  530. class. The
  531. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  532. instance behaves according to options supplied in the
  533. <paramref name="copyOptions" />
  534. parameter.
  535. </summary><remarks>
  536. <format type="text/markdown"><![CDATA[
  537. ## Remarks
  538. You can obtain detailed information about all the bulk copy options in the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions> topic.
  539. ## Examples
  540. The following console application demonstrates how to perform a bulk load by using a connection specified as a string.
  541. 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,
  542. the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  543. 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.
  544. 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.
  545. 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.
  546. 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
  547. added because of primary key constraint violations.
  548. > [!IMPORTANT]
  549. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). This code is provided to
  550. 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
  551. to copy the data.
  552. [!code-csharp[SqlBulkCopy.KeepIdentity#1](~/../sqlclient/doc/samples/SqlBulkCopy_KeepIdentity.cs#1)]
  553. ]]></format>
  554. </remarks>
  555. </member>
  556. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize">
  557. <summary>
  558. Number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server.
  559. </summary><value>
  560. The integer value of the
  561. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize" />
  562. property, or zero if no value has been set.
  563. </value><remarks>
  564. <format type="text/markdown"><![CDATA[
  565. ## Remarks
  566. 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.
  567. Zero (the default) indicates that each <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is a single batch.
  568. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance has been declared without the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction> option in effect,
  569. rows are sent to the server <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> rows at a time, but no transaction-related action is taken.
  570. If <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction> is in effect, each batch of rows is inserted as a separate transaction.
  571. 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.
  572. 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>
  573. operation is already in progress, that operation loads the data as a single batch. Any subsequent <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A>
  574. operations on the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance use the new <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize>.
  575. ## Examples
  576. 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>
  577. works with a transaction, see [Transaction and Bulk Copy Operations](/sql/connect/ado-net/sql/transaction-bulk-copy-operations).
  578. > [!IMPORTANT]
  579. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  580. 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,
  581. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  582. [!code-csharp[SqlBulkCopy.BatchSize#1](~/../sqlclient/doc/samples/SqlBulkCopy_BatchSize.cs#1)]
  583. ]]></format>
  584. </remarks>
  585. </member>
  586. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.BulkCopyTimeout">
  587. <summary>
  588. Number of seconds for the operation to complete before it times out.
  589. </summary><value>
  590. The integer value of the
  591. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.BulkCopyTimeout" />
  592. property. The default is 30 seconds. A value of 0 indicates no limit; the bulk copy will wait indefinitely.
  593. </value><remarks>
  594. <format type="text/markdown"><![CDATA[
  595. ## Remarks
  596. If the operation does time out, the transaction is not committed and all copied rows are removed from the destination table.
  597. ## Examples
  598. The following console application demonstrates how to modify the time-out to 60 seconds when bulk loading data.
  599. In this example, the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  600. 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>.
  601. > [!IMPORTANT]
  602. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  603. 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
  604. Transact-SQL `INSERT … SELECT` statement to copy the data.
  605. [!code-csharp[SqlBulkCopy.Timeout#1](~/../sqlclient/doc/samples/SqlBulkCopy_Timeout.cs#1)]
  606. ]]></format>
  607. </remarks>
  608. </member>
  609. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings">
  610. <summary>
  611. Returns a collection of
  612. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  613. items. Column mappings define the relationships between columns in the data source and columns in the destination.
  614. </summary><value>
  615. A collection of column mappings. By default, it is an empty collection.
  616. </value><remarks>
  617. <format type="text/markdown"><![CDATA[
  618. 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
  619. the corresponding destination column, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection is unnecessary. However, if the column counts differ,
  620. 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.
  621. 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>.
  622. ]]></format>
  623. </remarks>
  624. </member>
  625. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnOrderHints">
  626. <summary>
  627. Returns a collection of
  628. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  629. items. Column order hints describe the sort order of columns in the clustered index of the destination table.
  630. </summary><value>
  631. A collection of column order hints. By default, it is an empty collection.
  632. </value><remarks>
  633. <format type="text/markdown"><![CDATA[
  634. ## Remarks
  635. SqlBulkCopy's performance is improved if the data being imported is sorted according to the clustered index on the table, if any.
  636. If the data is sorted in an order that differs from the order of a clustered index key or if there is no clustered index on the table, the order hint is ignored.
  637. ]]></format>
  638. </remarks>
  639. </member>
  640. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName">
  641. <summary>
  642. Name of the destination table on the server.
  643. </summary><value>
  644. The string value of the
  645. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  646. property, or null if none as been supplied.
  647. </value><remarks>
  648. <format type="text/markdown"><![CDATA[
  649. ## Remarks
  650. 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>
  651. is thrown. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> is modified while a <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is running,
  652. 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.
  653. <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.
  654. 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>]`).
  655. 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.
  656. ## Examples
  657. 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.
  658. 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
  659. 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>.
  660. > [!IMPORTANT]
  661. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  662. 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,
  663. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  664. [!code-csharp[SqlBulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  665. ]]></format>
  666. </remarks>
  667. </member>
  668. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.EnableStreaming">
  669. <summary>
  670. Enables or disables a
  671. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  672. object to stream data from an
  673. <see cref="T:System.Data.IDataReader" />
  674. object
  675. </summary><value>
  676. <see langword="true" />
  677. if a
  678. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  679. object can stream data from an
  680. <see cref="T:System.Data.IDataReader" />
  681. object; otherwise, false. The default is
  682. <see langword="false" />
  683. .
  684. </value><remarks>
  685. <format type="text/markdown"><![CDATA[
  686. 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>,
  687. 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
  688. <xref:System.Data.IDataReader> object into memory before sending it to SQL Server or SQL Azure.
  689. ]]></format>
  690. </remarks>
  691. </member>
  692. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter">
  693. <summary>
  694. Defines the number of rows to be processed before generating a notification event.
  695. </summary><value>
  696. The integer value of the
  697. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter" />
  698. property, or zero if the property has not been set.
  699. </value><remarks>
  700. <format type="text/markdown"><![CDATA[
  701. ## Remarks
  702. 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.
  703. 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
  704. the next notification. The new setting applies to all subsequent operations on the same instance.
  705. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> is set to a number less than zero, an <xref:System.ArgumentOutOfRangeException> is thrown.
  706. ## Examples
  707. 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
  708. the event handler is called after every 50 rows copied to the table.
  709. 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.
  710. 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>.
  711. > [!IMPORTANT]
  712. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). This code is provided to
  713. 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`
  714. statement to copy the data.
  715. [!code-csharp[SqlBulkCopy.NotifyAfter#1](~/../sqlclient/doc/samples/SqlBulkCopy_NotifyAfter.cs#1)]
  716. ]]></format>
  717. </remarks>
  718. </member>
  719. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.RowsCopied">
  720. <summary>
  721. The number of rows processed in the ongoing bulk copy operation.
  722. </summary><value>
  723. The integer value of the
  724. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.RowsCopied" />
  725. property.
  726. </value><remarks>
  727. <format type="text/markdown"><![CDATA[
  728. ## Remarks
  729. This value is incremented during the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event and does not imply that this number of rows has been sent to the server or committed.
  730. During the execution of a bulk copy operation, this value can be accessed, but it cannot be changed. Any attempt to change it will throw an <xref:System.InvalidOperationException>.
  731. ]]></format>
  732. </remarks>
  733. </member>
  734. <member name="E:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied">
  735. <summary>
  736. Occurs every time that the number of rows specified by the
  737. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter" />
  738. property have been processed.
  739. </summary><remarks>
  740. <format type="text/markdown"><![CDATA[
  741. ## Remarks
  742. Note that the settings of <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> and <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> are independent. Receipt of a
  743. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event does not imply that any rows have been sent to the server or committed.
  744. You cannot call SqlBulkCopy.Close (<xref:Microsoft.Data.SqlClient.SqlBulkCopy.Close>) or SqlConnection.Close (<xref:Microsoft.Data.SqlClient.SqlConnection.Close>) from this event.
  745. 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
  746. operation from the event, the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort> property of the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs> can be used.
  747. (See [Transaction and Bulk Copy Operations](/sql/connect/ado-net/sql/transaction-bulk-copy-operations) for examples that use the
  748. <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort> property.)
  749. 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
  750. during the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event. However, you can open a different connection.
  751. ## Examples
  752. 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
  753. the event handler is called after every 50 rows copied to the table.
  754. 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
  755. 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>.
  756. > [!IMPORTANT]
  757. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  758. 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
  759. and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  760. [!code-csharp[SqlBulkCopy.NotifyAfter#1](~/../sqlclient/doc/samples/SqlBulkCopy_NotifyAfter.cs#1)]
  761. ]]></format>
  762. </remarks>
  763. </member>
  764. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.Close">
  765. <summary>
  766. Closes the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" /> instance.
  767. </summary><remarks>
  768. <format type="text/markdown"><![CDATA[
  769. ## Remarks
  770. 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>. 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.
  771. Note that open <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instances are closed implicitly at the end of a `using` block.
  772. ## Examples
  773. 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.
  774. > [!IMPORTANT]
  775. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). 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.
  776. [!code-csharp[SqlBulkCopy.OrdersDetails#1](~/../sqlclient/doc/samples/SqlBulkCopy_OrdersDetails.cs#1)]
  777. ]]></format>
  778. </remarks>
  779. </member>
  780. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.System#IDisposable#Dispose">
  781. <summary>
  782. Releases all resources used by the current instance of the
  783. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  784. class.
  785. </summary><remarks>
  786. <format type="text/markdown"><![CDATA[
  787. 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.
  788. 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
  789. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> was occupying.
  790. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and
  791. [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).
  792. > [!NOTE]
  793. > 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
  794. the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object's `Finalize` method.
  795. ]]></format>
  796. </remarks>
  797. </member>
  798. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.Common.DbDataReader)">
  799. <param name="reader">
  800. A
  801. <see cref="T:System.Data.Common.DbDataReader" />
  802. whose rows will be copied to the destination table.
  803. </param><summary>
  804. Copies all rows from the supplied
  805. <see cref="T:System.Data.Common.DbDataReader" />
  806. array to a destination table specified by the
  807. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  808. property of the
  809. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  810. object.
  811. </summary><remarks>
  812. To be added.
  813. </remarks><exception cref="T:System.InvalidOperationException">
  814. A
  815. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  816. did not specify a valid destination column name.
  817. </exception>
  818. </member>
  819. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)">
  820. <param name="table">
  821. A
  822. <see cref="T:System.Data.DataTable" />
  823. whose rows will be copied to the destination table.
  824. </param><summary>
  825. Copies all rows in the supplied
  826. <see cref="T:System.Data.DataTable" />
  827. to a destination table specified by the
  828. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  829. property of the
  830. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  831. object.
  832. </summary><remarks>
  833. <format type="text/markdown"><![CDATA[
  834. ## Remarks
  835. All rows in the <xref:System.Data.DataTable> are copied to the destination table except those that have been deleted.
  836. 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.
  837. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataTable> columns to the destination database table.
  838. ## Examples
  839. 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.
  840. In this example, a <xref:System.Data.DataTable> is created at run time and is the source of the `SqlBulkCopy` operation.
  841. > [!IMPORTANT]
  842. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  843. 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.
  844. [!code-csharp[SqlBulkCopy.DataTable#1](~/../sqlclient/doc/samples/SqlBulkCopy_DataTable.cs#1)]
  845. ]]></format>
  846. </remarks><exception cref="T:System.InvalidOperationException">
  847. A
  848. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  849. did not specify a valid destination column name.
  850. </exception><related type="Article" href="https://msdn.microsoft.com/library/83a7a0d2-8018-4354-97b9-0b1d99f8342b">
  851. Performing Bulk Copy Operations
  852. </related><related type="Article" href="/sql/connect/ado-net/overview-sqlclient-driver">
  853. Overview of the SqlClient driver
  854. </related>
  855. </member>
  856. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)">
  857. <param name="table">
  858. A
  859. <see cref="T:System.Data.DataTable" />
  860. whose rows will be copied to the destination table.
  861. </param><param name="rowState">
  862. A value from the
  863. <see cref="T:System.Data.DataRowState" />
  864. enumeration. Only rows matching the row state are copied to the destination.
  865. </param><summary>
  866. Copies only rows that match the supplied row state in the supplied
  867. <see cref="T:System.Data.DataTable" />
  868. to a destination table specified by the
  869. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  870. property of the
  871. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  872. object.
  873. </summary><remarks>
  874. <format type="text/markdown"><![CDATA[
  875. ## Remarks
  876. 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.
  877. > [!NOTE]
  878. > 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>
  879. rows will also be copied to the server. No exception will be raised.
  880. 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.
  881. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataTable> columns to the destination database table.
  882. ## Examples
  883. 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.
  884. 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.
  885. 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.
  886. > [!IMPORTANT]
  887. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). 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.
  888. [!code-csharp[SqlBulkCopy.DataRowState#1](~/../sqlclient/doc/samples/SqlBulkCopy_DataRowState.cs#1)]
  889. ]]></format>
  890. </remarks><exception cref="T:System.InvalidOperationException">
  891. A
  892. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  893. did not specify a valid destination column name.
  894. </exception>
  895. </member>
  896. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])">
  897. <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>
  898. <format type="text/markdown"><![CDATA[
  899. ## Remarks
  900. 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.
  901. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataRow> columns to the destination database table.
  902. ## Examples
  903. 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.
  904. 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.
  905. > [!IMPORTANT]
  906. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). 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.
  907. [!code-csharp[SqlBulkCopy.RowArray#1](~/../sqlclient/doc/samples/SqlBulkCopy_RowArray.cs#1)]
  908. ]]></format>
  909. </remarks><exception cref="T:System.InvalidOperationException">
  910. A
  911. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  912. did not specify a valid destination column name.
  913. </exception>
  914. </member>
  915. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)">
  916. <param name="reader">
  917. A
  918. <see cref="T:System.Data.IDataReader" />
  919. whose rows will be copied to the destination table.
  920. </param><summary>
  921. Copies all rows in the supplied
  922. <see cref="T:System.Data.IDataReader" />
  923. to a destination table specified by the
  924. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  925. property of the
  926. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  927. object.
  928. </summary><remarks>
  929. <format type="text/markdown"><![CDATA[
  930. ## Remarks
  931. 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,
  932. 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
  933. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> again.
  934. 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>
  935. 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,
  936. when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is complete.
  937. 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.
  938. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the data reader columns to the destination database table.
  939. ## Examples
  940. 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.
  941. > [!IMPORTANT]
  942. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). This code is provided
  943. 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
  944. Transact-SQL `INSERT … SELECT` statement to copy the data.
  945. [!code-csharp[SqlBulkCopy.ConnectionString#1](~/../sqlclient/doc/samples/SqlBulkCopy_ConnectionString.cs#1)]
  946. ]]></format>
  947. </remarks><exception cref="T:System.InvalidOperationException">
  948. A
  949. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  950. did not specify a valid destination column name.
  951. </exception>
  952. </member>
  953. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader)">
  954. <param name="reader">
  955. A
  956. <see cref="T:System.Data.IDataReader" />
  957. whose rows will be copied to the destination table.
  958. </param><summary>
  959. The asynchronous version of
  960. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />,
  961. which copies all rows in the supplied
  962. <see cref="T:System.Data.IDataReader" />
  963. to a destination table specified by the
  964. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  965. property of the
  966. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  967. object.
  968. </summary><returns>
  969. A task representing the asynchronous operation.
  970. </returns><remarks>
  971. <format type="text/markdown"><![CDATA[
  972. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  973. ]]></format>
  974. </remarks><exception cref="T:System.InvalidOperationException">
  975. Calling
  976. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  977. multiple times for the same instance before task completion.
  978. Calling
  979. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  980. and
  981. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  982. for the same instance before task completion.
  983. The connection drops or is closed during
  984. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  985. execution.
  986. Returned in the task object, the
  987. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  988. object was closed during the method execution.
  989. Returned in the task object, there was a connection pool timeout.
  990. Returned in the task object, the
  991. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  992. object is closed before method execution.
  993. The
  994. <see cref="T:System.Data.IDataReader" />
  995. was closed before the completed
  996. <see cref="T:System.Threading.Tasks.Task" />
  997. returned.
  998. The
  999. <see cref="T:System.Data.IDataReader" />'s associated connection was closed before the completed
  1000. <see cref="T:System.Threading.Tasks.Task" />
  1001. returned.
  1002. A
  1003. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1004. did not specify a valid destination column name.
  1005. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1006. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1007. </exception>
  1008. </member>
  1009. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader,System.Threading.CancellationToken)">
  1010. <param name="reader">
  1011. A
  1012. <see cref="T:System.Data.Common.DbDataReader" />
  1013. whose rows will be copied to the destination table.
  1014. </param><param name="cancellationToken">
  1015. The cancellation instruction. A
  1016. <see cref="P:System.Threading.CancellationToken.None" />
  1017. value in this parameter makes this method equivalent to
  1018. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader)" />.
  1019. </param><summary>
  1020. The asynchronous version of
  1021. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.Common.DbDataReader)" />,
  1022. which copies all rows from the supplied
  1023. <see cref="T:System.Data.Common.DbDataReader" />
  1024. array to a destination table specified by the
  1025. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1026. property of the
  1027. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1028. object.
  1029. 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.
  1030. </summary><returns>
  1031. A task representing the asynchronous operation.
  1032. </returns><remarks>
  1033. To be added.
  1034. </remarks>
  1035. </member>
  1036. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])">
  1037. <param name="rows">
  1038. An array of
  1039. <see cref="T:System.Data.DataRow" />
  1040. objects that will be copied to the destination table.
  1041. </param><summary>
  1042. The asynchronous version of
  1043. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />,
  1044. which copies all rows from the supplied
  1045. <see cref="T:System.Data.DataRow" />
  1046. array to a destination table specified by the
  1047. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1048. property of the
  1049. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1050. object.
  1051. </summary><returns>
  1052. A task representing the asynchronous operation.
  1053. </returns><remarks>
  1054. <format type="text/markdown"><![CDATA[
  1055. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1056. ]]></format>
  1057. </remarks><exception cref="T:System.InvalidOperationException">
  1058. Calling
  1059. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  1060. multiple times for the same instance before task completion. Calling
  1061. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  1062. and
  1063. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  1064. for the same instance before task completion.
  1065. The connection drops or is closed during
  1066. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  1067. execution.
  1068. Returned in the task object, the
  1069. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1070. object was closed during the method execution.
  1071. Returned in the task object, there was a connection pool timeout.
  1072. Returned in the task object, the
  1073. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1074. object is closed before method execution.
  1075. A
  1076. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1077. did not specify a valid destination column name.
  1078. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1079. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1080. </exception>
  1081. </member>
  1082. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[],System.Threading.CancellationToken)">
  1083. <param name="rows">
  1084. An array of
  1085. <see cref="T:System.Data.DataRow" />
  1086. objects that will be copied to the destination table.
  1087. </param><param name="cancellationToken">
  1088. The cancellation instruction. A
  1089. <see cref="P:System.Threading.CancellationToken.None" />
  1090. value in this parameter makes this method equivalent to
  1091. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />.
  1092. </param><summary>
  1093. The asynchronous version of
  1094. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />,
  1095. which copies all rows from the supplied
  1096. <see cref="T:System.Data.DataRow" />
  1097. array to a destination table specified by the
  1098. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1099. property of the
  1100. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1101. object.
  1102. 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.
  1103. </summary><returns>
  1104. A task representing the asynchronous operation.
  1105. </returns><remarks>
  1106. <format type="text/markdown"><![CDATA[
  1107. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1108. ]]></format>
  1109. </remarks><exception cref="T:System.InvalidOperationException">
  1110. Calling
  1111. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  1112. multiple times for the same instance before task completion.
  1113. Calling
  1114. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  1115. and
  1116. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  1117. for the same instance before task completion.
  1118. The connection drops or is closed during
  1119. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  1120. execution.
  1121. Returned in the task object, the
  1122. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1123. object was closed during the method execution.
  1124. Returned in the task object, there was a connection pool timeout.
  1125. Returned in the task object, the
  1126. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1127. object is closed before method execution.
  1128. A
  1129. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1130. did not specify a valid destination column name.
  1131. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1132. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1133. </exception>
  1134. </member>
  1135. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)">
  1136. <param name="table">
  1137. A
  1138. <see cref="T:System.Data.DataTable" />
  1139. whose rows will be copied to the destination table.
  1140. </param><summary>
  1141. The asynchronous version of
  1142. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />,
  1143. which copies all rows in the supplied
  1144. <see cref="T:System.Data.DataTable" />
  1145. to a destination table specified by the
  1146. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1147. property of the
  1148. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1149. object.
  1150. </summary><returns>
  1151. A task representing the asynchronous operation.
  1152. </returns><remarks>
  1153. <format type="text/markdown"><![CDATA[
  1154. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1155. ]]></format>
  1156. </remarks><exception cref="T:System.InvalidOperationException">
  1157. Calling
  1158. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1159. multiple times for the same instance before task completion.
  1160. Calling
  1161. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1162. and
  1163. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  1164. for the same instance before task completion.
  1165. The connection drops or is closed during
  1166. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1167. execution.
  1168. Returned in the task object, the
  1169. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1170. object was closed during the method execution.
  1171. Returned in the task object, there was a connection pool timeout.
  1172. Returned in the task object, the
  1173. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1174. object is closed before method execution.
  1175. A
  1176. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1177. did not specify a valid destination column name.
  1178. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1179. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1180. </exception>
  1181. </member>
  1182. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)">
  1183. <param name="table">
  1184. A
  1185. <see cref="T:System.Data.DataTable" />
  1186. whose rows will be copied to the destination table.
  1187. </param><param name="rowState">
  1188. A value from the
  1189. <see cref="T:System.Data.DataRowState" />
  1190. enumeration. Only rows matching the row state are copied to the destination.
  1191. </param><summary>
  1192. The asynchronous version of
  1193. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />,
  1194. which copies only rows that match the supplied row state in the supplied
  1195. <see cref="T:System.Data.DataTable" /> to a destination table specified by the <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1196. property of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" /> object.
  1197. </summary><returns>
  1198. A task representing the asynchronous operation.
  1199. </returns><remarks>
  1200. <format type="text/markdown"><![CDATA[
  1201. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1202. ]]></format>
  1203. </remarks><exception cref="T:System.InvalidOperationException">
  1204. Calling
  1205. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1206. multiple times for the same instance before task completion.
  1207. Calling
  1208. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1209. and
  1210. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1211. for the same instance before task completion.
  1212. The connection drops or is closed during
  1213. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1214. execution.
  1215. Returned in the task object, the
  1216. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1217. object was closed during the method execution.
  1218. Returned in the task object, there was a connection pool timeout.
  1219. Returned in the task object, the
  1220. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1221. object is closed before method execution.
  1222. A
  1223. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1224. did not specify a valid destination column name.
  1225. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1226. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1227. </exception>
  1228. </member>
  1229. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState,System.Threading.CancellationToken)">
  1230. <param name="table">
  1231. A
  1232. <see cref="T:System.Data.DataTable" />
  1233. whose rows will be copied to the destination table.
  1234. </param><param name="rowState">
  1235. A value from the
  1236. <see cref="T:System.Data.DataRowState" />
  1237. enumeration. Only rows matching the row state are copied to the destination.
  1238. </param><param name="cancellationToken">
  1239. The cancellation instruction. A
  1240. <see cref="P:System.Threading.CancellationToken.None" />
  1241. value in this parameter makes this method equivalent to
  1242. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />.
  1243. </param><summary>
  1244. The asynchronous version of
  1245. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />,
  1246. which copies only rows that match the supplied row state in the supplied
  1247. <see cref="T:System.Data.DataTable" />
  1248. to a destination table specified by the
  1249. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1250. property of the
  1251. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1252. object.
  1253. 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.
  1254. </summary><returns>
  1255. A task representing the asynchronous operation.
  1256. </returns><remarks>
  1257. <format type="text/markdown"><![CDATA[
  1258. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1259. ]]></format>
  1260. </remarks><exception cref="T:System.InvalidOperationException">
  1261. Calling
  1262. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1263. multiple times for the same instance before task completion.
  1264. Calling
  1265. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1266. and
  1267. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1268. for the same instance before task completion.
  1269. The connection drops or is closed during
  1270. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1271. execution.
  1272. Returned in the task object, the
  1273. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1274. object was closed during the method execution.
  1275. Returned in the task object, there was a connection pool timeout.
  1276. Returned in the task object, the
  1277. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1278. object is closed before method execution.
  1279. A
  1280. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1281. did not specify a valid destination column name.
  1282. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1283. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1284. </exception>
  1285. </member>
  1286. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Threading.CancellationToken)">
  1287. <param name="table">
  1288. A
  1289. <see cref="T:System.Data.DataTable" />
  1290. whose rows will be copied to the destination table.
  1291. </param><param name="cancellationToken">
  1292. The cancellation instruction. A
  1293. <see cref="P:System.Threading.CancellationToken.None" />
  1294. value in this parameter makes this method equivalent to
  1295. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />.
  1296. </param><summary>
  1297. The asynchronous version of
  1298. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />,
  1299. which copies all rows in the supplied
  1300. <see cref="T:System.Data.DataTable" />
  1301. to a destination table specified by the
  1302. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1303. property of the
  1304. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1305. object.
  1306. 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.
  1307. </summary><returns>
  1308. A task representing the asynchronous operation.
  1309. </returns><remarks>
  1310. <format type="text/markdown"><![CDATA[
  1311. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1312. ]]></format>
  1313. </remarks><exception cref="T:System.InvalidOperationException">
  1314. Calling
  1315. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1316. multiple times for the same instance before task completion.
  1317. Calling
  1318. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1319. and
  1320. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  1321. for the same instance before task completion.
  1322. The connection drops or is closed during
  1323. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1324. execution.
  1325. Returned in the task object, the
  1326. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1327. object was closed during the method execution.
  1328. Returned in the task object, there was a connection pool timeout.
  1329. Returned in the task object, the
  1330. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1331. object is closed before method execution.
  1332. A
  1333. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1334. did not specify a valid destination column name.
  1335. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1336. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1337. </exception>
  1338. </member>
  1339. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)">
  1340. <param name="reader">
  1341. A
  1342. <see cref="T:System.Data.IDataReader" />
  1343. whose rows will be copied to the destination table.
  1344. </param><summary>
  1345. The asynchronous version of
  1346. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />,
  1347. which copies all rows in the supplied
  1348. <see cref="T:System.Data.IDataReader" />
  1349. to a destination table specified by the
  1350. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1351. property of the
  1352. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1353. object.
  1354. </summary><returns>
  1355. A task representing the asynchronous operation.
  1356. </returns><remarks>
  1357. <format type="text/markdown"><![CDATA[
  1358. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1359. ]]></format>
  1360. </remarks><exception cref="T:System.InvalidOperationException">
  1361. Calling
  1362. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1363. multiple times for the same
  1364. instance before task completion.
  1365. Calling
  1366. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1367. and
  1368. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1369. for the same instance before task completion.
  1370. The connection drops or is closed during
  1371. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1372. execution.
  1373. Returned in the task object, the
  1374. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1375. object was closed during the method execution.
  1376. Returned in the task object, there was a connection pool timeout.
  1377. Returned in the task object, the
  1378. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1379. object is closed before method execution.
  1380. The
  1381. <see cref="T:System.Data.IDataReader" />
  1382. was closed before the completed
  1383. <see cref="T:System.Threading.Tasks.Task" />
  1384. returned.
  1385. The
  1386. <see cref="T:System.Data.IDataReader" />'s associated connection was closed before the completed
  1387. <see cref="T:System.Threading.Tasks.Task" />
  1388. returned.
  1389. A
  1390. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1391. did not specify a valid destination column name.
  1392. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1393. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1394. </exception>
  1395. </member>
  1396. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader,System.Threading.CancellationToken)">
  1397. <param name="reader">
  1398. A
  1399. <see cref="T:System.Data.IDataReader" />
  1400. whose rows will be copied to the destination table.
  1401. </param><param name="cancellationToken">
  1402. The cancellation instruction. A
  1403. <see cref="P:System.Threading.CancellationToken.None" />
  1404. value in this parameter makes this method equivalent to
  1405. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />.
  1406. </param><summary>
  1407. The asynchronous version of
  1408. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />,
  1409. which copies all rows in the supplied
  1410. <see cref="T:System.Data.IDataReader" />
  1411. to a destination table specified by the
  1412. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1413. property of the
  1414. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1415. object.
  1416. 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.
  1417. </summary><returns>
  1418. A task representing the asynchronous operation.
  1419. </returns><remarks>
  1420. <format type="text/markdown"><![CDATA[
  1421. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  1422. ]]></format>
  1423. </remarks><exception cref="T:System.InvalidOperationException">
  1424. Calling
  1425. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1426. multiple times for the same instance before task completion.
  1427. Calling
  1428. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1429. and
  1430. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1431. for the same instance before task completion.
  1432. The connection drops or is closed during
  1433. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1434. execution.
  1435. Returned in the task object, the
  1436. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1437. object was closed during the method execution.
  1438. Returned in the task object, there was a connection pool timeout.
  1439. Returned in the task object, the
  1440. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1441. object is closed before method execution.
  1442. The
  1443. <see cref="T:System.Data.IDataReader" />
  1444. was closed before the completed
  1445. <see cref="T:System.Threading.Tasks.Task" />
  1446. returned.
  1447. The
  1448. <see cref="T:System.Data.IDataReader" />'s associated connection was closed before the completed
  1449. <see cref="T:System.Threading.Tasks.Task" />
  1450. returned.
  1451. A
  1452. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  1453. did not specify a valid destination column name.
  1454. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1455. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1456. </exception>
  1457. </member>
  1458. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping">
  1459. <summary>
  1460. Defines the mapping between a column in a
  1461. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1462. instance's data source and a column in the instance's destination table.
  1463. </summary><remarks>
  1464. <format type="text/markdown"><![CDATA[
  1465. ## Remarks
  1466. Column mappings define the mapping between data source and the target table.
  1467. 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.
  1468. For this to work, source and target schemas must match. If they do not, an <xref:System.InvalidOperationException> will be thrown.
  1469. 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
  1470. are ignored.
  1471. 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.
  1472. ## Examples
  1473. 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
  1474. 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.
  1475. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1476. > [!IMPORTANT]
  1477. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1478. 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
  1479. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1480. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1481. ]]></format>
  1482. </remarks>
  1483. </member>
  1484. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor">
  1485. <summary>
  1486. Parameterless constructor that initializes a new
  1487. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  1488. object.
  1489. </summary><remarks>
  1490. <format type="text/markdown"><![CDATA[
  1491. ## Remarks
  1492. If you use this constructor, you must then define the source for the mapping using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn>
  1493. property or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> property, and define the destination for the mapping using the
  1494. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> property or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> property.
  1495. ## Examples
  1496. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1497. 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.
  1498. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1499. > [!IMPORTANT]
  1500. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1501. 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,
  1502. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1503. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1504. ]]></format>
  1505. </remarks>
  1506. </member>
  1507. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.Int32,System.Int32)">
  1508. <param name="sourceColumnOrdinal">
  1509. The ordinal position of the source column within the data source.
  1510. </param><param name="destinationOrdinal">
  1511. The ordinal position of the destination column within the destination table.
  1512. </param><summary>
  1513. Creates a new column mapping, using column ordinals to refer to source and destination columns.
  1514. </summary><remarks>
  1515. <format type="text/markdown"><![CDATA[
  1516. ## Examples
  1517. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1518. 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.
  1519. <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.
  1520. > [!IMPORTANT]
  1521. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1522. 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
  1523. and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1524. [!code-csharp[SqlBulkCopy.ColumnMappingOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdinal.cs#1)]
  1525. ]]></format>
  1526. </remarks>
  1527. </member>
  1528. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.Int32,System.String)">
  1529. <param name="sourceColumnOrdinal">
  1530. The ordinal position of the source column within the data source.
  1531. </param><param name="destinationColumn">
  1532. The name of the destination column within the destination table.
  1533. </param><summary>
  1534. Creates a new column mapping, using a column ordinal to refer to the source column and a column name for the target column.
  1535. </summary><remarks>
  1536. <format type="text/markdown"><![CDATA[
  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. Although the number of columns in
  1539. 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
  1540. column map for the bulk copy.
  1541. > [!IMPORTANT]
  1542. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  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
  1544. faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1545. [!code-csharp[SqlBulkCopy.ColumnMappingOrdinalName#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdinalName.cs#1)]
  1546. ]]></format>
  1547. </remarks>
  1548. </member>
  1549. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.String,System.Int32)">
  1550. <param name="sourceColumn">
  1551. The name of the source column within the data source.
  1552. </param><param name="destinationOrdinal">
  1553. The ordinal position of the destination column within the destination table.
  1554. </param><summary>
  1555. Creates a new column mapping, using a column name to refer to the source column and a column ordinal for the target column.
  1556. </summary><remarks>
  1557. <format type="text/markdown"><![CDATA[
  1558. ## Examples
  1559. 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
  1560. 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
  1561. a column map for the bulk copy.
  1562. > [!IMPORTANT]
  1563. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup). This code is
  1564. 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
  1565. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1566. [!code-csharp[SqlBulkCopy.ColumnMappingNameOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingNameOrdinal.cs#1)]
  1567. ]]></format>
  1568. </remarks>
  1569. </member>
  1570. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.String,System.String)">
  1571. <param name="sourceColumn">
  1572. The name of the source column within the data source.
  1573. </param><param name="destinationColumn">
  1574. The name of the destination column within the destination table.
  1575. </param><summary>
  1576. Creates a new column mapping, using column names to refer to source and destination columns.
  1577. </summary><remarks>
  1578. <format type="text/markdown"><![CDATA[
  1579. ## Examples
  1580. 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
  1581. 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
  1582. column map for the bulk copy.
  1583. > [!IMPORTANT]
  1584. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1585. 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
  1586. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1587. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1588. ]]></format>
  1589. </remarks>
  1590. </member>
  1591. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn">
  1592. <summary>
  1593. Name of the column being mapped in the destination database table.
  1594. </summary><value>
  1595. The string value of the
  1596. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn" />
  1597. property.
  1598. </value><remarks>
  1599. <format type="text/markdown"><![CDATA[
  1600. ## Remarks
  1601. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> properties are mutually exclusive.
  1602. The last value set takes precedence.
  1603. ## Examples
  1604. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1605. 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.
  1606. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1607. > [!IMPORTANT]
  1608. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1609. 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
  1610. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1611. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationColumn.cs#1)]
  1612. ]]></format>
  1613. </remarks>
  1614. </member>
  1615. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal">
  1616. <summary>
  1617. Ordinal value of the destination column within the destination table.
  1618. </summary><value>
  1619. The integer value of the
  1620. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal" />
  1621. property, or -1 if the property has not been set.
  1622. </value><remarks>
  1623. <format type="text/markdown"><![CDATA[
  1624. ## Remarks
  1625. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> properties are mutually exclusive.
  1626. The last value set takes precedence.
  1627. ## Examples
  1628. 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
  1629. 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
  1630. column map for the bulk copy.
  1631. > [!IMPORTANT]
  1632. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1633. 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
  1634. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1635. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationOrdinal.cs#1)]
  1636. ]]></format>
  1637. </remarks>
  1638. </member>
  1639. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn">
  1640. <summary>
  1641. Name of the column being mapped in the data source.
  1642. </summary><value>
  1643. The string value of the
  1644. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn" />
  1645. property.
  1646. </value><remarks>
  1647. <format type="text/markdown"><![CDATA[
  1648. ## Remarks
  1649. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> properties are mutually exclusive.
  1650. The last value set takes precedence.
  1651. ## Examples
  1652. 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
  1653. 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
  1654. column map for the bulk copy.
  1655. > [!IMPORTANT]
  1656. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1657. 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
  1658. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1659. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationColumn.cs#1)]
  1660. ]]></format>
  1661. </remarks>
  1662. </member>
  1663. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal">
  1664. <summary>
  1665. The ordinal position of the source column within the data source.
  1666. </summary><value>
  1667. The integer value of the
  1668. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal" />
  1669. property.
  1670. </value><remarks>
  1671. <format type="text/markdown"><![CDATA[
  1672. ## Remarks
  1673. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> properties are mutually exclusive.
  1674. The last value set takes precedence.
  1675. ## Examples
  1676. 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
  1677. 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
  1678. bulk copy.
  1679. > [!IMPORTANT]
  1680. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1681. 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
  1682. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1683. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationOrdinal.cs#1)]
  1684. ]]></format>
  1685. </remarks>
  1686. </member>
  1687. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection">
  1688. <summary>Collection of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> objects that inherits from <see cref="T:System.Collections.CollectionBase" />.</summary><remarks>
  1689. <format type="text/markdown"><![CDATA[
  1690. ## Remarks
  1691. Column mappings define the mapping between data source and the target table.
  1692. 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.
  1693. For this to work, source and target schemas must match. If they do not, an <xref:System.InvalidOperationException> is thrown.
  1694. 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
  1695. ignored.
  1696. 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.
  1697. ## Examples
  1698. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1699. 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.
  1700. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> are added to the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection> for the
  1701. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object to create a column map for the bulk copy.
  1702. > [!IMPORTANT]
  1703. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1704. 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
  1705. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1706. [!code-csharp[SqlBulkCopy.ColumnMappingCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollection.cs#1)]
  1707. ]]></format>
  1708. </remarks>
  1709. </member>
  1710. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Item(System.Int32)">
  1711. <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>
  1712. </member>
  1713. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1714. <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>
  1715. <format type="text/markdown"><![CDATA[
  1716. ## Examples
  1717. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1718. 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.
  1719. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1720. > [!IMPORTANT]
  1721. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1722. 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,
  1723. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1724. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs)]
  1725. ]]>
  1726. </format>
  1727. </remarks>
  1728. </member>
  1729. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.Int32,System.Int32)">
  1730. <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>
  1731. <format type="text/markdown"><![CDATA[
  1732. ## Remarks
  1733. 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
  1734. mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1735. ## Examples
  1736. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1737. 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.
  1738. <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.
  1739. > [!IMPORTANT]
  1740. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1741. 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
  1742. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1743. [!code-csharp[SqlBulkCopy.ColumnMappingCollectionOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollectionOrdinal.cs#1)]
  1744. ]]></format>
  1745. </remarks>
  1746. </member>
  1747. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.Int32,System.String)">
  1748. <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>
  1749. <format type="text/markdown"><![CDATA[
  1750. ## Remarks
  1751. 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.
  1752. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1753. ## Examples
  1754. 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
  1755. 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
  1756. column map for the bulk copy.
  1757. > [!IMPORTANT]
  1758. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1759. 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
  1760. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1761. [!code-csharp[SqlBulkCopy_ColumnMappingIndexColName#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingIndexColName.cs#1)]
  1762. ]]></format>
  1763. </remarks>
  1764. </member>
  1765. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.String,System.Int32)">
  1766. <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>
  1767. <format type="text/markdown"><![CDATA[
  1768. ## Remarks
  1769. 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.
  1770. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1771. ## Examples
  1772. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1773. 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.
  1774. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1775. > [!IMPORTANT]
  1776. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1777. 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,
  1778. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1779. [!code-csharp[SqlBulkCopy.ColumnMappingColNameIndex#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingColNameIndex.cs#1)]
  1780. ]]></format>
  1781. </remarks>
  1782. </member>
  1783. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.String,System.String)">
  1784. <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>
  1785. <format type="text/markdown"><![CDATA[
  1786. ## Remarks
  1787. 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.
  1788. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1789. ## Examples
  1790. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1791. 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
  1792. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> object by specifying the column names.
  1793. > [!IMPORTANT]
  1794. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1795. 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,
  1796. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1797. [!code-csharp[SqlBulkCopy.ColumnMappingCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollection.cs#1)]
  1798. ]]></format>
  1799. </remarks>
  1800. </member>
  1801. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear">
  1802. <summary>Clears the contents of the collection.</summary><remarks>
  1803. <format type="text/markdown"><![CDATA[
  1804. ## Remarks
  1805. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1806. instance to process more than one bulk copy operation. If you create column mappings for one bulk copy operation, you must clear the
  1807. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection> after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method and before processing the next bulk copy.
  1808. 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
  1809. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1810. ## Examples
  1811. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1812. 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.
  1813. 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.
  1814. > [!IMPORTANT]
  1815. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1816. 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
  1817. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1818. [!code-csharp[SqlBulkCopy.ColumnMappingOrdersDetails#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdersDetails.cs#1)]
  1819. ]]></format>
  1820. </remarks>
  1821. </member>
  1822. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Contains(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1823. <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>
  1824. <see langword="true" /> if the specified mapping exists in the collection; otherwise <see langword="false" />.</returns>
  1825. </member>
  1826. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.CopyTo(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping[],System.Int32)">
  1827. <param name="array">The one-dimensional <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> array that is the destination of the elements copied from
  1828. <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" />
  1829. items, starting at a particular index.
  1830. </summary>
  1831. </member>
  1832. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.IndexOf(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1833. <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>
  1834. </member>
  1835. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1836. <param name="index">Integer value of the location within the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" /> at which to insert the new
  1837. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />.</param><param name="value">
  1838. <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>
  1839. </member>
  1840. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1841. <param name="value">
  1842. <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>
  1843. <format type="text/markdown"><![CDATA[
  1844. ## Remarks
  1845. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1846. 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
  1847. <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
  1848. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method, or remove mappings individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A>
  1849. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method.
  1850. 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
  1851. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1852. ## Examples
  1853. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1854. 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.
  1855. 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**
  1856. mapping and then adds the appropriate mappings for the second bulk copy operation.
  1857. > [!IMPORTANT]
  1858. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1859. 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
  1860. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1861. [!code-csharp[SqlBulkCopy.ColumnMappingRemove#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingRemove.cs#1)]
  1862. ]]></format>
  1863. </remarks>
  1864. </member>
  1865. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt(System.Int32)">
  1866. <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>
  1867. <format type="text/markdown"><![CDATA[
  1868. ## Remarks
  1869. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1870. 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
  1871. <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
  1872. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method, or remove mappings individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A>
  1873. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method.
  1874. 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
  1875. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1876. ## Examples
  1877. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1878. 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.
  1879. 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
  1880. **SalesOrderID** mapping and then adds the appropriate mappings for the second bulk copy operation.
  1881. > [!IMPORTANT]
  1882. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1883. 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
  1884. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1885. [!code-csharp[SqlBulkCopy.ColumnMappingRemoveAt#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingRemoveAt.cs#1)]
  1886. ]]></format>
  1887. </remarks>
  1888. </member>
  1889. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint">
  1890. <summary>
  1891. Defines the sort order for a column in a
  1892. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1893. instance's destination table, according to the clustered index on the table.
  1894. </summary><remarks>
  1895. <format type="text/markdown"><![CDATA[
  1896. ## Remarks
  1897. Column order hints define the sort order of the column in the destination table.
  1898. SqlBulkCopy's performance is improved if the data being imported is sorted according to the clustered index on the table, if any.
  1899. If the data is sorted in an order that differs from the order of a clustered index key or if there is no clustered index on the table, the order hint is ignored.
  1900. Order hints can be specified for any number of columns in the destination table. By default, the bulk insert operation assumes the data is
  1901. unordered if no hints are provided.
  1902. The column names supplied must be valid column names in the destination table. The order in which hints can be specified is arbitrary.
  1903. A single column name cannot be specified more than once.
  1904. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection is not empty, order hints can only be provided for valid
  1905. destination columns which have been mapped.
  1906. If a <xref:Microsoft.Data.SqlClient.SortOrder> of Unspecified is given, an <xref:System.ArgumentException> will be thrown.
  1907. ## Examples
  1908. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1909. A SqlBulkCopyColumnOrderHint object is used to define the sort order for the ProductNumber destination column.
  1910. > [!IMPORTANT]
  1911. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1912. 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
  1913. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1914. [!code-csharp[SqlBulkCopy.ColumnOrderHint#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHint.cs#1)]
  1915. ]]></format>
  1916. </remarks>
  1917. </member>
  1918. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint.#ctor(System.String,Microsoft.Data.SqlClient.SortOrder)">
  1919. <param name="column">
  1920. The name of the destination column within the destination table.
  1921. </param><param name="sortOrder">
  1922. The sort order of the corresponding destination column.
  1923. </param><summary>
  1924. Creates a new column order hint for the specified destination column.
  1925. </summary><remarks>
  1926. <format type="text/markdown"><![CDATA[
  1927. ## Examples
  1928. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1929. A SqlBulkCopyColumnOrderHint object is used to define the sort order for the ProductNumber destination column.
  1930. > [!IMPORTANT]
  1931. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1932. 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
  1933. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1934. [!code-csharp[SqlBulkCopy.ColumnOrderHint#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHint.cs#1)]
  1935. ]]></format>
  1936. </remarks>
  1937. </member>
  1938. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint.Column">
  1939. <summary>
  1940. Name of the destination column in the destination table for which the hint is being provided.
  1941. </summary><value>
  1942. The string value of the
  1943. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint.Column" />
  1944. property.
  1945. </value><remarks>
  1946. <format type="text/markdown"><![CDATA[
  1947. ## Remarks
  1948. An <xref:System.ArgumentException> will be thrown if a null or empty string is given.
  1949. ## Examples
  1950. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1951. A SqlBulkCopyColumnOrderHint object is used to define the sort order for the ProductNumber destination column.
  1952. > [!IMPORTANT]
  1953. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1954. 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
  1955. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1956. [!code-csharp[SqlBulkCopy.ColumnOrderHintColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintColumn.cs#1)]
  1957. ]]></format>
  1958. </remarks><exception cref="T:System.ArgumentException">The value is null or empty.</exception>
  1959. </member>
  1960. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint.SortOrder">
  1961. <summary>
  1962. The sort order of the destination column in the destination table.
  1963. </summary><value>
  1964. The SortOrder value of the
  1965. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint.SortOrder" />
  1966. property.
  1967. </value><remarks>
  1968. <format type="text/markdown"><![CDATA[
  1969. ## Remarks
  1970. An <xref:System.ArgumentException> will be thrown if a <xref:Microsoft.Data.SqlClient.SortOrder> of Unspecified is given.
  1971. ## Examples
  1972. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1973. A SqlBulkCopyColumnOrderHint object is used to define the sort order for the ProductNumber destination column.
  1974. > [!IMPORTANT]
  1975. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  1976. 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
  1977. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1978. [!code-csharp[SqlBulkCopy.ColumnOrderHintSortOrder#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintSortOrder.cs#1)]
  1979. ]]></format>
  1980. </remarks><exception cref="T:System.ArgumentException">The sort order cannot be unspecified for a column order hint.</exception>
  1981. </member>
  1982. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection">
  1983. <summary>Collection of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> objects that inherits from <see cref="T:System.Collections.CollectionBase" />.</summary><remarks>
  1984. <format type="text/markdown"><![CDATA[
  1985. ## Remarks
  1986. Column order hints define the sort order of the column in the destination table.
  1987. SqlBulkCopy's performance is improved if the data being imported is sorted according to the clustered index on the table, if any.
  1988. If the data is sorted in an order that differs from the order of a clustered index key or if there is no clustered index on the table, the order hint is ignored.
  1989. Order hints can be specified for any number of columns in the destination table. By default, the bulk insert operation assumes the data is
  1990. unordered if no hints are provided.
  1991. The column names supplied must be valid column names in the destination table. The order in which hints can be specified is arbitrary.
  1992. A single column name cannot be specified more than once.
  1993. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection is not empty, order hints can only be provided for valid
  1994. destination columns which have been mapped.
  1995. If a <xref:Microsoft.Data.SqlClient.SortOrder> of Unspecified is given, an <xref:System.ArgumentException> will be thrown.
  1996. ## Examples
  1997. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1998. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint>s are added to the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection> of the
  1999. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object to specify order hints for the bulk copy operation.
  2000. > [!IMPORTANT]
  2001. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2002. 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
  2003. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  2004. [!code-csharp[SqlBulkCopy.ColumnOrderHintCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintCollection.cs#1)]
  2005. ]]></format>
  2006. </remarks>
  2007. </member>
  2008. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Item(System.Int32)">
  2009. <param name="index">The zero-based index of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> to find.</param><summary>Gets the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object at the specified index.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object.</value><remarks>To be added.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The index must be non-negative and less than the size of the collection.</exception>
  2010. </member>
  2011. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Add(Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint)">
  2012. <param name="columnOrderHint">The <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object that describes the order hint to be added to the collection.</param><summary>Adds the specified order hint to the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection" />.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object.</returns><remarks>
  2013. <format type="text/markdown"><![CDATA[
  2014. ## Examples
  2015. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  2016. A SqlBulkCopyColumnOrderHint object is used to define the sort order for the **ProductNumber** destination column.
  2017. > [!IMPORTANT]
  2018. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2019. 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,
  2020. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  2021. [!code-csharp[SqlBulkCopy.ColumnOrderHintCollectionAdd#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintCollectionAdd.cs)]
  2022. ]]>
  2023. </format>
  2024. </remarks><exception cref="T:System.ArgumentException">The value is null.</exception>
  2025. </member>
  2026. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Add(System.String,Microsoft.Data.SqlClient.SortOrder)">
  2027. <param name="column">The name of the destination column within the destination table.</param><param name="sortOrder">The sort order of the corresponding destination column.</param><summary>Creates a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> and adds it to the collection.</summary><returns>A column column order hint.</returns><remarks>
  2028. <format type="text/markdown"><![CDATA[
  2029. ## Remarks
  2030. ## Examples
  2031. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  2032. A SqlBulkCopyColumnOrderHint object is added to the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnOrderHints> by providing the destination column name and its sort order.
  2033. > [!IMPORTANT]
  2034. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2035. 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
  2036. Transact-SQL `INSERT … SELECT` statement to copy the data.
  2037. [!code-csharp[SqlBulkCopy.ColumnOrderHintCollectionAdd2#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintCollectionAdd2.cs#1)]
  2038. ]]></format>
  2039. </remarks>
  2040. </member>
  2041. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Clear">
  2042. <summary>Clears the contents of the collection.</summary><remarks>
  2043. <format type="text/markdown"><![CDATA[
  2044. ## Remarks
  2045. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Clear> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  2046. instance to process more than one bulk copy operation. If you create column order hints for one bulk copy operation, you must clear the
  2047. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection> after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer> method and before processing the next bulk copy.
  2048. 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
  2049. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  2050. ## Examples
  2051. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  2052. The example defines a column order hint for each bulk copy operation.
  2053. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Clear> method must be used after the first bulk copy is performed and before the next bulk copy's order hint is defined.
  2054. > [!IMPORTANT]
  2055. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2056. 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
  2057. Transact-SQL `INSERT … SELECT` statement to copy the data.
  2058. [!code-csharp[SqlBulkCopy.ColumnOrderHintCollectionClear#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintCollectionClear.cs#1)]
  2059. ]]></format>
  2060. </remarks>
  2061. </member>
  2062. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Contains(Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint)">
  2063. <param name="value">A valid <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object.</param><summary>Gets a value indicating whether a specified <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object exists in the collection.</summary><returns>
  2064. <see langword="true" /> if the specified column order hint exists in the collection; otherwise <see langword="false" />.</returns>
  2065. </member>
  2066. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.CopyTo(Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint[],System.Int32)">
  2067. <param name="array">The one-dimensional <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> array that is the destination of the elements copied from
  2068. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection" />. 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.SqlBulkCopyColumnOrderHintCollection" /> to an array of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />
  2069. items, starting at a particular index.
  2070. </summary>
  2071. </member>
  2072. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.IndexOf(Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint)">
  2073. <param name="value">The <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object for which to search.</param><summary>Gets the index of the specified <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object.</summary><returns>The zero-based index of the column order hint, or -1 if the column order hint is not found in the collection.</returns><remarks>To be added.</remarks>
  2074. </member>
  2075. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint)">
  2076. <param name="index">Integer value of the location within the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection" /> at which to insert the new
  2077. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" />.</param><param name="columnOrderHint">
  2078. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object to be inserted in the collection.</param><summary>Insert a new <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> at the index specified.</summary><remarks>The order in which column order hints can be added is arbitrary.</remarks><exception cref="T:System.ArgumentOutOfRangeException">The index is less than zero or greater than the size of the collection.</exception><exception cref="T:System.ArgumentNullException">A null column order hint cannot be added to the collection.</exception>
  2079. </member>
  2080. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Remove(Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint)">
  2081. <param name="columnOrderHint">
  2082. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object to be removed from the collection.</param><summary>Removes the specified <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> element from the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection" />.</summary><remarks>
  2083. <format type="text/markdown"><![CDATA[
  2084. ## Remarks
  2085. The Remove method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  2086. instance to process more than one bulk copy operation. If you create column order hints for one bulk copy operation, you must clear the
  2087. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection> after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method and before processing the next bulk copy.
  2088. You can clear the entire collection by using the
  2089. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Clear> method, or remove hints individually using the Remove method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.RemoveAt%2A> method.
  2090. 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
  2091. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  2092. ## Examples
  2093. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  2094. The example defines a column order hint for the **OrderDate** column in the first bulk copy operation. The hint is removed before the second bulk copy operation.
  2095. > [!IMPORTANT]
  2096. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2097. 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
  2098. Transact-SQL `INSERT … SELECT` statement to copy the data.
  2099. [!code-csharp[SqlBulkCopy.ColumnOrderHintCollectionRemove#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintCollectionRemove.cs#1)]
  2100. ]]></format>
  2101. </remarks><exception cref="T:System.ArgumentNullException">The value is null.</exception>
  2102. </member>
  2103. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.RemoveAt(System.Int32)">
  2104. <param name="index">The zero-based index of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHint" /> object to be removed from the collection.</param><summary>Removes the column order hint at the specified index from the collection.</summary><remarks>
  2105. <format type="text/markdown"><![CDATA[
  2106. ## Remarks
  2107. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.RemoveAt> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  2108. instance to process more than one bulk copy operation. If you create column order hints for one bulk copy operation, you must clear the
  2109. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection> after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer> method and before processing the next bulk copy.
  2110. You can clear the entire collection by using the
  2111. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Clear> method, or remove hints individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.Remove>
  2112. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnOrderHintCollection.RemoveAt> method.
  2113. 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
  2114. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  2115. ## Examples
  2116. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  2117. The example defines a column order hint for the **OrderDate** column in the first bulk copy operation. The hint is removed before the second bulk copy operation.
  2118. > [!IMPORTANT]
  2119. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2120. 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
  2121. Transact-SQL `INSERT … SELECT` statement to copy the data.
  2122. [!code-csharp[SqlBulkCopy.ColumnOrderHintCollectionRemoveAt#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnOrderHintCollectionRemoveAt.cs#1)]
  2123. ]]></format>
  2124. </remarks><exception cref="T:System.ArgumentOutOfRangeException">The index must be non-negative and less than the size of the collection.</exception>
  2125. </member>
  2126. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions">
  2127. <summary>Bitwise flag that specifies one or more options to use with an instance of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />.</summary><remarks>
  2128. <format type="text/markdown"><![CDATA[
  2129. ## Remarks
  2130. You can use the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions> enumeration when you construct a <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance to change how the
  2131. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> methods for that instance behave.
  2132. ## Examples
  2133. 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,
  2134. instead of generating a new value for each row's identity column.
  2135. 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.
  2136. 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
  2137. primary key violations.
  2138. > [!IMPORTANT]
  2139. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](/sql/connect/ado-net/sql/bulk-copy-example-setup).
  2140. 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,
  2141. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  2142. [!code-csharp[SqlBulkCopy.KeepIdentity#1](~/../sqlclient/doc/samples/SqlBulkCopy_KeepIdentity.cs)]
  2143. ]]></format>
  2144. </remarks>
  2145. </member>
  2146. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.AllowEncryptedValueModifications">
  2147. <summary>
  2148. <format type="text/markdown"><![CDATA[
  2149. When specified, **AllowEncryptedValueModifications** enables bulk copying of encrypted data between tables or databases, without decrypting the data. Typically,
  2150. 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
  2151. to disabled) and then would use this option to bulk insert the data, which is still encrypted.
  2152. 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,
  2153. or if it is correctly encrypted using the same encryption type, algorithm and key as the target column.
  2154. ]]></format>
  2155. </summary>
  2156. </member>
  2157. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.CheckConstraints">
  2158. <summary>Check constraints while data is being inserted. By default, constraints are not checked.</summary>
  2159. </member>
  2160. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.Default">
  2161. <summary>Use the default values for all options.</summary>
  2162. </member>
  2163. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.FireTriggers">
  2164. <summary>When specified, cause the server to fire the insert triggers for the rows being inserted into the database.</summary>
  2165. </member>
  2166. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.KeepIdentity">
  2167. <summary>Preserve source identity values. When not specified, identity values are assigned by the destination.</summary>
  2168. </member>
  2169. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.KeepNulls">
  2170. <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>
  2171. </member>
  2172. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.TableLock">
  2173. <summary>Obtain a bulk update lock for the duration of the bulk copy operation. When not specified, row locks are used.</summary>
  2174. </member>
  2175. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction">
  2176. <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" />
  2177. object to the constructor, an <see cref="T:System.ArgumentException" /> occurs.
  2178. </summary>
  2179. </member>
  2180. <member name="T:Microsoft.Data.SqlClient.SqlClientFactory">
  2181. <summary>
  2182. Represents a set of methods for creating instances of the
  2183. <see cref="N:Microsoft.Data.SqlClient" />
  2184. provider's implementation of the data source classes.
  2185. </summary><remarks>
  2186. To be added.
  2187. </remarks>
  2188. </member>
  2189. <member name="F:Microsoft.Data.SqlClient.SqlClientFactory.Instance">
  2190. <summary>
  2191. Gets an instance of the
  2192. <see cref="T:Microsoft.Data.SqlClient.SqlClientFactory" />
  2193. . This can be used to retrieve strongly typed data objects.
  2194. </summary><remarks>
  2195. <format type="text/markdown"><![CDATA[
  2196. ## Examples
  2197. The following code fragment uses the <xref:Microsoft.Data.SqlClient.SqlClientFactory.Instance> property to retrieve a **SqlClientFactory** instance, and then return a strongly typed
  2198. <xref:System.Data.Common.DbCommand> instance:
  2199. ```csharp
  2200. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2201. DbCommand cmd = newFactory.CreateCommand();
  2202. ```
  2203. ]]></format>
  2204. </remarks>
  2205. </member>
  2206. <member name="P:Microsoft.Data.SqlClient.SqlClientFactory.CanCreateDataSourceEnumerator">
  2207. <summary>
  2208. Gets a value that indicates whether a
  2209. <see cref="T:System.Data.Sql.SqlDataSourceEnumerator" />
  2210. can be created.
  2211. </summary><value>
  2212. <see langword="true" />
  2213. if a
  2214. <see cref="T:System.Data.Sql.SqlDataSourceEnumerator" />
  2215. can be created; otherwise,
  2216. <see langword="false" />
  2217. .
  2218. </value><remarks>
  2219. <format type="text/markdown"><![CDATA[
  2220. ## Remarks
  2221. The <xref:System.Data.Common.DbProviderFactory> class provides the <xref:System.Data.Common.DbProviderFactory.CanCreateDataSourceEnumerator%2A> property so that inheritors can indicate
  2222. whether they can provide a data source enumerator. The <xref:Microsoft.Data.SqlClient.SqlClientFactory> displays this property, but its value is always `true`.
  2223. ## Examples
  2224. The following example displays a list of all available SQL Server data sources, using code that could enumerate data sources for any provider.
  2225. [!code-csharp[SqlClientFactory.DataSourceEnumerator#1](~/../sqlclient/doc/samples/SqlClientFactory_DataSourceEnumerator.cs#1)]
  2226. ]]></format>
  2227. </remarks>
  2228. </member>
  2229. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateCommand">
  2230. <summary>
  2231. Returns a strongly typed
  2232. <see cref="T:System.Data.Common.DbCommand" />
  2233. instance.
  2234. </summary><returns>
  2235. A new strongly typed instance of
  2236. <see cref="T:System.Data.Common.DbCommand" />
  2237. .
  2238. </returns><remarks>
  2239. <format type="text/markdown"><![CDATA[
  2240. ## Examples
  2241. The following code fragment returns a strongly typed <xref:System.Data.Common.DbCommand> instance:
  2242. ```csharp
  2243. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2244. DbCommand cmd = newFactory.CreateCommand();
  2245. ```
  2246. ]]></format>
  2247. </remarks>
  2248. </member>
  2249. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateCommandBuilder">
  2250. <summary>
  2251. Returns a strongly typed
  2252. <see cref="T:System.Data.Common.DbCommandBuilder" />
  2253. instance.
  2254. </summary><returns>
  2255. A new strongly typed instance of
  2256. <see cref="T:System.Data.Common.DbCommandBuilder" />
  2257. .
  2258. </returns><remarks>
  2259. <format type="text/markdown"><![CDATA[
  2260. ## Examples
  2261. The following code fragment returns a strongly typed <xref:System.Data.Common.DbCommandBuilder> instance:
  2262. ```csharp
  2263. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2264. DbCommandBuilder cmd = newFactory.CreateCommandBuilder();
  2265. ```
  2266. ]]></format>
  2267. </remarks>
  2268. </member>
  2269. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateConnection">
  2270. <summary>
  2271. Returns a strongly typed
  2272. <see cref="T:System.Data.Common.DbConnection" />
  2273. instance.
  2274. </summary><returns>
  2275. A new strongly typed instance of
  2276. <see cref="T:System.Data.Common.DbConnection" />
  2277. .
  2278. </returns><remarks>
  2279. <format type="text/markdown"><![CDATA[
  2280. ## Examples
  2281. The following code fragment returns a strongly typed <xref:System.Data.Common.DbConnection> instance:
  2282. ```csharp
  2283. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2284. DbConnection cmd = newFactory.CreateConnection();
  2285. ```
  2286. ]]></format>
  2287. </remarks>
  2288. </member>
  2289. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateConnectionStringBuilder">
  2290. <summary>
  2291. Returns a strongly typed
  2292. <see cref="T:System.Data.Common.DbConnectionStringBuilder" />
  2293. instance.
  2294. </summary><returns>
  2295. A new strongly typed instance of
  2296. <see cref="T:System.Data.Common.DbConnectionStringBuilder" />
  2297. .
  2298. </returns><remarks>
  2299. <format type="text/markdown"><![CDATA[
  2300. ## Examples
  2301. The following code fragment returns a strongly typed <xref:System.Data.Common.DbConnectionStringBuilder> instance:
  2302. ```csharp
  2303. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2304. DbConnectionStringBuilder cmd =
  2305. newFactory.CreateConnectionStringBuilder();
  2306. ```
  2307. ]]></format>
  2308. </remarks>
  2309. </member>
  2310. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateDataAdapter">
  2311. <summary>
  2312. Returns a strongly typed
  2313. <see cref="T:System.Data.Common.DbDataAdapter" />
  2314. instance.
  2315. </summary><returns>
  2316. A new strongly typed instance of
  2317. <see cref="T:System.Data.Common.DbDataAdapter" />
  2318. .
  2319. </returns><remarks>
  2320. <format type="text/markdown"><![CDATA[
  2321. ## Examples
  2322. The following code fragment returns a strongly typed <xref:System.Data.Common.DbDataAdapter> instance:
  2323. ```csharp
  2324. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2325. DbDataAdapter cmd = newFactory.CreateDataAdapter();
  2326. ```
  2327. ]]></format>
  2328. </remarks>
  2329. </member>
  2330. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateDataSourceEnumerator">
  2331. <summary>
  2332. Returns a new
  2333. <see cref="T:System.Data.Sql.SqlDataSourceEnumerator" />
  2334. .
  2335. </summary><returns>
  2336. A new data source enumerator.
  2337. </returns><remarks>
  2338. <format type="text/markdown"><![CDATA[
  2339. ## Examples
  2340. The following example displays a list of all available SQL Server data sources, using code that could enumerate data sources for any provider.
  2341. [!code-csharp[SqlClientFactory_DataSourceEnumerator#1](~/../sqlclient/doc/samples/SqlClientFactory_DataSourceEnumerator.cs)]
  2342. ]]></format>
  2343. </remarks>
  2344. </member>
  2345. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateParameter">
  2346. <summary>
  2347. Returns a strongly typed
  2348. <see cref="T:System.Data.Common.DbParameter" />
  2349. instance.
  2350. </summary><returns>
  2351. A new strongly typed instance of
  2352. <see cref="T:System.Data.Common.DbParameter" />
  2353. .
  2354. </returns><remarks>
  2355. <format type="text/markdown"><![CDATA[
  2356. ## Examples
  2357. The following code fragment returns a strongly typed <xref:System.Data.Common.DbParameter> instance:
  2358. ```csharp
  2359. SqlClientFactory newFactory = SqlClientFactory.Instance;
  2360. DbParameter cmd = newFactory.CreateParameter();
  2361. ```
  2362. ]]></format>
  2363. </remarks>
  2364. </member>
  2365. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreatePermission(System.Security.Permissions.PermissionState)">
  2366. <param name="state">
  2367. A member of the
  2368. <see cref="T:System.Security.Permissions.PermissionState" />
  2369. enumeration.
  2370. </param><summary>
  2371. Returns a new
  2372. <see cref="T:System.Security.CodeAccessPermission" />
  2373. .
  2374. </summary><returns>
  2375. A strongly typed instance of
  2376. <see cref="T:System.Security.CodeAccessPermission" />
  2377. .
  2378. </returns><remarks>
  2379. To be added.
  2380. </remarks>
  2381. </member>
  2382. <member name="T:Microsoft.Data.SqlClient.SqlClientLogger">
  2383. <summary>Represents a SQL client logger.</summary><remarks>To be added.</remarks>
  2384. </member>
  2385. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.#ctor">
  2386. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientLogger" /> class.</summary><remarks>To be added.</remarks>
  2387. </member>
  2388. <member name="P:Microsoft.Data.SqlClient.SqlClientLogger.IsLoggingEnabled">
  2389. <summary>Gets a value that indicates whether bid tracing is enabled.</summary><value>
  2390. <see langword="true" /> if bid tracing is enabled; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  2391. </member>
  2392. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogWarning(System.String,System.String,System.String)">
  2393. <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 warning through a specified method of the current instance type.</summary>
  2394. </member>
  2395. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogAssert(System.Boolean,System.String,System.String,System.String)">
  2396. <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>
  2397. </member>
  2398. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogError(System.String,System.String,System.String)">
  2399. <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>
  2400. </member>
  2401. <member name="M:Microsoft.Data.SqlClient.SqlClientLogger.LogInfo(System.String,System.String,System.String)">
  2402. <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>
  2403. </member>
  2404. <member name="T:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames">
  2405. <summary>Provides a list of constants for use with the **GetSchema** method to retrieve metadata collections.</summary><remarks>To be added.</remarks>
  2406. </member>
  2407. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Columns">
  2408. <summary>A constant for use with the **GetSchema** method that represents the **Columns** collection.</summary><remarks>To be added.</remarks>
  2409. </member>
  2410. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Databases">
  2411. <summary>A constant for use with the **GetSchema** method that represents the **Databases** collection.</summary><remarks>To be added.</remarks>
  2412. </member>
  2413. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ForeignKeys">
  2414. <summary>A constant for use with the **GetSchema** method that represents the **ForeignKeys** collection.</summary><remarks>To be added.</remarks>
  2415. </member>
  2416. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.IndexColumns">
  2417. <summary>A constant for use with the **GetSchema** method that represents the **IndexColumns** collection.</summary><remarks>To be added.</remarks>
  2418. </member>
  2419. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Indexes">
  2420. <summary>A constant for use with the **GetSchema** method that represents the **Indexes** collection.</summary><remarks>To be added.</remarks>
  2421. </member>
  2422. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ProcedureParameters">
  2423. <summary>A constant for use with the **GetSchema** method that represents the **ProcedureParameters** collection.</summary><remarks>To be added.</remarks>
  2424. </member>
  2425. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Procedures">
  2426. <summary>A constant for use with the **GetSchema** method that represents the **Procedures** collection.</summary><remarks>To be added.</remarks>
  2427. </member>
  2428. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Tables">
  2429. <summary>A constant for use with the **GetSchema** method that represents the **Tables** collection.</summary><remarks>To be added.</remarks>
  2430. </member>
  2431. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.UserDefinedTypes">
  2432. <summary>A constant for use with the **GetSchema** method that represents the **UserDefinedTypes** collection.</summary><remarks>To be added.</remarks>
  2433. </member>
  2434. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Users">
  2435. <summary>A constant for use with the **GetSchema** method that represents the **Users** collection.</summary><remarks>To be added.</remarks>
  2436. </member>
  2437. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ViewColumns">
  2438. <summary>A constant for use with the **GetSchema** method that represents the **ViewColumns** collection.</summary><remarks>To be added.</remarks>
  2439. </member>
  2440. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Views">
  2441. <summary>A constant for use with the **GetSchema** method that represents the **Views** collection.</summary><remarks>To be added.</remarks>
  2442. </member>
  2443. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.AllColumns">
  2444. <summary>A constant for use with the **GetSchema** method that represents the **AllColumns** collection.</summary><remarks>To be added.</remarks>
  2445. </member>
  2446. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ColumnSetColumns">
  2447. <summary>A constant for use with the **GetSchema** method that represents the **ColumnSetColumns** collection.</summary><remarks>To be added.</remarks>
  2448. </member>
  2449. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.StructuredTypeMembers">
  2450. <summary>A constant for use with the **GetSchema** method that represents the **StructuredTypeMembers** collection.</summary><remarks>To be added.</remarks>
  2451. </member>
  2452. <member name="T:Microsoft.Data.SqlClient.SqlClientPermission">
  2453. <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>
  2454. <format type="text/markdown"><![CDATA[
  2455. ## Remarks
  2456. The <xref:System.Data.Common.DBDataPermission.IsUnrestricted%2A> property takes precedence over the <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> property.
  2457. Therefore, if you set <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> to `false`, you must also set <xref:System.Data.Common.DBDataPermission.IsUnrestricted%2A>
  2458. to `false` to prevent a user from making a connection using a blank password.
  2459. > [!NOTE]
  2460. > 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
  2461. 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,
  2462. 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
  2463. 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
  2464. holes in the permission set.
  2465. ]]></format>
  2466. </remarks>
  2467. </member>
  2468. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.#ctor">
  2469. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlClientPermission" /> class.</summary><remarks>To be added.</remarks>
  2470. </member>
  2471. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.#ctor(System.Security.Permissions.PermissionState)">
  2472. <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>
  2473. </member>
  2474. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.#ctor(System.Security.Permissions.PermissionState,System.Boolean)">
  2475. <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>
  2476. <format type="text/markdown"><![CDATA[
  2477. ## Remarks
  2478. The <xref:System.Security.Permissions.PermissionState> enumeration takes precedence over the <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> property.
  2479. 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
  2480. 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
  2481. ADO.NET](/dotnet/framework/data/adonet/code-access-security).
  2482. ]]></format>
  2483. </remarks><format type="text/markdown"><![CDATA[
  2484. ## Remarks
  2485. The <xref:System.Security.Permissions.PermissionState> enumeration takes precedence over the <xref:System.Data.Common.DBDataPermission.AllowBlankPassword%2A> property.
  2486. 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
  2487. 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
  2488. ADO.NET](/dotnet/framework/data/adonet/code-access-security).
  2489. ]]></format>
  2490. </member>
  2491. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.Add(System.String,System.String,System.Data.KeyRestrictionBehavior)">
  2492. <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>
  2493. <format type="text/markdown"><![CDATA[
  2494. ## Remarks
  2495. 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
  2496. connection string and nothing else:
  2497. `permission.Add("server=MyServer; database=MyDatabase; Integrated Security=true", "", KeyRestrictionBehavior.AllowOnly)`
  2498. 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
  2499. string keywords:
  2500. `permission.Add("server=MyServer;", "database=; user id=; password=;", KeyRestrictionBehavior.AllowOnly)`
  2501. 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:
  2502. `permission.Add("server=MyServer; failover partner=MyMirrorServer", "database=; user id=; password=;", KeyRestrictionBehavior.AllowOnly)`
  2503. > [!NOTE]
  2504. > 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
  2505. 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
  2506. 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",
  2507. 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.
  2508. ]]></format>
  2509. </remarks>
  2510. </member>
  2511. <member name="M:Microsoft.Data.SqlClient.SqlClientPermission.Copy">
  2512. <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>
  2513. </member>
  2514. <member name="T:Microsoft.Data.SqlClient.SqlClientPermissionAttribute">
  2515. <summary>Associates a security action with a custom security attribute.</summary><remarks>To be added.</remarks>
  2516. </member>
  2517. <member name="M:Microsoft.Data.SqlClient.SqlClientPermissionAttribute.#ctor(System.Security.Permissions.SecurityAction)">
  2518. <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>
  2519. </member>
  2520. <member name="M:Microsoft.Data.SqlClient.SqlClientPermissionAttribute.CreatePermission">
  2521. <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>
  2522. </member>
  2523. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider">
  2524. <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.
  2525. For details, see <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
  2526. </summary><remarks>To be added.</remarks>
  2527. </member>
  2528. <member name="F:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.ProviderName">
  2529. <summary>The provider name.</summary><remarks>To be added.</remarks>
  2530. </member>
  2531. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.#ctor">
  2532. <summary>Key store provider for Windows Certificate Store.</summary><remarks>To be added.</remarks>
  2533. </member>
  2534. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2535. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm. Currently, the only valid value is: <c>RSA_OAEP</c>
  2536. </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
  2537. algorithm. The format of the key path should be "Local Machine/My/&lt;certificate_thumbprint&gt;" or "Current User/My/&lt;certificate_thumbprint&gt;".
  2538. </summary><returns>Returns <see cref="T:System.Byte" />
  2539. . The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2540. </member>
  2541. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2542. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm. Currently, the only valid value is: <c>RSA_OAEP</c>
  2543. </param><param name="columnEncryptionKey">The plaintext 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
  2544. "Local Machine/My/&lt;certificate_thumbprint&gt;" or "Current User/My/&lt;certificate_thumbprint&gt;".
  2545. </summary><returns>Returns <see cref="T:System.Byte" />
  2546. . The encrypted column encryption key.</returns><remarks>To be added.</remarks>
  2547. </member>
  2548. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2549. <param name="masterKeyPath">The column master key path.</param><param name="allowEnclaveComputations">
  2550. <see langword="true" />
  2551. to indicate that the column master key supports enclave computations; otherwise, <see langword="false" />
  2552. .</param><summary>Digitally signs the column master key metadata with the column master key referenced by the <paramref name="masterKeyPath" />
  2553. parameter.</summary><returns>The signature of the column master key metadata.</returns><remarks>To be added.</remarks>
  2554. </member>
  2555. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCertificateStoreProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2556. <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>
  2557. </member>
  2558. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider">
  2559. <summary>The CMK Store provider implementation for using the Microsoft Cryptography API: Next Generation (CNG) with
  2560. <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
  2561. </summary><remarks>
  2562. <format type="text/markdown"><![CDATA[
  2563. ## Remarks
  2564. 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).
  2565. ]]></format>
  2566. </remarks>
  2567. </member>
  2568. <member name="F:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.ProviderName">
  2569. <summary>A constant string for the provider name 'MSSQL_CNG_STORE'.</summary><remarks>To be added.</remarks>
  2570. </member>
  2571. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.#ctor">
  2572. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider" /> class.</summary><remarks>To be added.</remarks>
  2573. </member>
  2574. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2575. <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
  2576. 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'.
  2577. </summary><returns>The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2578. </member>
  2579. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2580. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="columnEncryptionKey">The plaintext 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>
  2581. </member>
  2582. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2583. <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>
  2584. <format type="text/markdown"><![CDATA[
  2585. ## Remarks
  2586. The <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.SignColumnMasterKeyMetadata%2A> method must be implemented by the corresponding key store providers.
  2587. <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.SignColumnMasterKeyMetadata%2A> should use an asymmetric key identified by a key path and sign the masterkey metadata consisting
  2588. of `masterKeyPath`, `allowEnclaveComputations`, and providerName.
  2589. ]]></format>
  2590. </remarks>
  2591. </member>
  2592. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCngProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2593. <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>
  2594. </member>
  2595. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider">
  2596. <summary>The CMK Store provider implementation for using Microsoft CAPI based Cryptographic Service Providers (CSP) with
  2597. <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine">Always Encrypted</see>.
  2598. </summary><remarks>
  2599. <format type="text/markdown"><![CDATA[
  2600. ## Remarks
  2601. 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).
  2602. ]]></format>
  2603. </remarks>
  2604. </member>
  2605. <member name="F:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.ProviderName">
  2606. <summary>A constant string for the provider name 'MSSQL_CSP_PROVIDER'.</summary><remarks>To be added.</remarks>
  2607. </member>
  2608. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.#ctor">
  2609. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider" /> class.</summary><remarks>To be added.</remarks>
  2610. </member>
  2611. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2612. <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>
  2613. </member>
  2614. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2615. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="columnEncryptionKey">The plaintext 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>
  2616. </member>
  2617. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2618. <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>
  2619. <format type="text/markdown"><![CDATA[
  2620. ## Remarks
  2621. The <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.SignColumnMasterKeyMetadata%2A> method must be implemented by the corresponding key store providers.
  2622. <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.SignColumnMasterKeyMetadata%2A> should use an asymmetric key identified by a key path and sign the masterkey metadata
  2623. consisting of `masterKeyPath`, `allowEnclaveComputations`, and providerName.
  2624. ]]></format>
  2625. </remarks>
  2626. </member>
  2627. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionCspProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2628. <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>
  2629. </member>
  2630. <member name="T:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider">
  2631. <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
  2632. <see cref="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProviders(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})" />,
  2633. <see cref="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProvidersOnConnection(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})" /> or
  2634. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.RegisterColumnEncryptionKeyStoreProvidersOnCommand(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})" />.
  2635. For details see, <see href="https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine"> Always Encrypted</see>.
  2636. </summary>
  2637. </member>
  2638. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.#ctor">
  2639. <summary>Initializes a new instance of the SqlColumnEncryptionKeyStoreProviderClass.</summary><remarks>To be added.</remarks>
  2640. </member>
  2641. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.DecryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2642. <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.
  2643. </summary><returns>Returns <see cref="T:System.Byte" />. The decrypted column encryption key.</returns><remarks>To be added.</remarks>
  2644. </member>
  2645. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.EncryptColumnEncryptionKey(System.String,System.String,System.Byte[])">
  2646. <param name="masterKeyPath">The master key path.</param><param name="encryptionAlgorithm">The encryption algorithm.</param><param name="columnEncryptionKey">The plaintext 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>
  2647. </member>
  2648. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata(System.String,System.Boolean)">
  2649. <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.
  2650. </summary><returns>The signature of the column master key metadata.</returns><remarks>
  2651. <format type="text/markdown"><![CDATA[
  2652. ## Remarks
  2653. 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
  2654. <xref:System.NotImplementedException> exception by default.
  2655. The <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata%2A> method will be used by client tools that generate Column Master Keys (CMK) for customers.
  2656. <xref:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.SignColumnMasterKeyMetadata%2A> must be implemented by the corresponding key store providers that wish to use enclaves with
  2657. [Always Encrypted](https://docs.microsoft.com/sql/relational-databases/security/encryption/always-encrypted-database-engine).
  2658. ]]></format>
  2659. </remarks><exception cref="T:System.NotImplementedException">In all cases.</exception>
  2660. </member>
  2661. <member name="M:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.VerifyColumnMasterKeyMetadata(System.String,System.Boolean,System.Byte[])">
  2662. <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>
  2663. </member>
  2664. <member name="P:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider.ColumnEncryptionKeyCacheTtl">
  2665. <summary>Gets or sets the lifespan of the decrypted column encryption key in the cache. Once the timespan has elapsed, the decrypted column encryption key is discarded and must be revalidated.</summary><remarks>
  2666. <format type="text/markdown"><![CDATA[
  2667. Internally, there is a cache of column encryption keys (once they are decrypted). This is useful for rapidly decrypting multiple data values. The default value is 2 hours. Setting this value to zero disables caching.
  2668. The column encryption keys decrypted by custom key store providers registered on a connection or command instance will not be cached. Custom key store providers should implement their own caching mechanism.
  2669. Caching implemented by custom key store providers will be disabled by the driver if the key store provider instance is registered using <xref:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProviders(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})>. Any caching implementation should reference the value of this property before caching a column encryption key and not cache it if the value is zero. This will avoid duplicate caching and possible user confusion when they are trying to configure key caching.
  2670. ]]></format>
  2671. </remarks>
  2672. </member>
  2673. <member name="T:Microsoft.Data.SqlClient.SqlCommand">
  2674. <summary>
  2675. Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
  2676. </summary><remarks>
  2677. <format type="text/markdown"><![CDATA[
  2678. ## Remarks
  2679. 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.
  2680. <xref:Microsoft.Data.SqlClient.SqlCommand> features the following methods for executing commands at a SQL Server database:
  2681. |Item|Description|
  2682. |----------|-----------------|
  2683. |<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.|
  2684. |<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.|
  2685. |<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.|
  2686. |<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.|
  2687. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>|Executes commands such as Transact-SQL INSERT, DELETE, UPDATE, and SET statements.|
  2688. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A>|Retrieves a single value (for example, an aggregate value) from a database.|
  2689. |<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.|
  2690. 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.
  2691. 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.
  2692. > [!NOTE]
  2693. > Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
  2694. ## Examples
  2695. 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.
  2696. [!code-csharp[SqlCommand Example#1](~/../sqlclient/doc/samples/SqlCommand.cs#1)]
  2697. The following sample shows how to create and execute different types of SqlCommand objects.
  2698. First you must create the sample database, by executing the following script:
  2699. [!code-sql[Setup Database](~/../sqlclient/doc/samples/SqlCommand_Setup.sql#1)]
  2700. Next, compile and execute the following:
  2701. [!code-csharp[SqlCommand Example#2](~/../sqlclient/doc/samples/SqlCommand_Intro.cs#1)]
  2702. ]]></format>
  2703. </remarks>
  2704. </member>
  2705. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor">
  2706. <summary>
  2707. Initializes a new instance of the
  2708. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2709. class.
  2710. </summary><remarks>
  2711. <format type="text/markdown"><![CDATA[
  2712. ## Remarks
  2713. 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>.
  2714. |Properties|Initial value|
  2715. |----------------|-------------------|
  2716. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|empty string ("")|
  2717. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2718. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2719. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|Null|
  2720. You can change the value for any of these properties through a separate call to the property.
  2721. ## Examples
  2722. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets the `CommandTimeout` property.
  2723. [!code-csharp[Classic WebData IDbCommand_CommandTimeout.cs](~/../sqlclient/doc/samples/IDbCommand_CommandTimeout.cs)]
  2724. ]]></format>
  2725. </remarks>
  2726. </member>
  2727. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String)">
  2728. <param name="cmdText">
  2729. The text of the query.
  2730. </param><summary>
  2731. Initializes a new instance of the
  2732. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2733. class with the text of the query.
  2734. </summary><remarks>
  2735. <format type="text/markdown"><![CDATA[
  2736. ## Remarks
  2737. When an instance of <xref:Microsoft.Data.SqlClient.SqlCommand> is created, the following read/write properties are set to initial values.
  2738. |Properties|Initial value|
  2739. |----------------|-------------------|
  2740. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2741. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2742. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2743. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|null|
  2744. You can change the value for any of these properties through a separate call to the property.
  2745. ## Examples
  2746. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand>, passing in the connection string and command text.
  2747. [!code-csharp[SqlCommand_SqlCommand1](~/../sqlclient/doc/samples/SqlCommand_SqlCommand1.cs#1)]
  2748. ]]></format>
  2749. </remarks>
  2750. </member>
  2751. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)">
  2752. <param name="cmdText">
  2753. The text of the query.
  2754. </param><param name="connection">
  2755. A
  2756. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2757. that represents the connection to an instance of SQL Server.
  2758. </param><summary>
  2759. Initializes a new instance of the
  2760. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2761. class with the text of the query and a
  2762. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2763. .
  2764. </summary><remarks>
  2765. <format type="text/markdown"><![CDATA[
  2766. ## Remarks
  2767. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2768. |Properties|Initial value|
  2769. |----------------|-------------------|
  2770. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2771. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2772. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2773. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|A new <xref:Microsoft.Data.SqlClient.SqlConnection> that is the value for the `connection` parameter.|
  2774. You can change the value for any of these parameters by setting the related property.
  2775. ## Examples
  2776. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2777. [!code-csharp[SqlCommand_SqlCommand2.cs](~/../sqlclient/doc/samples/SqlCommand_SqlCommand2.cs#1)]
  2778. ]]></format>
  2779. </remarks>
  2780. </member>
  2781. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlTransaction)">
  2782. <param name="cmdText">
  2783. The text of the query.
  2784. </param><param name="connection">
  2785. A
  2786. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2787. that represents the connection to an instance of SQL Server.
  2788. </param><param name="transaction">
  2789. The
  2790. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2791. in which the
  2792. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2793. executes.
  2794. </param><summary>
  2795. Initializes a new instance of the
  2796. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2797. class with the text of the query, a
  2798. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2799. , and the
  2800. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2801. .
  2802. </summary><remarks>
  2803. <format type="text/markdown"><![CDATA[
  2804. ## Remarks
  2805. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2806. |Properties|Initial value|
  2807. |----------------|-------------------|
  2808. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2809. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2810. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2811. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|A new <xref:Microsoft.Data.SqlClient.SqlConnection> that is the value for the `connection` parameter.|
  2812. You can change the value for any of these parameters by setting the related property.
  2813. ]]></format>
  2814. </remarks>
  2815. </member>
  2816. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlTransaction,Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting)">
  2817. <param name="cmdText">
  2818. The text of the query.
  2819. </param><param name="connection">
  2820. A
  2821. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2822. that represents the connection to an instance of SQL Server.
  2823. </param><param name="transaction">
  2824. The
  2825. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2826. in which the
  2827. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2828. executes.
  2829. </param><param name="columnEncryptionSetting">
  2830. The encryption setting. For more information, see [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine).
  2831. </param><summary>
  2832. Initializes a new instance of the
  2833. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2834. class with specified command text, connection, transaction, and encryption setting.
  2835. </summary><remarks>
  2836. To be added.
  2837. </remarks>
  2838. </member>
  2839. <member name="P:Microsoft.Data.SqlClient.SqlCommand.ColumnEncryptionSetting">
  2840. <summary>
  2841. Gets the column encryption setting for this command.
  2842. </summary><value>
  2843. The column encryption setting for this command.
  2844. </value>
  2845. </member>
  2846. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandText">
  2847. <summary>
  2848. Gets or sets the Transact-SQL statement, table name or stored procedure to execute at the data source.
  2849. </summary><value>
  2850. The Transact-SQL statement or stored procedure to execute. The default is an empty string.
  2851. </value><remarks>
  2852. <format type="text/markdown"><![CDATA[
  2853. ## Remarks
  2854. 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.
  2855. 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:
  2856. ```sql
  2857. SELECT * FROM dbo.Customers WHERE CustomerID = @CustomerID
  2858. ```
  2859. For more information, see [Configuring parameters](/sql/connect/ado-net/configure-parameters).
  2860. ## Examples
  2861. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2862. [!code-csharp[SqlCommand_CommandText](~/../sqlclient/doc/samples/SqlCommand_CommandText.cs)]
  2863. ]]></format>
  2864. </remarks>
  2865. </member>
  2866. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout">
  2867. <summary>
  2868. 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.
  2869. </summary><value>
  2870. The time in seconds to wait for the command to execute. The default is 30 seconds.
  2871. </value><remarks>
  2872. <format type="text/markdown"><![CDATA[
  2873. ## Remarks
  2874. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).
  2875. > [!NOTE]
  2876. > 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>.
  2877. > [!NOTE]
  2878. > 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.
  2879. 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.
  2880. [!code-csharp[SqlCommand CommandTimeout](~/../sqlclient/doc/samples/SqlCommand_CommandTimeout.cs)]
  2881. ]]></format>
  2882. </remarks><exception cref="T:System.ArgumentException">The value set is less than 0.</exception>
  2883. </member>
  2884. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandType">
  2885. <summary>
  2886. Gets or sets a value indicating how the
  2887. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  2888. property is to be interpreted.
  2889. </summary><value>
  2890. One of the
  2891. <see cref="T:System.Data.CommandType" />
  2892. values. The default is
  2893. <see langword="Text" />
  2894. .
  2895. </value><remarks>
  2896. <format type="text/markdown"><![CDATA[
  2897. ## Remarks
  2898. 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.
  2899. 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:
  2900. SELECT * FROM Customers WHERE CustomerID = @CustomerID
  2901. For more information, see [Configuring parameters](/sql/connect/ado-net/configure-parameters).
  2902. ## Examples
  2903. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2904. [!code-csharp[IDbCommand_CommandTimeout](~/../sqlclient/doc/samples/IDbCommand_CommandTimeout.cs)]
  2905. ]]></format>
  2906. </remarks>
  2907. </member>
  2908. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Connection">
  2909. <summary>
  2910. Gets or sets the
  2911. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2912. used by this instance of the
  2913. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2914. .
  2915. </summary><value>
  2916. The connection to a data source. The default value is
  2917. <see langword="null" />
  2918. .
  2919. </value><remarks>
  2920. <format type="text/markdown"><![CDATA[
  2921. ## Remarks
  2922. 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>.
  2923. 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.
  2924. ## Examples
  2925. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2926. [!code-csharp[SqlCommand_Connection](~/../sqlclient/doc/samples/SqlCommand_Connection.cs)]
  2927. ]]></format>
  2928. </remarks><exception cref="T:System.InvalidOperationException">
  2929. The
  2930. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  2931. property was changed while the command was enlisted in a transaction.
  2932. </exception>
  2933. </member>
  2934. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbConnection">
  2935. <summary>
  2936. To be added.
  2937. </summary><value>
  2938. To be added.
  2939. </value><remarks>
  2940. To be added.
  2941. </remarks>
  2942. </member>
  2943. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbParameterCollection">
  2944. <summary>
  2945. To be added.
  2946. </summary><value>
  2947. To be added.
  2948. </value><remarks>
  2949. To be added.
  2950. </remarks>
  2951. </member>
  2952. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbTransaction">
  2953. <summary>
  2954. To be added.
  2955. </summary><value>
  2956. To be added.
  2957. </value><remarks>
  2958. To be added.
  2959. </remarks>
  2960. </member>
  2961. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DesignTimeVisible">
  2962. <summary>
  2963. Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.
  2964. </summary><value>
  2965. A value indicating whether the command object should be visible in a control. The default is
  2966. <see langword="true" />
  2967. .
  2968. </value><remarks>
  2969. To be added.
  2970. </remarks>
  2971. </member>
  2972. <member name="P:Microsoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding">
  2973. <summary>
  2974. Gets or sets a value indicating whether the command object should optimize parameter performance by disabling Output and InputOutput directions when submitting the command to the SQL Server.
  2975. </summary><value>
  2976. A value indicating whether the command object should optimize parameter performance by disabling Output and InputOuput parameter directions when submitting the command to the SQL Server.
  2977. The default is <see langword="false" />.
  2978. </value><remarks>
  2979. <format type="text/markdown">
  2980. <![CDATA[
  2981. ## Remarks
  2982. You must set the value for this property before the command is executed for it to take effect.
  2983. When a command is submitted to the server with parameters a list of the parameter names is sent as part of the submission. The list is used on the server to match Output and InputOutput parameters to the results of the query execution so that the values can be returned to the caller. This option disables the construction and submission of the parameter name list and as a consequence disables the use of Output and InputOutput parameters. The return parameter is not affected by this option.
  2984. A command sent with this option changes the way parameters are handled on the server, because there is no need to maintain an output parameter map. The result of this change is that queries with large numbers of input parameters may execute much faster.
  2985. The fewest number of parameters where this will take effect depends on the individual situation and should be detected by measuring query duration with and without the option enabled. Any query with more than 24 parameters may show lower overall query duration. Queries with parameter counts lower than 24 are unlikely to show a difference.
  2986. > [!NOTE]
  2987. If the option is enabled and a parameter with Direction Output or InputOutput is present in the Parameters collection an InvalidOperationException will be thrown when the command is executed.
  2988. ]]>
  2989. </format>
  2990. </remarks>
  2991. </member>
  2992. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Parameters">
  2993. <summary>
  2994. Gets the
  2995. <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />
  2996. .
  2997. </summary><value>
  2998. The parameters of the Transact-SQL statement or stored procedure. The default is an empty collection.
  2999. </value><remarks>
  3000. <format type="text/markdown"><![CDATA[
  3001. ## Remarks
  3002. 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:
  3003. SELECT * FROM Customers WHERE CustomerID = @CustomerID
  3004. > [!NOTE]
  3005. > If the parameters in the collection do not match the requirements of the query to be executed, an error may result.
  3006. For more information, see [Configuring parameters](/sql/connect/ado-net/configure-parameters).
  3007. ## Examples
  3008. The following example demonstrates how to create a <xref:Microsoft.Data.SqlClient.SqlCommand> and add parameters to the <xref:Microsoft.Data.SqlClient.SqlParameterCollection>.
  3009. [!code-csharp[SqlParameterCollection.AddWithValue#1](~/../sqlclient/doc/samples/SqlParameterCollection_AddWithValue.cs#1)]
  3010. ]]></format>
  3011. </remarks>
  3012. </member>
  3013. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Transaction">
  3014. <summary>
  3015. Gets or sets the
  3016. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  3017. within which the
  3018. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3019. executes.
  3020. </summary><value>
  3021. The
  3022. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  3023. . The default value is
  3024. <see langword="null" />
  3025. .
  3026. </value><remarks>
  3027. <format type="text/markdown"><![CDATA[
  3028. ## Remarks
  3029. 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.
  3030. ]]></format>
  3031. </remarks>
  3032. </member>
  3033. <member name="P:Microsoft.Data.SqlClient.SqlCommand.UpdatedRowSource">
  3034. <summary>
  3035. 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" />.
  3036. </summary><value>
  3037. One of the <see cref="T:System.Data.UpdateRowSource" /> values.
  3038. </value><remarks>
  3039. <format type="text/markdown"><![CDATA[
  3040. ## Remarks
  3041. 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**.
  3042. For more information about using the **UpdatedRowSource** property, see [DataAdapter Parameters](/sql/connect/ado-net/dataadapter-parameters).
  3043. ]]></format>
  3044. </remarks>
  3045. </member>
  3046. <member name="E:Microsoft.Data.SqlClient.SqlCommand.StatementCompleted">
  3047. <summary>
  3048. Occurs when the execution of a Transact-SQL statement completes.
  3049. </summary><remarks>
  3050. To be added.
  3051. </remarks>
  3052. </member>
  3053. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery">
  3054. <summary>
  3055. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3056. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3057. .
  3058. </summary><returns>
  3059. An
  3060. <see cref="T:System.IAsyncResult" />
  3061. that can be used to poll or wait for results, or both; this value is also needed when invoking
  3062. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3063. , which returns the number of affected rows.
  3064. </returns><remarks>
  3065. <format type="text/markdown"><![CDATA[
  3066. ## Remarks
  3067. 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.
  3068. 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.
  3069. 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>.
  3070. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3071. ## Examples
  3072. 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.
  3073. [!code-csharp[SqlCommand_BeginExecuteNonQuery](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteNonQuery.cs)]
  3074. ]]></format>
  3075. </remarks><exception cref="T:System.InvalidCastException">
  3076. A
  3077. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3078. other than **Binary** or **VarBinary** was used when
  3079. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3080. was set to
  3081. <see cref="T:System.IO.Stream" />
  3082. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3083. -or-
  3084. A
  3085. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3086. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3087. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3088. was set to
  3089. <see cref="T:System.IO.TextReader" />
  3090. .
  3091. -or-
  3092. A
  3093. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3094. other than **Xml** was used when
  3095. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3096. was set to
  3097. <see cref="T:System.Xml.XmlReader" />
  3098. .
  3099. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3100. Any error that occurred while executing the command text.
  3101. -or-
  3102. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3103. </exception><exception cref="T:System.InvalidOperationException">
  3104. The
  3105. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3106. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3107. - or -
  3108. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3109. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3110. </exception><exception cref="T:System.IO.IOException">
  3111. An error occurred in a
  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 during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3118. </exception><exception cref="T:System.ObjectDisposedException">
  3119. The
  3120. <see cref="T:System.IO.Stream" />
  3121. ,
  3122. <see cref="T:System.Xml.XmlReader" />
  3123. or
  3124. <see cref="T:System.IO.TextReader" />
  3125. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3126. </exception>
  3127. </member>
  3128. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(System.AsyncCallback,System.Object)">
  3129. <param name="callback">
  3130. An
  3131. <see cref="T:System.AsyncCallback" />
  3132. delegate that is invoked when the command's execution has completed. Pass
  3133. <see langword="null" />
  3134. (
  3135. <see langword="Nothing" />
  3136. in Microsoft Visual Basic) to indicate that no callback is required.
  3137. </param><param name="stateObject">
  3138. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  3139. <see cref="P:System.IAsyncResult.AsyncState" />
  3140. property.
  3141. </param><summary>
  3142. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3143. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3144. , given a callback procedure and state information.
  3145. </summary><returns>
  3146. An
  3147. <see cref="T:System.IAsyncResult" />
  3148. that can be used to poll or wait for results, or both; this value is also needed when invoking
  3149. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3150. , which returns the number of affected rows.
  3151. </returns><remarks>
  3152. <format type="text/markdown"><![CDATA[
  3153. ## Remarks
  3154. 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.
  3155. 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.
  3156. 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.
  3157. 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.
  3158. 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.
  3159. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3160. ## Examples
  3161. 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).
  3162. 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.
  3163. 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.
  3164. [!code-csharp[DataWorks SqlCommand_BeginExecuteNonQueryForm#1](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteNonQueryForm.cs)]
  3165. ]]></format>
  3166. </remarks><exception cref="T:System.InvalidCastException">
  3167. A
  3168. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3169. other than **Binary** or **VarBinary** was used when
  3170. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3171. was set to
  3172. <see cref="T:System.IO.Stream" />
  3173. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3174. -or-
  3175. A
  3176. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3177. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3178. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3179. was set to
  3180. <see cref="T:System.IO.TextReader" />
  3181. .
  3182. -or-
  3183. A
  3184. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3185. other than **Xml** was used when
  3186. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3187. was set to
  3188. <see cref="T:System.Xml.XmlReader" />
  3189. .
  3190. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3191. Any error that occurred while executing the command text.
  3192. -or-
  3193. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3194. </exception><exception cref="T:System.InvalidOperationException">
  3195. The
  3196. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3197. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3198. - or -
  3199. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3200. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3201. </exception>
  3202. </member>
  3203. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader">
  3204. <summary>
  3205. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3206. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3207. , and retrieves one or more result sets from the server.
  3208. </summary><returns>
  3209. An
  3210. <see cref="T:System.IAsyncResult" />
  3211. that can be used to poll or wait for results, or both; this value is also needed when invoking
  3212. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3213. , which returns a
  3214. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3215. instance that can be used to retrieve the returned rows.
  3216. </returns><remarks>
  3217. <format type="text/markdown"><![CDATA[
  3218. ## Remarks
  3219. 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.
  3220. 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.
  3221. 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>.
  3222. 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.
  3223. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3224. ## Examples
  3225. 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.
  3226. [!code-csharp[SqlCommand_BeginExecuteReader#1](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReader.cs)]
  3227. ]]></format>
  3228. </remarks><exception cref="T:System.InvalidCastException">
  3229. A
  3230. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3231. other than **Binary** or **VarBinary** was used when
  3232. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3233. was set to
  3234. <see cref="T:System.IO.Stream" />
  3235. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3236. -or-
  3237. A
  3238. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3239. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3240. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3241. was set to
  3242. <see cref="T:System.IO.TextReader" />
  3243. .
  3244. -or-
  3245. A
  3246. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3247. other than **Xml** was used when
  3248. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3249. was set to
  3250. <see cref="T:System.Xml.XmlReader" />
  3251. .
  3252. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3253. Any error that occurred while executing the command text.
  3254. -or-
  3255. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3256. </exception><exception cref="T:System.InvalidOperationException">
  3257. The
  3258. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3259. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3260. - or -
  3261. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3262. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3263. </exception><exception cref="T:System.IO.IOException">
  3264. An error occurred in a
  3265. <see cref="T:System.IO.Stream" />
  3266. ,
  3267. <see cref="T:System.Xml.XmlReader" />
  3268. or
  3269. <see cref="T:System.IO.TextReader" />
  3270. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3271. </exception><exception cref="T:System.ObjectDisposedException">
  3272. The
  3273. <see cref="T:System.IO.Stream" />
  3274. ,
  3275. <see cref="T:System.Xml.XmlReader" />
  3276. or
  3277. <see cref="T:System.IO.TextReader" />
  3278. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3279. </exception>
  3280. </member>
  3281. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.AsyncCallback,System.Object)">
  3282. <param name="callback">
  3283. An
  3284. <see cref="T:System.AsyncCallback" />
  3285. delegate that is invoked when the command's execution has completed. Pass
  3286. <see langword="null" />
  3287. (
  3288. <see langword="Nothing" />
  3289. in Microsoft Visual Basic) to indicate that no callback is required.
  3290. </param><param name="stateObject">
  3291. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  3292. <see cref="P:System.IAsyncResult.AsyncState" />
  3293. property.
  3294. </param><summary>
  3295. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3296. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3297. and retrieves one or more result sets from the server, given a callback procedure and state information.
  3298. </summary><returns>
  3299. An
  3300. <see cref="T:System.IAsyncResult" />
  3301. that can be used to poll, wait for results, or both; this value is also needed when invoking
  3302. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3303. , which returns a
  3304. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3305. instance which can be used to retrieve the returned rows.
  3306. </returns><remarks>
  3307. <format type="text/markdown"><![CDATA[
  3308. ## Remarks
  3309. 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.
  3310. 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.
  3311. 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.
  3312. 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.
  3313. 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.
  3314. 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.
  3315. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3316. ## Examples
  3317. 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>.
  3318. 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.
  3319. 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.
  3320. [!code-csharp[SqlCommand_BeginExecuteReaderAsync.cs](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsync.cs)]
  3321. ]]></format>
  3322. </remarks><exception cref="T:System.InvalidCastException">
  3323. A
  3324. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3325. other than **Binary** or **VarBinary** was used when
  3326. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3327. was set to
  3328. <see cref="T:System.IO.Stream" />
  3329. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3330. -or-
  3331. A
  3332. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3333. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3334. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3335. was set to
  3336. <see cref="T:System.IO.TextReader" />
  3337. .
  3338. -or-
  3339. A
  3340. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3341. other than **Xml** was used when
  3342. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3343. was set to
  3344. <see cref="T:System.Xml.XmlReader" />
  3345. .
  3346. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3347. Any error that occurred while executing the command text.
  3348. -or-
  3349. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3350. </exception><exception cref="T:System.InvalidOperationException">
  3351. The
  3352. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3353. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3354. - or -
  3355. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3356. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3357. </exception><exception cref="T:System.IO.IOException">
  3358. An error occurred in a
  3359. <see cref="T:System.IO.Stream" />
  3360. ,
  3361. <see cref="T:System.Xml.XmlReader" />
  3362. or
  3363. <see cref="T:System.IO.TextReader" />
  3364. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3365. </exception><exception cref="T:System.ObjectDisposedException">
  3366. The
  3367. <see cref="T:System.IO.Stream" />
  3368. ,
  3369. <see cref="T:System.Xml.XmlReader" />
  3370. or
  3371. <see cref="T:System.IO.TextReader" />
  3372. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3373. </exception>
  3374. </member>
  3375. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.AsyncCallback,System.Object,System.Data.CommandBehavior)">
  3376. <param name="callback">
  3377. An
  3378. <see cref="T:System.AsyncCallback" />
  3379. delegate that is invoked when the command's execution has completed. Pass
  3380. <see langword="null" />
  3381. (
  3382. <see langword="Nothing" />
  3383. in Microsoft Visual Basic) to indicate that no callback is required.
  3384. </param><param name="stateObject">
  3385. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  3386. <see cref="P:System.IAsyncResult.AsyncState" />
  3387. property.
  3388. </param><param name="behavior">
  3389. One of the
  3390. <see cref="T:System.Data.CommandBehavior" />
  3391. values, indicating options for statement execution and data retrieval.
  3392. </param><summary>
  3393. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3394. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3395. , using one of the
  3396. <see langword="CommandBehavior" />
  3397. values, and retrieving one or more result sets from the server, given a callback procedure and state information.
  3398. </summary><returns>
  3399. An
  3400. <see cref="T:System.IAsyncResult" />
  3401. that can be used to poll or wait for results, or both; this value is also needed when invoking
  3402. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3403. , which returns a
  3404. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3405. instance which can be used to retrieve the returned rows.
  3406. </returns><remarks>
  3407. <format type="text/markdown"><![CDATA[
  3408. ## Remarks
  3409. 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.
  3410. 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.
  3411. 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.
  3412. 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.
  3413. 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.
  3414. 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.
  3415. 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.
  3416. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3417. ## Examples
  3418. 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>.
  3419. 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.
  3420. 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.
  3421. 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.
  3422. [!code-csharp[SqlCommand_BeginExecuteReaderAsyncBehavior](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs)]
  3423. ]]></format>
  3424. </remarks><exception cref="T:System.InvalidCastException">
  3425. A
  3426. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3427. other than **Binary** or **VarBinary** was used when
  3428. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3429. was set to
  3430. <see cref="T:System.IO.Stream" />
  3431. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3432. -or-
  3433. A
  3434. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3435. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3436. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3437. was set to
  3438. <see cref="T:System.IO.TextReader" />
  3439. .
  3440. -or-
  3441. A
  3442. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3443. other than **Xml** was used when
  3444. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3445. was set to
  3446. <see cref="T:System.Xml.XmlReader" />
  3447. .
  3448. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3449. Any error that occurred while executing the command text.
  3450. -or-
  3451. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3452. </exception><exception cref="T:System.InvalidOperationException">
  3453. The
  3454. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3455. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3456. - or -
  3457. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3458. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3459. </exception><exception cref="T:System.IO.IOException">
  3460. An error occurred in a
  3461. <see cref="T:System.IO.Stream" />
  3462. ,
  3463. <see cref="T:System.Xml.XmlReader" />
  3464. or
  3465. <see cref="T:System.IO.TextReader" />
  3466. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3467. </exception><exception cref="T:System.ObjectDisposedException">
  3468. The
  3469. <see cref="T:System.IO.Stream" />
  3470. ,
  3471. <see cref="T:System.Xml.XmlReader" />
  3472. or
  3473. <see cref="T:System.IO.TextReader" />
  3474. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3475. </exception>
  3476. </member>
  3477. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.Data.CommandBehavior)">
  3478. <param name="behavior">
  3479. One of the
  3480. <see cref="T:System.Data.CommandBehavior" />
  3481. values, indicating options for statement execution and data retrieval.
  3482. </param><summary>
  3483. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3484. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3485. using one of the
  3486. <see cref="T:System.Data.CommandBehavior" />
  3487. values.
  3488. </summary><returns>
  3489. An
  3490. <see cref="T:System.IAsyncResult" />
  3491. that can be used to poll, wait for results, or both; this value is also needed when invoking
  3492. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3493. , which returns a
  3494. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3495. instance that can be used to retrieve the returned rows.
  3496. </returns><remarks>
  3497. <format type="text/markdown"><![CDATA[
  3498. ## Remarks
  3499. 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.
  3500. 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.
  3501. 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.
  3502. 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>.
  3503. 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.
  3504. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3505. ## Examples
  3506. 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.
  3507. 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.
  3508. [!code-csharp[SqlCommand_BeginExecuteReaderAsyncSimple](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsyncSimple.cs)]
  3509. ]]></format>
  3510. </remarks><exception cref="T:System.InvalidCastException">
  3511. A
  3512. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3513. other than **Binary** or **VarBinary** was used when
  3514. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3515. was set to
  3516. <see cref="T:System.IO.Stream" />
  3517. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3518. -or-
  3519. A
  3520. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3521. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3522. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3523. was set to
  3524. <see cref="T:System.IO.TextReader" />
  3525. .
  3526. -or-
  3527. A
  3528. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3529. other than **Xml** was used when
  3530. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3531. was set to
  3532. <see cref="T:System.Xml.XmlReader" />
  3533. .
  3534. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3535. Any error that occurred while executing the command text.
  3536. -or-
  3537. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3538. </exception><exception cref="T:System.InvalidOperationException">
  3539. The
  3540. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3541. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3542. - or -
  3543. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3544. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3545. </exception><exception cref="T:System.IO.IOException">
  3546. An error occurred in a
  3547. <see cref="T:System.IO.Stream" />
  3548. ,
  3549. <see cref="T:System.Xml.XmlReader" />
  3550. or
  3551. <see cref="T:System.IO.TextReader" />
  3552. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3553. </exception><exception cref="T:System.ObjectDisposedException">
  3554. The
  3555. <see cref="T:System.IO.Stream" />
  3556. ,
  3557. <see cref="T:System.Xml.XmlReader" />
  3558. or
  3559. <see cref="T:System.IO.TextReader" />
  3560. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3561. </exception>
  3562. </member>
  3563. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader">
  3564. <summary>
  3565. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3566. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3567. and returns results as an
  3568. <see cref="T:System.Xml.XmlReader" />
  3569. object.
  3570. </summary><returns>
  3571. An
  3572. <see cref="T:System.IAsyncResult" />
  3573. that can be used to poll or wait for results, or both; this value is also needed when invoking
  3574. <see langword="EndExecuteXmlReader" />
  3575. , which returns a single XML value.
  3576. </returns><remarks>
  3577. <format type="text/markdown"><![CDATA[
  3578. ## Remarks
  3579. 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.
  3580. 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.
  3581. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> query can be formatted as in the following C# example:
  3582. ```csharp
  3583. SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM dbo.Contact FOR XML AUTO, XMLDATA", SqlConn);
  3584. ```
  3585. 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.
  3586. The multiple active result set (MARS) feature lets multiple actions use the same connection.
  3587. 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.
  3588. 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>.
  3589. 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.
  3590. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3591. ## Examples
  3592. 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.
  3593. [!code-csharp[SqlCommand_BeginExecuteXmlReader#1]((~/../sqlclient/doc/samples/SqlCommand_BeginExecuteXmlReader.cs)]
  3594. ]]></format>
  3595. </remarks><exception cref="T:System.InvalidCastException">
  3596. A
  3597. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3598. other than **Binary** or **VarBinary** was used when
  3599. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3600. was set to
  3601. <see cref="T:System.IO.Stream" />
  3602. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3603. -or-
  3604. A
  3605. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3606. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3607. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3608. was set to
  3609. <see cref="T:System.IO.TextReader" />
  3610. .
  3611. -or-
  3612. A
  3613. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3614. other than **Xml** was used when
  3615. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3616. was set to
  3617. <see cref="T:System.Xml.XmlReader" />
  3618. .
  3619. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3620. Any error that occurred while executing the command text.
  3621. -or-
  3622. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3623. </exception><exception cref="T:System.InvalidOperationException">
  3624. The
  3625. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3626. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3627. - or -
  3628. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3629. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3630. </exception><exception cref="T:System.IO.IOException">
  3631. An error occurred in a
  3632. <see cref="T:System.IO.Stream" />
  3633. ,
  3634. <see cref="T:System.Xml.XmlReader" />
  3635. or
  3636. <see cref="T:System.IO.TextReader" />
  3637. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3638. </exception><exception cref="T:System.ObjectDisposedException">
  3639. The
  3640. <see cref="T:System.IO.Stream" />
  3641. ,
  3642. <see cref="T:System.Xml.XmlReader" />
  3643. or
  3644. <see cref="T:System.IO.TextReader" />
  3645. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3646. </exception>
  3647. </member>
  3648. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader(System.AsyncCallback,System.Object)">
  3649. <param name="callback">
  3650. An
  3651. <see cref="T:System.AsyncCallback" />
  3652. delegate that is invoked when the command's execution has completed. Pass
  3653. <see langword="null" />
  3654. (
  3655. <see langword="Nothing" />
  3656. in Microsoft Visual Basic) to indicate that no callback is required.
  3657. </param><param name="stateObject">
  3658. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  3659. <see cref="P:System.IAsyncResult.AsyncState" />
  3660. property.
  3661. </param><summary>
  3662. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  3663. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3664. and returns results as an
  3665. <see cref="T:System.Xml.XmlReader" />
  3666. object, using a callback procedure.
  3667. </summary><returns>
  3668. An
  3669. <see cref="T:System.IAsyncResult" />
  3670. that can be used to poll, wait for results, or both; this value is also needed when the
  3671. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3672. is called, which returns the results of the command as XML.
  3673. </returns><remarks>
  3674. <format type="text/markdown"><![CDATA[
  3675. ## Remarks
  3676. 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.
  3677. 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.
  3678. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> query can be formatted as in the following C# example:
  3679. ```csharp
  3680. SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM Contact FOR XML AUTO, XMLDATA", SqlConn);
  3681. ```
  3682. 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.
  3683. The multiple active result set (MARS) feature lets multiple actions use the same connection.
  3684. 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.
  3685. 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.
  3686. 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.
  3687. 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.
  3688. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  3689. ## Examples
  3690. 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>.
  3691. 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.
  3692. 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.
  3693. [!code-csharp[SqlCommand_BeginExecuteXmlReaderAsync](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteXmlReaderAsync.cs)]
  3694. ]]></format>
  3695. </remarks><exception cref="T:System.InvalidCastException">
  3696. A
  3697. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3698. other than **Binary** or **VarBinary** was used when
  3699. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3700. was set to
  3701. <see cref="T:System.IO.Stream" />
  3702. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3703. -or-
  3704. A
  3705. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3706. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3707. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3708. was set to
  3709. <see cref="T:System.IO.TextReader" />
  3710. .
  3711. -or-
  3712. A
  3713. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3714. other than **Xml** was used when
  3715. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3716. was set to
  3717. <see cref="T:System.Xml.XmlReader" />
  3718. .
  3719. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3720. Any error that occurred while executing the command text.
  3721. -or-
  3722. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3723. </exception><exception cref="T:System.InvalidOperationException">
  3724. The
  3725. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3726. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3727. - or -
  3728. <see cref="P:Microssoft.Data.SqlClient.SqlCommand.EnableOptimizedParameterBinding" />
  3729. is set to true and a parameter with direction Output or InputOutput has been added to the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Parameters" /> collection.
  3730. </exception><exception cref="T:System.IO.IOException">
  3731. An error occurred in a
  3732. <see cref="T:System.IO.Stream" />
  3733. ,
  3734. <see cref="T:System.Xml.XmlReader" />
  3735. or
  3736. <see cref="T:System.IO.TextReader" />
  3737. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3738. </exception><exception cref="T:System.ObjectDisposedException">
  3739. The
  3740. <see cref="T:System.IO.Stream" />
  3741. ,
  3742. <see cref="T:System.Xml.XmlReader" />
  3743. or
  3744. <see cref="T:System.IO.TextReader" />
  3745. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3746. </exception><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  3747. </member>
  3748. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Cancel">
  3749. <summary>
  3750. Tries to cancel the execution of a
  3751. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3752. .
  3753. </summary><remarks>
  3754. <format type="text/markdown"><![CDATA[
  3755. ## Remarks
  3756. 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.
  3757. 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.
  3758. ## Examples
  3759. The following example demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
  3760. [!code-csharp[SqlCommand_Cancel](~/../sqlclient/doc/samples/SqlCommand_Cancel.cs)]
  3761. ]]></format>
  3762. </remarks>
  3763. </member>
  3764. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Clone">
  3765. <summary>
  3766. Creates a new
  3767. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3768. object that is a copy of the current instance.
  3769. </summary><returns>
  3770. A new
  3771. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  3772. object that is a copy of this instance.
  3773. </returns><remarks>
  3774. To be added.
  3775. </remarks>
  3776. </member>
  3777. <member name="M:Microsoft.Data.SqlClient.SqlCommand.CreateDbParameter">
  3778. <summary>
  3779. To be added.
  3780. </summary><returns>
  3781. To be added.
  3782. </returns><remarks>
  3783. To be added.
  3784. </remarks>
  3785. </member>
  3786. <member name="M:Microsoft.Data.SqlClient.SqlCommand.CreateParameter">
  3787. <summary>
  3788. Creates a new instance of a
  3789. <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />
  3790. object.
  3791. </summary><returns>
  3792. A
  3793. <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />
  3794. object.
  3795. </returns><remarks>
  3796. <format type="text/markdown"><![CDATA[
  3797. ## Remarks
  3798. The <xref:Microsoft.Data.SqlClient.SqlCommand.CreateParameter%2A> method is a strongly-typed version of <xref:System.Data.IDbCommand.CreateParameter%2A>.
  3799. ]]></format>
  3800. </remarks><summary>
  3801. Creates a new instance of a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  3802. </summary><returns>
  3803. A <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  3804. </returns><remarks>
  3805. To be added.
  3806. </remarks>
  3807. </member>
  3808. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Dispose(System.Boolean)">
  3809. <param name="disposing">
  3810. To be added.
  3811. </param><summary>
  3812. To be added.
  3813. </summary><remarks>
  3814. To be added.
  3815. </remarks>
  3816. </member>
  3817. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)">
  3818. <param name="asyncResult">
  3819. The
  3820. <see cref="T:System.IAsyncResult" />
  3821. returned by the call to
  3822. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3823. .
  3824. </param><summary>
  3825. Finishes asynchronous execution of a Transact-SQL statement.
  3826. </summary><returns>
  3827. The number of rows affected (the same behavior as
  3828. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery" />
  3829. ).
  3830. </returns><remarks>
  3831. <format type="text/markdown"><![CDATA[
  3832. ## Remarks
  3833. 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.
  3834. ## Examples
  3835. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery>.
  3836. ]]></format>
  3837. </remarks><exception cref="T:System.ArgumentException">
  3838. <paramref name="asyncResult" />
  3839. parameter is null (
  3840. <see langword="Nothing" />
  3841. in Microsoft Visual Basic)
  3842. </exception><exception cref="T:System.InvalidOperationException">
  3843. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3844. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3845. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3846. to complete execution of a call to
  3847. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3848. .
  3849. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3850. The amount of time specified in
  3851. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" />
  3852. elapsed and the asynchronous operation specified with
  3853. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3854. is not complete.
  3855. -or-
  3856. In some situations,
  3857. <see cref="T:System.IAsyncResult" />
  3858. can be set to
  3859. <see langword="IsCompleted" />
  3860. incorrectly. If this occurs and
  3861. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3862. is called, EndExecuteNonQuery could raise a SqlException error if the amount of time specified in
  3863. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" />
  3864. elapsed and the asynchronous operation specified with
  3865. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3866. 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.
  3867. </exception>
  3868. </member>
  3869. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)">
  3870. <param name="asyncResult">
  3871. The
  3872. <see cref="T:System.IAsyncResult" />
  3873. returned by the call to
  3874. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader" />
  3875. .
  3876. </param><summary>
  3877. Finishes asynchronous execution of a Transact-SQL statement, returning the requested
  3878. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3879. .
  3880. </summary><returns>
  3881. A
  3882. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3883. object that can be used to retrieve the requested rows.
  3884. </returns><remarks>
  3885. <format type="text/markdown"><![CDATA[
  3886. ## Remarks
  3887. 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.
  3888. ## Examples
  3889. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>.
  3890. ]]></format>
  3891. </remarks><exception cref="T:System.ArgumentException">
  3892. <paramref name="asyncResult" />
  3893. parameter is null (
  3894. <see langword="Nothing" />
  3895. in Microsoft Visual Basic)
  3896. </exception><exception cref="T:System.InvalidOperationException">
  3897. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3898. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3899. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3900. to complete execution of a call to
  3901. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3902. .
  3903. </exception>
  3904. </member>
  3905. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)">
  3906. <param name="asyncResult">
  3907. The
  3908. <see cref="T:System.IAsyncResult" />
  3909. returned by the call to
  3910. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3911. .
  3912. </param><summary>
  3913. Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.
  3914. </summary><returns>
  3915. An
  3916. <see cref="T:System.Xml.XmlReader" />
  3917. object that can be used to fetch the resulting XML data.
  3918. </returns><remarks>
  3919. <format type="text/markdown"><![CDATA[
  3920. ## Remarks
  3921. 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.
  3922. ## Examples
  3923. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A>.
  3924. ]]></format>
  3925. </remarks><exception cref="T:System.ArgumentException">
  3926. <paramref name="asyncResult" />
  3927. parameter is null (
  3928. <see langword="Nothing" />
  3929. in Microsoft Visual Basic)
  3930. </exception><exception cref="T:System.InvalidOperationException">
  3931. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3932. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3933. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3934. to complete execution of a call to
  3935. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3936. .
  3937. </exception>
  3938. </member>
  3939. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(System.Data.CommandBehavior)">
  3940. <param name="behavior">
  3941. To be added.
  3942. </param><summary>
  3943. To be added.
  3944. </summary><returns>
  3945. To be added.
  3946. </returns><remarks>
  3947. To be added.
  3948. </remarks>
  3949. </member>
  3950. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)">
  3951. <param name="behavior">
  3952. To be added.
  3953. </param><param name="cancellationToken">
  3954. To be added.
  3955. </param><summary>
  3956. To be added.
  3957. </summary><returns>
  3958. To be added.
  3959. </returns><remarks>
  3960. To be added.
  3961. </remarks>
  3962. </member>
  3963. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery">
  3964. <summary>
  3965. Executes a Transact-SQL statement against the connection and returns the number of rows affected.
  3966. </summary><returns>
  3967. The number of rows affected.
  3968. </returns><remarks>
  3969. <format type="text/markdown"><![CDATA[
  3970. ## Remarks
  3971. 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.
  3972. 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.
  3973. 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.
  3974. 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.
  3975. 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.
  3976. 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.
  3977. ## Examples
  3978. 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.
  3979. [!code-csharp[SqlCommand_ExecuteNonQuery](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs)]
  3980. ]]></format>
  3981. </remarks><exception cref="T:System.InvalidCastException">
  3982. A
  3983. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3984. other than **Binary** or **VarBinary** was used when
  3985. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3986. was set to
  3987. <see cref="T:System.IO.Stream" />
  3988. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  3989. -or-
  3990. A
  3991. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3992. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3993. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3994. was set to
  3995. <see cref="T:System.IO.TextReader" />
  3996. .
  3997. -or-
  3998. A
  3999. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4000. other than **Xml** was used when
  4001. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4002. was set to
  4003. <see cref="T:System.Xml.XmlReader" />
  4004. .
  4005. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4006. 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.
  4007. -or-
  4008. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4009. </exception><exception cref="T:System.IO.IOException">
  4010. An error occurred in a
  4011. <see cref="T:System.IO.Stream" />
  4012. ,
  4013. <see cref="T:System.Xml.XmlReader" />
  4014. or
  4015. <see cref="T:System.IO.TextReader" />
  4016. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4017. </exception><exception cref="T:System.InvalidOperationException">
  4018. The
  4019. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4020. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4021. </exception><exception cref="T:System.ObjectDisposedException">
  4022. The
  4023. <see cref="T:System.IO.Stream" />
  4024. ,
  4025. <see cref="T:System.Xml.XmlReader" />
  4026. or
  4027. <see cref="T:System.IO.TextReader" />
  4028. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4029. </exception>
  4030. </member>
  4031. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(System.Threading.CancellationToken)">
  4032. <param name="cancellationToken">
  4033. The cancellation instruction.
  4034. </param><summary>
  4035. An asynchronous version of
  4036. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery" />
  4037. , 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.
  4038. </summary><returns>
  4039. A task representing the asynchronous operation.
  4040. </returns><remarks>
  4041. <format type="text/markdown"><![CDATA[
  4042. ## Remarks
  4043. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4044. ]]></format>
  4045. </remarks><exception cref="T:System.InvalidCastException">
  4046. A
  4047. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4048. other than **Binary** or **VarBinary** was used when
  4049. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4050. was set to
  4051. <see cref="T:System.IO.Stream" />
  4052. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4053. -or-
  4054. A
  4055. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4056. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4057. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4058. was set to
  4059. <see cref="T:System.IO.TextReader" />
  4060. .
  4061. -or-
  4062. A
  4063. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4064. other than **Xml** was used when
  4065. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4066. was set to
  4067. <see cref="T:System.Xml.XmlReader" />
  4068. .
  4069. </exception><exception cref="T:System.InvalidOperationException">
  4070. Calling
  4071. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(System.Threading.CancellationToken)" />
  4072. more than once for the same instance before task completion.
  4073. -or-
  4074. The
  4075. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4076. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4077. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4078. SQL Server returned an error while executing the command text.
  4079. -or-
  4080. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4081. </exception><exception cref="T:System.IO.IOException">
  4082. An error occurred in a
  4083. <see cref="T:System.IO.Stream" />
  4084. ,
  4085. <see cref="T:System.Xml.XmlReader" />
  4086. or
  4087. <see cref="T:System.IO.TextReader" />
  4088. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4089. </exception><exception cref="T:System.ObjectDisposedException">
  4090. The
  4091. <see cref="T:System.IO.Stream" />
  4092. ,
  4093. <see cref="T:System.Xml.XmlReader" />
  4094. or
  4095. <see cref="T:System.IO.TextReader" />
  4096. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4097. </exception>
  4098. </member>
  4099. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader">
  4100. <summary>
  4101. Sends the
  4102. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4103. to the
  4104. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4105. and builds a
  4106. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4107. .
  4108. </summary><returns>
  4109. A
  4110. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4111. object.
  4112. </returns><remarks>
  4113. <format type="text/markdown"><![CDATA[
  4114. ## Remarks
  4115. 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>.
  4116. > [!NOTE]
  4117. > If a transaction is deadlocked, an exception may not be thrown until <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> is called.
  4118. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  4119. 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.
  4120. ## Examples
  4121. 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.
  4122. [!code-csharp[SqlCommand_ExecuteReader](~/../sqlclient/doc/samples/SqlCommand_ExecuteReader.cs)]
  4123. ]]></format>
  4124. </remarks><exception cref="T:System.InvalidCastException">
  4125. A
  4126. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4127. other than **Binary** or **VarBinary** was used when
  4128. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4129. was set to
  4130. <see cref="T:System.IO.Stream" />
  4131. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4132. -or-
  4133. A
  4134. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4135. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4136. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4137. was set to
  4138. <see cref="T:System.IO.TextReader" />
  4139. .
  4140. -or-
  4141. A
  4142. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4143. other than **Xml** was used when
  4144. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4145. was set to
  4146. <see cref="T:System.Xml.XmlReader" />
  4147. .
  4148. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4149. 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.
  4150. -or-
  4151. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4152. </exception><exception cref="T:System.InvalidOperationException">
  4153. The current state of the connection is closed.
  4154. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  4155. requires an open
  4156. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4157. .
  4158. -or-
  4159. The
  4160. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4161. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4162. </exception><exception cref="T:System.IO.IOException">
  4163. An error occurred in a
  4164. <see cref="T:System.IO.Stream" />
  4165. ,
  4166. <see cref="T:System.Xml.XmlReader" />
  4167. or
  4168. <see cref="T:System.IO.TextReader" />
  4169. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4170. </exception><exception cref="T:System.ObjectDisposedException">
  4171. The
  4172. <see cref="T:System.IO.Stream" />
  4173. ,
  4174. <see cref="T:System.Xml.XmlReader" />
  4175. or
  4176. <see cref="T:System.IO.TextReader" />
  4177. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4178. </exception>
  4179. </member>
  4180. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)">
  4181. <param name="behavior">
  4182. One of the
  4183. <see cref="T:System.Data.CommandBehavior" />
  4184. values.
  4185. </param><summary>
  4186. Sends the
  4187. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4188. to the
  4189. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4190. , and builds a
  4191. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4192. using one of the
  4193. <see cref="T:System.Data.CommandBehavior" />
  4194. values.
  4195. </summary><returns>
  4196. A
  4197. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4198. object.
  4199. </returns><remarks>
  4200. <format type="text/markdown"><![CDATA[
  4201. ## Remarks
  4202. 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>.
  4203. > [!NOTE]
  4204. > 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.
  4205. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  4206. 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.
  4207. ## Examples
  4208. 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>.
  4209. [!code-csharp[SqlCommand_ExecuteReader2](~/../sqlclient/doc/samples/SqlCommand_ExecuteReader2.cs#1)]
  4210. ]]></format>
  4211. </remarks><exception cref="T:System.InvalidCastException">
  4212. A
  4213. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4214. other than **Binary** or **VarBinary** was used when
  4215. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4216. was set to
  4217. <see cref="T:System.IO.Stream" />
  4218. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4219. -or-
  4220. A
  4221. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4222. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4223. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4224. was set to
  4225. <see cref="T:System.IO.TextReader" />
  4226. .
  4227. -or-
  4228. A
  4229. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4230. other than **Xml** was used when
  4231. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4232. was set to
  4233. <see cref="T:System.Xml.XmlReader" />
  4234. .
  4235. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4236. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4237. </exception><exception cref="T:System.IO.IOException">
  4238. An error occurred in a
  4239. <see cref="T:System.IO.Stream" />
  4240. ,
  4241. <see cref="T:System.Xml.XmlReader" />
  4242. or
  4243. <see cref="T:System.IO.TextReader" />
  4244. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4245. </exception><exception cref="T:System.InvalidOperationException">
  4246. The
  4247. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4248. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4249. </exception><exception cref="T:System.ObjectDisposedException">
  4250. The
  4251. <see cref="T:System.IO.Stream" />
  4252. ,
  4253. <see cref="T:System.Xml.XmlReader" />
  4254. or
  4255. <see cref="T:System.IO.TextReader" />
  4256. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4257. </exception>
  4258. </member>
  4259. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync">
  4260. <summary>
  4261. An asynchronous version of
  4262. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  4263. , which sends the
  4264. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4265. to the
  4266. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4267. and builds a
  4268. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4269. . Exceptions will be reported via the returned Task object.
  4270. </summary><returns>
  4271. A task representing the asynchronous operation.
  4272. </returns><remarks>
  4273. <format type="text/markdown"><![CDATA[
  4274. ## Remarks
  4275. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4276. ]]></format>
  4277. </remarks><exception cref="T:System.InvalidCastException">
  4278. A
  4279. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4280. other than **Binary** or **VarBinary** was used when
  4281. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4282. was set to
  4283. <see cref="T:System.IO.Stream" />
  4284. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4285. -or-
  4286. A
  4287. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4288. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4289. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4290. was set to
  4291. <see cref="T:System.IO.TextReader" />
  4292. .
  4293. -or-
  4294. A
  4295. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4296. other than **Xml** was used when
  4297. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4298. was set to
  4299. <see cref="T:System.Xml.XmlReader" />
  4300. .
  4301. </exception><exception cref="T:System.ArgumentException">
  4302. An invalid
  4303. <see cref="T:System.Data.CommandBehavior" />
  4304. value.
  4305. </exception><exception cref="T:System.InvalidOperationException">
  4306. Calling
  4307. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync" />
  4308. more than once for the same instance before task completion.
  4309. -or-
  4310. The
  4311. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4312. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4313. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4314. SQL Server returned an error while executing the command text.
  4315. -or-
  4316. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4317. </exception><exception cref="T:System.IO.IOException">
  4318. An error occurred in a
  4319. <see cref="T:System.IO.Stream" />
  4320. ,
  4321. <see cref="T:System.Xml.XmlReader" />
  4322. or
  4323. <see cref="T:System.IO.TextReader" />
  4324. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4325. </exception><exception cref="T:System.ObjectDisposedException">
  4326. The
  4327. <see cref="T:System.IO.Stream" />
  4328. ,
  4329. <see cref="T:System.Xml.XmlReader" />
  4330. or
  4331. <see cref="T:System.IO.TextReader" />
  4332. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4333. </exception>
  4334. </member>
  4335. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior)">
  4336. <param name="behavior">
  4337. Options for statement execution and data retrieval. When is set to
  4338. <see langword="Default" />
  4339. ,
  4340. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" />
  4341. reads the entire row before returning a complete Task.
  4342. </param><summary>
  4343. An asynchronous version of
  4344. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)" />
  4345. , which sends the
  4346. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4347. to the
  4348. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4349. , and builds a
  4350. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4351. . Exceptions will be reported via the returned Task object.
  4352. </summary><returns>
  4353. A task representing the asynchronous operation.
  4354. </returns><remarks>
  4355. <format type="text/markdown"><![CDATA[
  4356. ## Remarks
  4357. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4358. ]]></format>
  4359. </remarks><exception cref="T:System.InvalidCastException">
  4360. A
  4361. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4362. other than **Binary** or **VarBinary** was used when
  4363. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4364. was set to
  4365. <see cref="T:System.IO.Stream" />
  4366. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4367. -or-
  4368. A
  4369. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4370. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4371. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4372. was set to
  4373. <see cref="T:System.IO.TextReader" />
  4374. .
  4375. -or-
  4376. A
  4377. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4378. other than **Xml** was used when
  4379. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4380. was set to
  4381. <see cref="T:System.Xml.XmlReader" />
  4382. .
  4383. </exception><exception cref="T:System.ArgumentException">
  4384. An invalid
  4385. <see cref="T:System.Data.CommandBehavior" />
  4386. value.
  4387. </exception><exception cref="T:System.InvalidOperationException">
  4388. Calling
  4389. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior)" />
  4390. more than once for the same instance before task completion.
  4391. -or-
  4392. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4393. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4394. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4395. SQL Server returned an error while executing the command text.
  4396. -or-
  4397. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4398. </exception><exception cref="T:System.IO.IOException">
  4399. An error occurred in a
  4400. <see cref="T:System.IO.Stream" />
  4401. ,
  4402. <see cref="T:System.Xml.XmlReader" />
  4403. or
  4404. <see cref="T:System.IO.TextReader" />
  4405. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4406. </exception><exception cref="T:System.ObjectDisposedException">
  4407. The
  4408. <see cref="T:System.IO.Stream" />
  4409. ,
  4410. <see cref="T:System.Xml.XmlReader" />
  4411. or
  4412. <see cref="T:System.IO.TextReader" />
  4413. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4414. </exception>
  4415. </member>
  4416. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)">
  4417. <param name="behavior">
  4418. Options for statement execution and data retrieval. When is set to
  4419. <see langword="Default" />
  4420. ,
  4421. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" />
  4422. reads the entire row before returning a complete Task.
  4423. </param><param name="cancellationToken">
  4424. The cancellation instruction.
  4425. </param><summary>
  4426. An asynchronous version of
  4427. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)" />
  4428. , which sends the
  4429. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4430. to the
  4431. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4432. , and builds a
  4433. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4434. 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.
  4435. </summary><returns>
  4436. A task representing the asynchronous operation.
  4437. </returns><remarks>
  4438. <format type="text/markdown"><![CDATA[
  4439. ## Remarks
  4440. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4441. ]]></format>
  4442. </remarks><exception cref="T:System.InvalidCastException">
  4443. A
  4444. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4445. other than **Binary** or **VarBinary** was used when
  4446. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4447. was set to
  4448. <see cref="T:System.IO.Stream" />
  4449. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4450. -or-
  4451. A
  4452. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4453. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4454. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4455. was set to
  4456. <see cref="T:System.IO.TextReader" />
  4457. .
  4458. -or-
  4459. A
  4460. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4461. other than **Xml** was used when
  4462. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4463. was set to
  4464. <see cref="T:System.Xml.XmlReader" />
  4465. .
  4466. </exception><exception cref="T:System.ArgumentException">
  4467. An invalid
  4468. <see cref="T:System.Data.CommandBehavior" />
  4469. value.
  4470. </exception><exception cref="T:System.InvalidOperationException">
  4471. Calling
  4472. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)" />
  4473. more than once for the same instance before task completion.
  4474. -or-
  4475. The
  4476. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4477. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4478. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4479. SQL Server returned an error while executing the command text.
  4480. -or-
  4481. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4482. </exception><exception cref="T:System.IO.IOException">
  4483. An error occurred in a
  4484. <see cref="T:System.IO.Stream" />
  4485. ,
  4486. <see cref="T:System.Xml.XmlReader" />
  4487. or
  4488. <see cref="T:System.IO.TextReader" />
  4489. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4490. </exception><exception cref="T:System.ObjectDisposedException">
  4491. The
  4492. <see cref="T:System.IO.Stream" />
  4493. ,
  4494. <see cref="T:System.Xml.XmlReader" />
  4495. or
  4496. <see cref="T:System.IO.TextReader" />
  4497. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4498. </exception>
  4499. </member>
  4500. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Threading.CancellationToken)">
  4501. <param name="cancellationToken">
  4502. The cancellation instruction.
  4503. </param><summary>
  4504. An asynchronous version of
  4505. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  4506. , which sends the
  4507. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4508. to the
  4509. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4510. and builds a
  4511. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  4512. .
  4513. 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.
  4514. </summary><returns>
  4515. A task representing the asynchronous operation.
  4516. </returns><remarks>
  4517. <format type="text/markdown">
  4518. <![CDATA[
  4519. ## Remarks
  4520. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4521. ]]>
  4522. </format>
  4523. </remarks><exception cref="T:System.InvalidCastException">
  4524. A
  4525. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4526. other than **Binary** or **VarBinary** was used when
  4527. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4528. was set to
  4529. <see cref="T:System.IO.Stream" />
  4530. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4531. -or-
  4532. A
  4533. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4534. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4535. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4536. was set to
  4537. <see cref="T:System.IO.TextReader" />
  4538. .
  4539. -or-
  4540. A
  4541. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4542. other than **Xml** was used when
  4543. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4544. was set to
  4545. <see cref="T:System.Xml.XmlReader" />
  4546. .
  4547. </exception><exception cref="T:System.ArgumentException">
  4548. An invalid
  4549. <see cref="T:System.Data.CommandBehavior" />
  4550. value.
  4551. </exception><exception cref="T:System.InvalidOperationException">
  4552. Calling
  4553. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)" />
  4554. more than once for the same instance before task completion.
  4555. -or-
  4556. The
  4557. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4558. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4559. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4560. SQL Server returned an error while executing the command text.
  4561. -or-
  4562. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4563. </exception><exception cref="T:System.IO.IOException">
  4564. An error occurred in a
  4565. <see cref="T:System.IO.Stream" />
  4566. ,
  4567. <see cref="T:System.Xml.XmlReader" />
  4568. or
  4569. <see cref="T:System.IO.TextReader" />
  4570. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4571. </exception><exception cref="T:System.ObjectDisposedException">
  4572. The
  4573. <see cref="T:System.IO.Stream" />
  4574. ,
  4575. <see cref="T:System.Xml.XmlReader" />
  4576. or
  4577. <see cref="T:System.IO.TextReader" />
  4578. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4579. </exception>
  4580. </member>
  4581. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar">
  4582. <summary>
  4583. 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.
  4584. </summary><returns>
  4585. The first column of the first row in the result set, or a null reference (
  4586. <see langword="Nothing" />
  4587. in Visual Basic) if the result set is empty. Returns a maximum of 2033 characters.
  4588. </returns><remarks>
  4589. <format type="text/markdown"><![CDATA[
  4590. ## Remarks
  4591. 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>.
  4592. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A> query can be formatted as in the following C# example:
  4593. ```csharp
  4594. cmd.CommandText = "SELECT COUNT(*) FROM dbo.region";
  4595. Int32 count = (Int32) cmd.ExecuteScalar();
  4596. ```
  4597. ## Examples
  4598. 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.
  4599. [!code-csharp[SqlCommand.ExecuteScalar#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteScalar.cs#1)]
  4600. ]]></format>
  4601. </remarks><exception cref="T:System.InvalidCastException">
  4602. A
  4603. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4604. other than **Binary** or **VarBinary** was used when
  4605. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4606. was set to
  4607. <see cref="T:System.IO.Stream" />
  4608. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4609. -or-
  4610. A
  4611. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4612. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4613. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4614. was set to
  4615. <see cref="T:System.IO.TextReader" />
  4616. .
  4617. -or-
  4618. A
  4619. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4620. other than **Xml** was used when
  4621. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4622. was set to
  4623. <see cref="T:System.Xml.XmlReader" />
  4624. .
  4625. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4626. 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.
  4627. -or-
  4628. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4629. </exception><exception cref="T:System.InvalidOperationException">
  4630. The
  4631. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4632. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4633. </exception><exception cref="T:System.IO.IOException">
  4634. An error occurred in a
  4635. <see cref="T:System.IO.Stream" />
  4636. ,
  4637. <see cref="T:System.Xml.XmlReader" />
  4638. or
  4639. <see cref="T:System.IO.TextReader" />
  4640. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4641. </exception><exception cref="T:System.ObjectDisposedException">
  4642. The
  4643. <see cref="T:System.IO.Stream" />
  4644. ,
  4645. <see cref="T:System.Xml.XmlReader" />
  4646. or
  4647. <see cref="T:System.IO.TextReader" />
  4648. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4649. </exception>
  4650. </member>
  4651. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)">
  4652. <param name="cancellationToken">
  4653. The cancellation instruction.
  4654. </param><summary>
  4655. An asynchronous version of
  4656. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar" />
  4657. , 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.
  4658. 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.
  4659. </summary><returns>
  4660. A task representing the asynchronous operation.
  4661. </returns><remarks>
  4662. <format type="text/markdown"><![CDATA[
  4663. ## Remarks
  4664. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4665. ]]></format>
  4666. </remarks><exception cref="T:System.InvalidCastException">
  4667. A
  4668. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4669. other than **Binary** or **VarBinary** was used when
  4670. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4671. was set to
  4672. <see cref="T:System.IO.Stream" />
  4673. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4674. -or-
  4675. A
  4676. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4677. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4678. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4679. was set to
  4680. <see cref="T:System.IO.TextReader" />
  4681. .
  4682. -or-
  4683. A
  4684. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4685. other than **Xml** was used when
  4686. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4687. was set to
  4688. <see cref="T:System.Xml.XmlReader" />
  4689. .
  4690. </exception><exception cref="T:System.InvalidOperationException">
  4691. Calling
  4692. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4693. more than once for the same instance before task completion.
  4694. -or-
  4695. The
  4696. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4697. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4698. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4699. SQL Server returned an error while executing the command text.
  4700. -or-
  4701. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4702. </exception><exception cref="T:System.IO.IOException">
  4703. An error occurred in a
  4704. <see cref="T:System.IO.Stream" />
  4705. ,
  4706. <see cref="T:System.Xml.XmlReader" />
  4707. or
  4708. <see cref="T:System.IO.TextReader" />
  4709. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4710. </exception><exception cref="T:System.ObjectDisposedException">
  4711. The
  4712. <see cref="T:System.IO.Stream" />
  4713. ,
  4714. <see cref="T:System.Xml.XmlReader" />
  4715. or
  4716. <see cref="T:System.IO.TextReader" />
  4717. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4718. </exception>
  4719. </member>
  4720. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader">
  4721. <summary>
  4722. Sends the
  4723. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4724. to the
  4725. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4726. and builds an
  4727. <see cref="T:System.Xml.XmlReader" />
  4728. object.
  4729. </summary><returns>
  4730. An
  4731. <see cref="T:System.Xml.XmlReader" />
  4732. object.
  4733. </returns><remarks>
  4734. <format type="text/markdown"><![CDATA[
  4735. ## Remarks
  4736. The **XmlReader** returned by this method does not support asynchronous operations.
  4737. 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.
  4738. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> query can be formatted as in the following Microsoft Visual C# example:
  4739. ```csharp
  4740. SqlCommand command = new SqlCommand("SELECT * FROM dbo.Customers FOR XML AUTO, XMLDATA", SqlConn);
  4741. ```
  4742. 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.
  4743. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  4744. 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.
  4745. ## Examples
  4746. 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.
  4747. [!code-csharp[SqlCommand_ExecuteXmlReader#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteXmlReader.cs#1)]
  4748. ]]></format>
  4749. </remarks><exception cref="T:System.InvalidCastException">
  4750. A
  4751. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4752. other than **Binary** or **VarBinary** was used when
  4753. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4754. was set to
  4755. <see cref="T:System.IO.Stream" />
  4756. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4757. -or-
  4758. A
  4759. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4760. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4761. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4762. was set to
  4763. <see cref="T:System.IO.TextReader" />
  4764. .
  4765. -or-
  4766. A
  4767. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4768. other than **Xml** was used when
  4769. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4770. was set to
  4771. <see cref="T:System.Xml.XmlReader" />
  4772. .
  4773. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4774. 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.
  4775. -or-
  4776. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4777. </exception><exception cref="T:System.InvalidOperationException">
  4778. The
  4779. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4780. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4781. </exception><exception cref="T:System.IO.IOException">
  4782. An error occurred in a
  4783. <see cref="T:System.IO.Stream" />
  4784. ,
  4785. <see cref="T:System.Xml.XmlReader" />
  4786. or
  4787. <see cref="T:System.IO.TextReader" />
  4788. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4789. </exception><exception cref="T:System.ObjectDisposedException">
  4790. The
  4791. <see cref="T:System.IO.Stream" />
  4792. ,
  4793. <see cref="T:System.Xml.XmlReader" />
  4794. or
  4795. <see cref="T:System.IO.TextReader" />
  4796. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4797. </exception>
  4798. </member>
  4799. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync">
  4800. <summary>
  4801. An asynchronous version of
  4802. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  4803. , which sends the
  4804. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4805. to the
  4806. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4807. and builds an
  4808. <see cref="T:System.Xml.XmlReader" />
  4809. object.
  4810. Exceptions will be reported via the returned Task object.
  4811. </summary><returns>
  4812. A task representing the asynchronous operation.
  4813. </returns><remarks>
  4814. <format type="text/markdown"><![CDATA[
  4815. ## Remarks
  4816. The **XmlReader** returned by this method does not support asynchronous operations.
  4817. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4818. ]]></format>
  4819. </remarks><exception cref="T:System.InvalidCastException">
  4820. A
  4821. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4822. other than **Binary** or **VarBinary** was used when
  4823. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4824. was set to
  4825. <see cref="T:System.IO.Stream" />
  4826. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4827. -or-
  4828. A
  4829. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4830. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4831. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4832. was set to
  4833. <see cref="T:System.IO.TextReader" />
  4834. .
  4835. -or-
  4836. A
  4837. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4838. other than **Xml** was used when
  4839. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4840. was set to
  4841. <see cref="T:System.Xml.XmlReader" />
  4842. .
  4843. </exception><exception cref="T:System.InvalidOperationException">
  4844. Calling
  4845. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4846. more than once for the same instance before task completion.
  4847. -or-
  4848. The
  4849. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4850. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4851. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4852. SQL Server returned an error while executing the command text.
  4853. -or-
  4854. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4855. </exception><exception cref="T:System.IO.IOException">
  4856. An error occurred in a
  4857. <see cref="T:System.IO.Stream" />
  4858. ,
  4859. <see cref="T:System.Xml.XmlReader" />
  4860. or
  4861. <see cref="T:System.IO.TextReader" />
  4862. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4863. </exception><exception cref="T:System.ObjectDisposedException">
  4864. The
  4865. <see cref="T:System.IO.Stream" />
  4866. ,
  4867. <see cref="T:System.Xml.XmlReader" />
  4868. or
  4869. <see cref="T:System.IO.TextReader" />
  4870. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4871. </exception>
  4872. </member>
  4873. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync(System.Threading.CancellationToken)">
  4874. <param name="cancellationToken">
  4875. The cancellation instruction.
  4876. </param><summary>
  4877. An asynchronous version of
  4878. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  4879. , which sends the
  4880. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4881. to the
  4882. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4883. and builds an
  4884. <see cref="T:System.Xml.XmlReader" />
  4885. object.
  4886. 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.
  4887. </summary><returns>
  4888. A task representing the asynchronous operation.
  4889. </returns><remarks>
  4890. <format type="text/markdown"><![CDATA[
  4891. ## Remarks
  4892. The **XmlReader** returned by this method does not support asynchronous operations.
  4893. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  4894. ]]></format>
  4895. </remarks><exception cref="T:System.InvalidCastException">
  4896. A
  4897. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4898. other than **Binary** or **VarBinary** was used when
  4899. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4900. was set to
  4901. <see cref="T:System.IO.Stream" />
  4902. . For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4903. -or-
  4904. A
  4905. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4906. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4907. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4908. was set to
  4909. <see cref="T:System.IO.TextReader" />
  4910. .
  4911. -or-
  4912. A
  4913. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4914. other than **Xml** was used when
  4915. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4916. was set to
  4917. <see cref="T:System.Xml.XmlReader" />
  4918. .
  4919. </exception><exception cref="T:System.InvalidOperationException">
  4920. Calling
  4921. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4922. more than once for the same instance before task completion.
  4923. -or-
  4924. The
  4925. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4926. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4927. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4928. SQL Server returned an error while executing the command text.
  4929. -or-
  4930. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4931. </exception><exception cref="T:System.IO.IOException">
  4932. An error occurred in a
  4933. <see cref="T:System.IO.Stream" />
  4934. ,
  4935. <see cref="T:System.Xml.XmlReader" />
  4936. or
  4937. <see cref="T:System.IO.TextReader" />
  4938. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4939. </exception><exception cref="T:System.ObjectDisposedException">
  4940. The
  4941. <see cref="T:System.IO.Stream" />
  4942. ,
  4943. <see cref="T:System.Xml.XmlReader" />
  4944. or
  4945. <see cref="T:System.IO.TextReader" />
  4946. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  4947. </exception>
  4948. </member>
  4949. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Prepare">
  4950. <summary>
  4951. Creates a prepared version of the command on an instance of SQL Server.
  4952. </summary><remarks>
  4953. <format type="text/markdown"><![CDATA[
  4954. ## Remarks
  4955. 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.
  4956. 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.
  4957. > [!NOTE]
  4958. > 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.
  4959. 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.
  4960. 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>.
  4961. 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.
  4962. ## Examples
  4963. The following example demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> method.
  4964. [!code-csharp[SqlCommand.Prepare#1](~/../sqlclient/doc/samples/SqlCommand_Prepare.cs#1)]
  4965. ]]></format>
  4966. </remarks>
  4967. </member>
  4968. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Notification">
  4969. <summary>
  4970. Gets or sets a value that specifies the
  4971. <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" />
  4972. object bound to this command.
  4973. </summary><value>
  4974. When set to null (default), no notification should be requested.
  4975. </value><remarks>
  4976. <format type="text/markdown"><![CDATA[
  4977. ## Remarks
  4978. You must set the value for this property before the command is executed for it to take effect.
  4979. ]]></format>
  4980. </remarks>
  4981. </member>
  4982. <member name="P:Microsoft.Data.SqlClient.SqlCommand.NotificationAutoEnlist">
  4983. <summary>
  4984. Gets or sets a value indicating whether the application should automatically receive query notifications from a common
  4985. <see cref="T:Microsoft.Data.SqlClient.SqlDependency" />
  4986. object.
  4987. </summary><value>
  4988. <see langword="true" />
  4989. if the application should automatically receive query notifications; otherwise
  4990. <see langword="false" />
  4991. . The default value is
  4992. <see langword="true" />
  4993. .
  4994. </value><remarks>
  4995. <format type="text/markdown"><![CDATA[
  4996. ## Remarks
  4997. 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.
  4998. 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.
  4999. ]]></format>
  5000. </remarks>
  5001. </member>
  5002. <member name="M:Microsoft.Data.SqlClient.SqlCommand.RegisterColumnEncryptionKeyStoreProvidersOnCommand(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})">
  5003. <param name="customProviders">Dictionary of custom column encryption key providers</param><summary>Registers the encryption key store providers on the <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> instance. If this function has been called, any providers registered using the <see cref="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProviders(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})" /> or
  5004. <see cref="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProvidersOnConnection(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})" /> methods will be ignored. This function can be called more than once. This does shallow copying of the dictionary so that the app cannot alter the custom provider list once it has been set.</summary><exception cref="T:System.ArgumentNullException">
  5005. A null dictionary was provided.
  5006. -or-
  5007. A string key in the dictionary was null or empty.
  5008. -or-
  5009. A <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider" /> value in the dictionary was null.
  5010. </exception><exception cref="T:System.ArgumentException">
  5011. A string key in the dictionary started with "MSSQL_". This prefix is reserved for system providers.
  5012. </exception><remarks>
  5013. <format type="text/markdown"><![CDATA[
  5014. ## Remarks
  5015. Custom master key store providers can be registered with the driver at three different layers. The precedence of the three registrations is as follows:
  5016. - The per-command registration will be checked if it is not empty.
  5017. - If the per-command registration is empty, the per-connection registration will be checked if it is not empty.
  5018. - If the per-connection registration is empty, the global registration will be checked.
  5019. Once any key store provider is found at a registration level, the driver will **NOT** fall back to the other registrations to search for a provider. If providers are registered but the proper provider is not found at a level, an exception will be thrown containing only the registered providers in the registration that was checked.
  5020. The built-in column master key store providers that are available for the Windows Certificate Store, CNG Store and CSP are pre-registered.
  5021. This does shallow copying of the dictionary so that the app cannot alter the custom provider list once it has been set.
  5022. ]]></format>
  5023. </remarks>
  5024. </member>
  5025. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ResetCommandTimeout">
  5026. <summary> Resets the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" /> property to its default value.
  5027. </summary><remarks>
  5028. <format type="text/markdown"><![CDATA[
  5029. ## Remarks
  5030. The default value of the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> is 30 seconds.
  5031. ]]></format>
  5032. </remarks>
  5033. </member>
  5034. <member name="P:Microsoft.Data.SqlClient.SqlCommand.RetryLogicProvider">
  5035. <summary>
  5036. Gets or sets a value that specifies the
  5037. <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" />
  5038. object bound to this command.
  5039. </summary><value>
  5040. When set to null (default), the default non-retriable provider will be used.
  5041. </value><remarks>
  5042. <format type="text/markdown"><![CDATA[
  5043. ## Remarks
  5044. You must set the value for this property before the command is executed for it to take effect.
  5045. To apply the retry logic, do the following steps before executing the command:
  5046. 1. Define the configuration parameters by using <xref:Microsoft.Data.SqlClient.SqlRetryLogicOption> type.
  5047. 2. Create a <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> by using one of the following static methods of the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory> class:
  5048. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider%2A>
  5049. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider%2A>
  5050. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider%2A>
  5051. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider%2A>
  5052. 3. Assign the <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> object to the `RetryLogicProvider` property.
  5053. > [!NOTE]
  5054. > Detecting retriable exceptions is a vital part of the retry pattern. Before applying retry logic, it is important to investigate exceptions and choose a retry provider that best fits your scenario. First, log your exceptions and find transient faults.
  5055. > [!NOTE]
  5056. > The command **timeout** restarts for each execution of a command within the retry logic and after applying the retry time delay. There is no timing overlap between these two actions.
  5057. > [!NOTE]
  5058. > The default retry logic provider is not enabled unless it is configured in an application configuration file. For more information, see [Configurable retry logic configuration file](/sql/connect/ado-net/configurable-retry-logic-config-file-sqlclient).
  5059. > [!CAUTION]
  5060. > A command with <xref:System.Data.CommandBehavior.CloseConnection?displayProperty=nameWithType> isn't compatible with the built-in retry logic. The underlying connection is immediately closed after the first execution attempt and is no longer available for subsequent retries.
  5061. ## Example
  5062. The following sample creates a database and establishes an active connection to it. While the database has an active connection, it tries to drop it with a new <xref:Microsoft.Data.SqlClient.SqlConnection> and a <xref:Microsoft.Data.SqlClient.SqlCommand> that uses a <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider>. You should kill the active connection through the database to unblock the second command before exceeding the number of retries.
  5063. The blocking connection simulates a situation like a command still running in the database and unlikely to finish.
  5064. [!code-csharp[SqlConfigurableRetryLogic_SqlCommand#1](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs#1)]
  5065. ### How to use with synchronous commands
  5066. [!code-csharp[SqlConfigurableRetryLogic_SqlCommand#2](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs#2)]
  5067. ### How to use with asynchoronous commands
  5068. [!code-csharp[SqlConfigurableRetryLogic_SqlCommand#3](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs#3)]
  5069. ### How to use with legacy asynchronous commands
  5070. Besides assigning the provider to the command and executing the command, it's possible to run it directly using the following <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> methods:
  5071. - <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.Execute%60%601(System.Object,System.Func{%60%600})>
  5072. - <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.ExecuteAsync(System.Object,System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken)>
  5073. - <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.ExecuteAsync%60%601(System.Object,System.Func{System.Threading.Tasks.Task{%60%600}},System.Threading.CancellationToken)>
  5074. [!code-csharp[SqlConfigurableRetryLogic_SqlCommand#4](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs#4)]
  5075. > [!NOTE]
  5076. > The Asynchronous Programming Model (APM) is a legacy pattern that uses a pair of methods starting with `Begin` and `End`, and an interface called `IAsyncResult`. It's not recommended to use this pattern in new applications. These methods are for backwards compatibility.
  5077. ]]></format>
  5078. </remarks>
  5079. </member>
  5080. <member name="T:Microsoft.Data.SqlClient.SqlCommandBuilder">
  5081. <summary>
  5082. Automatically generates single-table commands that are used to reconcile changes made to a
  5083. <see cref="T:System.Data.DataSet" />
  5084. with the associated SQL Server database. This class cannot be inherited.
  5085. </summary><remarks>
  5086. <format type="text/markdown"><![CDATA[
  5087. ## Remarks
  5088. 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>.
  5089. 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.
  5090. 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.
  5091. 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.
  5092. 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.
  5093. 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.
  5094. ## Examples
  5095. 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>.
  5096. [!code-csharp[SqlCommandBuilder#1](~/../sqlclient/doc/samples/SqlCommandBuilder.cs#1)]
  5097. ]]></format>
  5098. </remarks>
  5099. </member>
  5100. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.#ctor">
  5101. <summary>
  5102. Initializes a new instance of the
  5103. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  5104. class.
  5105. </summary><remarks>
  5106. To be added.
  5107. </remarks>
  5108. </member>
  5109. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.#ctor(Microsoft.Data.SqlClient.SqlDataAdapter)">
  5110. <param name="adapter">
  5111. The name of the
  5112. <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />
  5113. .
  5114. </param><summary>
  5115. Initializes a new instance of the
  5116. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  5117. class with the associated
  5118. <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />
  5119. object.
  5120. </summary><remarks>
  5121. <format type="text/markdown"><![CDATA[
  5122. ## Remarks
  5123. 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.
  5124. 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.
  5125. ]]></format>
  5126. </remarks>
  5127. </member>
  5128. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.CatalogLocation">
  5129. <summary>
  5130. Sets or gets the
  5131. <see cref="T:System.Data.Common.CatalogLocation" />
  5132. for an instance of the
  5133. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  5134. class.
  5135. </summary><value>
  5136. A
  5137. <see cref="T:System.Data.Common.CatalogLocation" />
  5138. object.
  5139. </value><remarks>
  5140. To be added.
  5141. </remarks>
  5142. </member>
  5143. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.CatalogSeparator">
  5144. <summary>
  5145. Sets or gets a string used as the catalog separator for an instance of the
  5146. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  5147. class.
  5148. </summary><value>
  5149. A string that indicates the catalog separator for use with an instance of the
  5150. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  5151. class.
  5152. </value><remarks>
  5153. To be added.
  5154. </remarks>
  5155. </member>
  5156. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.DataAdapter">
  5157. <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>
  5158. <format type="text/markdown"><![CDATA[
  5159. ## Remarks
  5160. 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.
  5161. 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.
  5162. ]]></format>
  5163. </remarks>
  5164. </member>
  5165. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.DeriveParameters(Microsoft.Data.SqlClient.SqlCommand)">
  5166. <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>
  5167. <format type="text/markdown"><![CDATA[
  5168. ## Remarks
  5169. `DeriveParameters` overwrites any existing parameter information for the `SqlDbCommand`.
  5170. `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.
  5171. 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.
  5172. For more information, see [Configuring parameters](/sql/connect/ado-net/configure-parameters).
  5173. ]]></format>
  5174. </remarks><exception cref="T:System.InvalidOperationException">The command text is not a valid stored procedure name.</exception>
  5175. </member>
  5176. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.QuotePrefix">
  5177. <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>
  5178. <format type="text/markdown"><![CDATA[
  5179. ## Remarks
  5180. > [!NOTE]
  5181. > 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.
  5182. ]]></format>
  5183. </remarks><exception cref="T:System.InvalidOperationException">This property cannot be changed after an INSERT, UPDATE, or DELETE command has been generated.</exception>
  5184. </member>
  5185. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteSuffix">
  5186. <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>
  5187. <format type="text/markdown"><![CDATA[
  5188. ## Remarks
  5189. > [!NOTE]
  5190. > 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.
  5191. ]]></format>
  5192. </remarks><exception cref="T:System.InvalidOperationException">This property cannot be changed after an insert, update, or delete command has been generated.</exception>
  5193. </member>
  5194. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.SchemaSeparator">
  5195. <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>
  5196. <format type="text/markdown"><![CDATA[
  5197. ## Remarks
  5198. 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.
  5199. ]]></format>
  5200. </remarks>
  5201. </member>
  5202. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.ApplyParameterInfo(System.Data.Common.DbParameter,System.Data.DataRow,System.Data.StatementType,System.Boolean)">
  5203. <param name="parameter">
  5204. To be added.
  5205. </param><param name="datarow">
  5206. To be added.
  5207. </param><param name="statementType">
  5208. To be added.
  5209. </param><param name="whereClause">
  5210. To be added.
  5211. </param><summary>
  5212. To be added.
  5213. </summary><remarks>
  5214. To be added.
  5215. </remarks>
  5216. </member>
  5217. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand">
  5218. <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>
  5219. <format type="text/markdown"><![CDATA[
  5220. ## Remarks
  5221. 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.
  5222. 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>.
  5223. 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>.
  5224. For more information, see [Generating Commands with CommandBuilders](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  5225. ]]></format>
  5226. </remarks>
  5227. </member>
  5228. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand(System.Boolean)">
  5229. <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>
  5230. <format type="text/markdown"><![CDATA[
  5231. ## Remarks
  5232. 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.
  5233. 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>.
  5234. 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>.
  5235. 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:
  5236. - 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.
  5237. - 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.
  5238. - 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.
  5239. For more information, see [Generating Commands with CommandBuilders](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  5240. ]]></format>
  5241. </remarks>
  5242. </member>
  5243. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand">
  5244. <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>
  5245. <format type="text/markdown"><![CDATA[
  5246. ## Remarks
  5247. 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.
  5248. 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>.
  5249. 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>.
  5250. For more information, see [Generating Commands with CommandBuilders](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  5251. ]]></format>
  5252. </remarks>
  5253. </member>
  5254. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand(System.Boolean)">
  5255. <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>
  5256. <format type="text/markdown"><![CDATA[
  5257. ## Remarks
  5258. 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.
  5259. 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>.
  5260. 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>.
  5261. 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:
  5262. - 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.
  5263. - 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.
  5264. - 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.
  5265. For more information, see [Generating Commands with CommandBuilders](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  5266. ]]></format>
  5267. </remarks>
  5268. </member>
  5269. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterName(System.Int32)">
  5270. <param name="parameterOrdinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5271. </member>
  5272. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterName(System.String)">
  5273. <param name="parameterName">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5274. </member>
  5275. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterPlaceholder(System.Int32)">
  5276. <param name="parameterOrdinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5277. </member>
  5278. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetSchemaTable(System.Data.Common.DbCommand)">
  5279. <param name="srcCommand">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5280. </member>
  5281. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand">
  5282. <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>
  5283. <format type="text/markdown"><![CDATA[
  5284. ## Remarks
  5285. 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.
  5286. 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>.
  5287. 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>.
  5288. For more information, see [Generating Commands with CommandBuilders](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  5289. ]]></format>
  5290. </remarks>
  5291. </member>
  5292. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand(System.Boolean)">
  5293. <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>
  5294. <format type="text/markdown"><![CDATA[
  5295. ## Remarks
  5296. 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.
  5297. 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>.
  5298. 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>.
  5299. 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:
  5300. - 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.
  5301. - 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.
  5302. - 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.
  5303. For more information, see [Generating Commands with CommandBuilders](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  5304. ]]></format>
  5305. </remarks>
  5306. </member>
  5307. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.InitializeCommand(System.Data.Common.DbCommand)">
  5308. <param name="command">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5309. </member>
  5310. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteIdentifier(System.String)">
  5311. <param name="unquotedIdentifier">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5312. </member>
  5313. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.SetRowUpdatingHandler(System.Data.Common.DbDataAdapter)">
  5314. <param name="adapter">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  5315. </member>
  5316. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.UnquoteIdentifier(System.String)">
  5317. <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="/sql/connect/ado-net/retrieving-modifying-data">Connecting and Retrieving Data in ADO.NET</related><related type="Article" href="/sql/connect/ado-net/sql/">Using the .NET Framework Data Provider for SQL Server</related><related type="Article" href="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  5318. </member>
  5319. <member name="T:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting">
  5320. <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>.
  5321. </summary><remarks>
  5322. <format type="text/markdown"><![CDATA[
  5323. ## Remarks
  5324. - 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.
  5325. - 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.
  5326. ]]></format>
  5327. </remarks>
  5328. </member>
  5329. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.Disabled">
  5330. <summary>Specifies the connection does not use Always Encrypted. Should be used if no queries sent over the connection access encrypted columns.</summary>
  5331. </member>
  5332. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.Enabled">
  5333. <summary>Enables Always Encrypted for the query.</summary>
  5334. </member>
  5335. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.ResultSetOnly">
  5336. <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>
  5337. </member>
  5338. <member name="F:Microsoft.Data.SqlClient.SqlCommandColumnEncryptionSetting.UseConnectionSetting">
  5339. <summary>Specifies that the command should default to the Always Encrypted setting in the connection string.</summary>
  5340. </member>
  5341. <member name="T:Microsoft.Data.SqlClient.SqlConnection">
  5342. <summary>Represents a connection to a SQL Server database. This class cannot be inherited.</summary><remarks>
  5343. <format type="text/markdown"><![CDATA[
  5344. ## Remarks
  5345. 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>.
  5346. 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.
  5347. See <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> for a list of the keywords in a connection string.
  5348. 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.
  5349. > [!NOTE]
  5350. > 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)](/sql/connect/ado-net/sql-server-connection-pooling).
  5351. 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.
  5352. ```vb
  5353. Using connection As New SqlConnection(connectionString)
  5354. connection.Open()
  5355. ' Do work here; connection closed on following line.
  5356. End Using
  5357. ```
  5358. ```csharp
  5359. using (SqlConnection connection = new SqlConnection(connectionString))
  5360. {
  5361. connection.Open();
  5362. // Do work here; connection closed on following line.
  5363. }
  5364. ```
  5365. > [!NOTE]
  5366. > 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)](/sql/connect/ado-net/sql-server-connection-pooling).
  5367. 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.
  5368. 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)](/dotnet/framework/tools/caspol-exe-code-access-security-policy-tool) to modify security policy at the machine, user, and enterprise levels. For more information, see [Security in .NET](/dotnet/standard/security/). For an example demonstrating how to use security demands, see [Code Access Security and ADO.NET](/dotnet/framework/data/adonet/code-access-security).
  5369. For more information about handling warning and informational messages from the server, see [Connection Events](/sql/connect/ado-net/connection-events). 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).
  5370. > [!CAUTION]
  5371. > 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.
  5372. ## Examples
  5373. 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.
  5374. [!code-csharp[SqlCommand_ExecuteNonQuery Example#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs#1)]
  5375. ]]></format>
  5376. </remarks>
  5377. </member>
  5378. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor">
  5379. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> class.</summary><remarks>
  5380. <format type="text/markdown"><![CDATA[
  5381. ## Remarks
  5382. 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.
  5383. |Properties|Initial value|
  5384. |----------------|-------------------|
  5385. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>|empty string ("")|
  5386. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A>|15|
  5387. |<xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A>|empty string ("")|
  5388. |<xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A>|empty string ("")|
  5389. 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.
  5390. ## Examples
  5391. The following example creates and opens a <xref:Microsoft.Data.SqlClient.SqlConnection>.
  5392. [!code-csharp[SqlConnection_SqlConnection Example#1](~/../sqlclient/doc/samples/SqlConnection_SqlConnection.cs#1)]
  5393. ]]></format>
  5394. </remarks>
  5395. </member>
  5396. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String)">
  5397. <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>
  5398. <format type="text/markdown"><![CDATA[
  5399. ## Remarks
  5400. 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.
  5401. |Properties|Initial value|
  5402. |----------------|-------------------|
  5403. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>|`connectionString`|
  5404. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A>|15|
  5405. |<xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A>|empty string ("")|
  5406. |<xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A>|empty string ("")|
  5407. 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.
  5408. ## Examples
  5409. The following example creates and opens a <xref:Microsoft.Data.SqlClient.SqlConnection>.
  5410. [!code-csharp[SqlConnection_SqlConnection1 Example#1](~/../sqlclient/doc/samples/SqlConnection_SqlConnection1.cs#1)]
  5411. ]]></format>
  5412. </remarks><exception cref="T:System.ArgumentException">The supplied connection string argument failed <see cref="T:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" /> validation.</exception>
  5413. </member>
  5414. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String,Microsoft.Data.SqlClient.SqlCredential)">
  5415. <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><exception cref="T:System.ArgumentException">The supplied arguments failed validation, including <see cref="T:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" /> validation.</exception>
  5416. </member>
  5417. <member name="P:Microsoft.Data.SqlClient.SqlConnection.AccessToken">
  5418. <summary>Gets or sets the access token for the connection.</summary><value>The access token for the connection.</value><remarks>To be added.</remarks>
  5419. </member>
  5420. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ClientConnectionId">
  5421. <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>
  5422. <format type="text/markdown"><![CDATA[
  5423. ## Remarks
  5424. <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.
  5425. 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.
  5426. ]]></format>
  5427. </remarks>
  5428. </member>
  5429. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ColumnEncryptionKeyCacheTtl">
  5430. <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>
  5431. </member>
  5432. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ColumnEncryptionQueryMetadataCacheEnabled">
  5433. <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>
  5434. <format type="text/markdown"><![CDATA[
  5435. ## Remarks
  5436. 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.
  5437. 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.
  5438. ]]></format>
  5439. </remarks>
  5440. </member>
  5441. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ColumnEncryptionTrustedMasterKeyPaths">
  5442. <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>
  5443. </member>
  5444. <member name="P:Microsoft.Data.SqlClient.SqlConnection.CommandTimeout">
  5445. <summary>
  5446. Gets the default wait time (in seconds) before terminating the attempt to execute a command and generating an error. The default is 30 seconds.
  5447. </summary><value>
  5448. The time in seconds to wait for the command to execute. The default is 30 seconds.
  5449. </value><remarks>
  5450. <format type="text/markdown"><![CDATA[
  5451. ## Remarks
  5452. You can set the default wait time by using the `Command Timeout` keyword in the connection string. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).
  5453. ]]></format>
  5454. </remarks>
  5455. </member>
  5456. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString">
  5457. <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>
  5458. <format type="text/markdown">
  5459. <![CDATA[
  5460. ## Remarks
  5461. 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`.
  5462. 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.
  5463. ```
  5464. "Persist Security Info=False;Integrated Security=true;Initial Catalog=Northwind;server=(local)"
  5465. ```
  5466. Use the new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> to construct valid connection strings at run time. For more information, see [Connection String Builders](/sql/connect/ado-net/connection-string-builders).
  5467. 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>.
  5468. 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.
  5469. 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".
  5470. 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.
  5471. 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.
  5472. 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.
  5473. Keywords are not case sensitive.
  5474. The following table lists the valid names for keyword values within the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
  5475. |Keyword|Default|Description|
  5476. |-------------|-------------|-----------------|
  5477. |Addr|N/A|Synonym of **Data Source**.|
  5478. |Address|N/A|Synonym of **Data Source**.|
  5479. |App|N/A|Synonym of **Application Name**.|
  5480. |Application Intent<br /><br /> -or-<br /><br />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](/sql/connect/ado-net/sql/sqlclient-support-high-availability-disaster-recovery).|
  5481. |Application Name|N/A|The name of the application. If no application name is provided, 'Framework Microsoft SqlClient Data Provider' when running on .NET Framework and 'Core Microsoft SqlClient Data Provider' otherwise.<br /><br /> An application name can be 128 characters or less.|
  5482. |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.|
  5483. |Attestation Protocol|NotSpecified|Gets or sets the value of Attestation Protocol.<br /><br />When no value is specified, secure enclaves are disabled on the connection.<br /><br />Valid values are:<br />`AAS`<br />`HGS`<br />`None` (Only valid in v3.1 and v4.1+))|
  5484. |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`, `Active Directory Service Principal`, `Active Directory Device Code Flow`, `Active Directory Managed Identity`, `Active Directory MSI`, `Active Directory Default`, `Sql Password`.|
  5485. |Column Encryption Setting|disabled|Enables or disables [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine) functionality for the connection. Supported values are: `enabled` and `disabled`|
  5486. |Command Timeout|30|The default wait time (in seconds) before terminating the attempt to execute a command and generating an error.<br /><br /> Valid values are greater than or equal to 0 and less than or equal to 2147483647.|
  5487. |Connect Retry Count<br /><br /> -or-<br /><br />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).|
  5488. |Connect Retry Interval<br /><br /> -or-<br /><br />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).|
  5489. |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.|
  5490. |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.|
  5491. |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 /> 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](/sql/connect/ado-net/sql/sqlclient-support-localdb).<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 application will connect.<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**.|
  5492. |Enclave Attestation Url|N/A|Gets or sets the enclave attestation URL to be used with enclave based Always Encrypted.|
  5493. |Encrypt|'true' in 4.0 and above<br/><br/>'false' in 3.x and below|Recognized values are:<br/>versions 1 - 4: `true`/`yes` and `false`/`no`<br/>versions 5+: `true`/`yes`/`mandatory`, `false`/`no`/`optional` and `strict`. When `true`, TLS encryption is used for all data sent between the client and server if the server has a certificate installed. When `strict`, TDS 8.0 TLS encryption is used and the `TrustServerCertificate` setting is ignored and treated as false. For more information, see [Connection String Syntax](/sql/connect/ado-net/connection-string-syntax).<br /><br /> When `Encrypt` is `mandatory` or `strict` and `TrustServerCertificate` is `false`, the server name (or IP address) in a server's certificate must exactly match the server name (or IP address) specified in the connection string. Otherwise, the connection attempt will fail. |
  5494. |Enlist|'true'|`true` indicates that the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.|
  5495. |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.|
  5496. |Failover Partner SPN<br /><br /> -or-<br /><br /> FailoverPartnerSPN|N/A|The SPN for the failover partner. The default value is an empty string, which causes SqlClient to use the default, driver-generated SPN.<br /><br /> (Only available in v5.0+)|
  5497. |Host Name In Certificate<br /><br /> -or-<br /><br />HostNameInCertificate|N/A|Available starting in version 5.0.<br/><br/>The host name to use when validating the server certificate. When not specified, the server name from the Data Source is used for certificate validation.|
  5498. |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.|
  5499. |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`).|
  5500. |IP Address Preference<br /><br /> -or-<br /><br /> IPAddressPreference|IPv4First|The IP address family preference when establishing TCP connections. If `Transparent Network IP Resolution` (in .NET Framework) or `Multi Subnet Failover` is set to true, this setting has no effect. Supported values include:<br /><br /> `IPAddressPreference=IPv4First`<br /><br />`IPAddressPreference=IPv6First`<br /><br />`IPAddressPreference=UsePlatformDefault`|
  5501. |Load Balance Timeout<br /><br /> -or-<br /><br /> Connection Lifetime|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.|
  5502. |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.|
  5503. |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.|
  5504. |Multiple Active Result Sets<br /><br /> -or-<br /><br />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)](/sql/connect/ado-net/sql/multiple-active-result-sets-mars).|
  5505. |Multi Subnet Failover<br /><br /> -or-<br /><br />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](/sql/connect/ado-net/sql/sqlclient-support-high-availability-disaster-recovery).|
  5506. |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;`|
  5507. |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.|
  5508. |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.|
  5509. |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 or access token, is not returned as part of the connection if the connection is open or has ever been in an open state. This property should only be set to `true` if your application has a specific need to read the password out of an already-opened database connection. The default value of `false` is the more secure setting; using `true` for this property opens your application to security risks such as accidentally logging or tracing the database password.<br /><br />Resetting the connection string resets all connection string values including the password. Recognized values are `true`, `false`, `yes`, and `no`.|
  5510. |Pool Blocking Period<br /><br /> -or-<br /><br />PoolBlockingPeriod|Auto|Sets the blocking period behavior for a connection pool. See <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod> property for details.|
  5511. |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".|
  5512. |Replication|'false'|`true` if replication is supported using the connection.|
  5513. |Server SPN<br /><br /> -or-<br /><br /> ServerSPN|N/A|The SPN for the data source. The default value is an empty string, which causes SqlClient to use the default, driver-generated SPN.<br /><br /> (Only available in v5.0+)|
  5514. |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.|
  5515. |Transparent Network IP Resolution<br /><br /> -or-<br /><br />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>|
  5516. |Trust Server Certificate<br /><br /> -or-<br /><br />TrustServerCertificate|'false'|When set to `true`, TLS 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](/sql/connect/ado-net/connection-string-syntax).|
  5517. |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](/dotnet/framework/data/adonet/sql/sql-server-common-language-runtime-integration). <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;`.|
  5518. |User ID<br /><br /> -or-<br /><br /> UID<br /><br /> -or-<br /><br /> User|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.|
  5519. |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.|
  5520. |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.|
  5521. 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)](/sql/connect/ado-net/sql-server-connection-pooling).
  5522. - Connection Lifetime (or Load Balance Timeout)
  5523. - Enlist
  5524. - Max Pool Size
  5525. - Min Pool Size
  5526. - Pooling
  5527. 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.
  5528. > [!NOTE]
  5529. > 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.
  5530. > [!NOTE]
  5531. > Universal data link (UDL) files are not supported for the .NET Framework Data Provider for SQL Server.
  5532. > [!CAUTION]
  5533. > 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](/sql/connect/ado-net/connection-string-builders) for more information.
  5534. ## Examples
  5535. 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.
  5536. [!code-csharp[SqlConnection_ConnectionString Example#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionString.cs#1)]
  5537. ]]></format>
  5538. </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>
  5539. </member>
  5540. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout">
  5541. <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>
  5542. <format type="text/markdown"><![CDATA[
  5543. ## Remarks
  5544. 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.
  5545. ## Examples
  5546. 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.
  5547. [!code-csharp[SqlConnection_ConnectionTimeout Example#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionTimeout.cs#1)]
  5548. ]]></format>
  5549. </remarks><exception cref="T:System.ArgumentException">The value set is less than 0.</exception>
  5550. </member>
  5551. <member name="P:Microsoft.Data.SqlClient.SqlConnection.Credential">
  5552. <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>
  5553. <format type="text/markdown"><![CDATA[
  5554. ## Remarks
  5555. `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>.
  5556. The default value of <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is null.
  5557. An <xref:System.InvalidOperationException> exception will be raised:
  5558. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set on an open connection.
  5559. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when `Integrated Security = true`.
  5560. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when the connection string uses `Password`.
  5561. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when the connection string uses `UserID`.
  5562. ]]></format>
  5563. </remarks>
  5564. </member>
  5565. <member name="P:Microsoft.Data.SqlClient.SqlConnection.Database">
  5566. <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>
  5567. <format type="text/markdown"><![CDATA[
  5568. ## Remarks
  5569. 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.
  5570. ## Examples
  5571. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  5572. [!code-csharp[SqlConnection_Database Example#1](~/../sqlclient/doc/samples/SqlConnection_Database.cs#1)]
  5573. ]]></format>
  5574. </remarks>
  5575. </member>
  5576. <member name="P:Microsoft.Data.SqlClient.SqlConnection.DataSource">
  5577. <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>
  5578. <format type="text/markdown"><![CDATA[
  5579. ## Examples
  5580. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  5581. [!code-csharp[SqlConnection_DataSource Example#1](~/../sqlclient/doc/samples/SqlConnection_DataSource.cs#1)]
  5582. ]]></format>
  5583. </remarks>
  5584. </member>
  5585. <member name="P:Microsoft.Data.SqlClient.SqlConnection.DbProviderFactory">
  5586. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  5587. </member>
  5588. <member name="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors">
  5589. <summary>Gets or sets the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors" /> property.</summary><value>
  5590. <see langword="true" /> if the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors" /> property has been set; otherwise <see langword="false" />.</value><remarks>
  5591. <format type="text/markdown"><![CDATA[
  5592. ## Remarks
  5593. 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.
  5594. > [!NOTE]
  5595. > 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.
  5596. For more information on working with events, see [Connection Events](/sql/connect/ado-net/connection-events). 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).
  5597. ]]></format>
  5598. </remarks>
  5599. </member>
  5600. <member name="P:Microsoft.Data.SqlClient.SqlConnection.PacketSize">
  5601. <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>
  5602. <format type="text/markdown"><![CDATA[
  5603. ## Remarks
  5604. 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.
  5605. <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.
  5606. 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).
  5607. ## Examples
  5608. 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.
  5609. [!code-csharp[SqlConnection_PacketSize Example#1](~/../sqlclient/doc/samples/SqlConnection_PacketSize.cs#1)]
  5610. ]]></format>
  5611. </remarks>
  5612. </member>
  5613. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ServerVersion">
  5614. <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>
  5615. <format type="text/markdown"><![CDATA[
  5616. ## Remarks
  5617. 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.
  5618. <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>.
  5619. ## Examples
  5620. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.ServerVersion%2A> property.
  5621. [!code-csharp[SqlConnection_ServerVersion Example#1](~/../sqlclient/doc/samples/SqlConnection_ServerVersion.cs#1)]
  5622. ]]></format>
  5623. </remarks><exception cref="T:System.InvalidOperationException">The connection is closed.
  5624. <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>
  5625. </member>
  5626. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ServerProcessId">
  5627. <summary>Gets the server process Id (SPID) of the active connection.</summary><value>The server process Id (SPID) of the active connection.</value><remarks>Returns 0 if the connection is inactive on the client side.</remarks>
  5628. </member>
  5629. <member name="P:Microsoft.Data.SqlClient.SqlConnection.State">
  5630. <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>
  5631. <format type="text/markdown"><![CDATA[
  5632. ## Remarks
  5633. 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>.
  5634. ]]></format>
  5635. </remarks>
  5636. </member>
  5637. <member name="P:Microsoft.Data.SqlClient.SqlConnection.StatisticsEnabled">
  5638. <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>
  5639. <format type="text/markdown"><![CDATA[
  5640. ## Remarks
  5641. Enabling statistics gathering has a minor, but measurable effect on performance and therefore should be enabled only when it is required.
  5642. ]]></format>
  5643. </remarks>
  5644. </member>
  5645. <member name="P:Microsoft.Data.SqlClient.SqlConnection.WorkstationId">
  5646. <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>
  5647. <format type="text/markdown"><![CDATA[
  5648. ## Remarks
  5649. 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.
  5650. ## Examples
  5651. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.WorkstationId%2A> property.
  5652. [!code-csharp[SqlConnection_WorkstationId Example#1](~/../sqlclient/doc/samples/SqlConnection_WorkstationId.cs#1)]
  5653. ]]></format>
  5654. </remarks>
  5655. </member>
  5656. <member name="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage">
  5657. <summary>Occurs when SQL Server returns a warning or informational message.</summary><remarks>
  5658. <format type="text/markdown"><![CDATA[
  5659. ## Remarks
  5660. 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.
  5661. 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).
  5662. For more information and an example, see [Connection Events](/sql/connect/ado-net/connection-events).
  5663. ]]></format>
  5664. </remarks>
  5665. </member>
  5666. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginDbTransaction(System.Data.IsolationLevel)">
  5667. <param name="isolationLevel">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5668. </member>
  5669. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction">
  5670. <summary>Starts a database transaction.</summary><returns>An object representing the new transaction.</returns><remarks>
  5671. <format type="text/markdown"><![CDATA[
  5672. ## Remarks
  5673. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5674. 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.
  5675. > [!NOTE]
  5676. > 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.
  5677. > [!CAUTION]
  5678. > 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**.
  5679. > [!CAUTION]
  5680. > 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.
  5681. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5682. ## Examples
  5683. 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.
  5684. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  5685. ]]></format>
  5686. </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>
  5687. </member>
  5688. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.Data.IsolationLevel)">
  5689. <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>
  5690. <format type="text/markdown"><![CDATA[
  5691. ## Remarks
  5692. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5693. 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.
  5694. > [!NOTE]
  5695. > 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).
  5696. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5697. > [!CAUTION]
  5698. > 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.
  5699. ## Examples
  5700. 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.
  5701. [!code-csharp[SqlConnection_BeginTransaction1 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction1.cs#1)]
  5702. ]]></format>
  5703. </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>
  5704. </member>
  5705. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.Data.IsolationLevel,System.String)">
  5706. <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>
  5707. <format type="text/markdown"><![CDATA[
  5708. ## Remarks
  5709. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5710. 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.
  5711. 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.
  5712. > [!NOTE]
  5713. > 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).
  5714. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5715. > [!CAUTION]
  5716. > 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.
  5717. ## Examples
  5718. 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.
  5719. [!code-csharp[SqlConnection_BeginTransaction3 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction3.cs#1)]
  5720. ]]></format>
  5721. </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>
  5722. </member>
  5723. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.String)">
  5724. <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>
  5725. <format type="text/markdown"><![CDATA[
  5726. ## Remarks
  5727. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  5728. The length of the `transactionName` parameter must not exceed 32 characters; otherwise an exception will be thrown.
  5729. 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.
  5730. 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.
  5731. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  5732. > [!CAUTION]
  5733. > 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.
  5734. ## Examples
  5735. 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.
  5736. [!code-csharp[SqlConnection_BeginTransaction2 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction2.cs#1)]
  5737. ]]></format>
  5738. </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>
  5739. </member>
  5740. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangeDatabase(System.String)">
  5741. <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>
  5742. <format type="text/markdown"><![CDATA[
  5743. ## Remarks
  5744. 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.
  5745. ## Examples
  5746. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  5747. [!code-csharp[SqlConnection_Database Example#1](~/../sqlclient/doc/samples/SqlConnection_Database.cs#1)]
  5748. ]]></format>
  5749. </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>
  5750. </member>
  5751. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,Microsoft.Data.SqlClient.SqlCredential,System.Security.SecureString)">
  5752. <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">
  5753. The connection string contains any combination of <see langword="UserId" />, <see langword="Password" />, or <see langword="Integrated Security=true" />.
  5754. -or-
  5755. <paramref name="newSecurePassword" /> is greater than 128 characters.
  5756. -or-
  5757. <paramref name="newSecurePassword" /> is not read only.
  5758. -or-
  5759. <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>
  5760. </member>
  5761. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,System.String)">
  5762. <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>
  5763. <format type="text/markdown"><![CDATA[
  5764. ## Remarks
  5765. 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.
  5766. 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.
  5767. 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.
  5768. 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.
  5769. ## Examples
  5770. The following is a simple example of changing a password:
  5771. ```csharp
  5772. class Program {
  5773. static void Main(string[] args) {
  5774. Microsoft.Data.SqlClient.SqlConnection.ChangePassword(
  5775. "Data Source=a_server;Initial Catalog=a_database;UID=user;PWD=old_password",
  5776. "new_password");
  5777. }
  5778. }
  5779. ```
  5780. ```vb
  5781. Module Module1
  5782. Sub Main()
  5783. Microsoft.Data.SqlClient.SqlConnection.ChangePassword(
  5784. "Data Source=a_server;Initial Catalog=a_database;UID=user;PWD=old_password",
  5785. "new_password")
  5786. End Sub
  5787. End Module
  5788. ```
  5789. The following console application demonstrates the issues involved in changing a user's password because the current password has expired.
  5790. [!code-csharp[SqlConnection_ConnectionString1#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionString1.cs#1)]
  5791. ]]></format>
  5792. </remarks><exception cref="T:System.ArgumentException">The connection string includes the option to use integrated security.
  5793. Or
  5794. 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>
  5795. </member>
  5796. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ClearAllPools">
  5797. <summary>Empties the connection pool.</summary><remarks>
  5798. <format type="text/markdown"><![CDATA[
  5799. ## Remarks
  5800. <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.
  5801. ]]></format>
  5802. </remarks>
  5803. </member>
  5804. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ClearPool(Microsoft.Data.SqlClient.SqlConnection)">
  5805. <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>
  5806. <format type="text/markdown"><![CDATA[
  5807. ## Remarks
  5808. <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.
  5809. ]]></format>
  5810. </remarks>
  5811. </member>
  5812. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Close">
  5813. <summary>Closes the connection to the database. This is the preferred method of closing any open connection.</summary><remarks>
  5814. <format type="text/markdown"><![CDATA[
  5815. ## Remarks
  5816. 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.
  5817. > [!NOTE]
  5818. > 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`.
  5819. An application can call <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> more than one time. No exception is generated.
  5820. 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.
  5821. > [!NOTE]
  5822. > 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)](/sql/connect/ado-net/sql-server-connection-pooling).
  5823. > [!CAUTION]
  5824. > 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](/dotnet/standard/garbage-collection/).
  5825. ## Examples
  5826. 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.
  5827. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  5828. ]]></format>
  5829. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">The connection-level error that occurred while opening the connection.</exception>
  5830. </member>
  5831. <member name="M:Microsoft.Data.SqlClient.SqlConnection.CreateCommand">
  5832. <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>
  5833. <format type="text/markdown"><![CDATA[
  5834. ## Examples
  5835. [!code-csharp[SqlConnection_CreateCommand#1](~/../sqlclient/doc/samples/SqlConnection_CreateCommand.cs#1)]
  5836. ]]></format>
  5837. </remarks>
  5838. </member>
  5839. <member name="M:Microsoft.Data.SqlClient.SqlConnection.CreateDbCommand">
  5840. <summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  5841. </member>
  5842. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Dispose(System.Boolean)">
  5843. <param name="disposing">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  5844. </member>
  5845. <member name="M:Microsoft.Data.SqlClient.SqlConnection.EnlistDistributedTransaction(System.EnterpriseServices.ITransaction)">
  5846. <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>
  5847. <format type="text/markdown"><![CDATA[
  5848. ## Remarks
  5849. 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](/sql/connect/ado-net/distributed-transactions).
  5850. 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.
  5851. `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>.
  5852. ]]></format>
  5853. </remarks>
  5854. </member>
  5855. <member name="M:Microsoft.Data.SqlClient.SqlConnection.EnlistTransaction(System.Transactions.Transaction)">
  5856. <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>
  5857. <format type="text/markdown"><![CDATA[
  5858. ## Remarks
  5859. 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](/sql/connect/ado-net/distributed-transactions).
  5860. ]]></format>
  5861. </remarks>
  5862. </member>
  5863. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema">
  5864. <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](/sql/connect/ado-net/sql-server-schema-collections).</summary><returns>A <see cref="T:System.Data.DataTable" /> that contains schema information.</returns><remarks>To be added.</remarks>
  5865. </member>
  5866. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema(System.String)">
  5867. <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>
  5868. <format type="text/markdown"><![CDATA[
  5869. ## Remarks
  5870. You may need the schema information of the database, tables or columns. This sample:
  5871. - Uses GetSchema to get schema information.
  5872. - Use schema restrictions to get the specified information.
  5873. - Gets schema information of the database, tables, and some columns.
  5874. Before you run the sample, you need to create the sample database, using the following Transact-SQL:
  5875. ```
  5876. USE [master]
  5877. GO
  5878. CREATE DATABASE [MySchool]
  5879. GO
  5880. USE [MySchool]
  5881. GO
  5882. SET ANSI_NULLS ON
  5883. GO
  5884. SET QUOTED_IDENTIFIER ON
  5885. GO
  5886. CREATE TABLE [dbo].[Course]([CourseID] [nvarchar](10) NOT NULL,
  5887. [Year] [smallint] NOT NULL,
  5888. [Title] [nvarchar](100) NOT NULL,
  5889. [Credits] [int] NOT NULL,
  5890. [DepartmentID] [int] NOT NULL,
  5891. CONSTRAINT [PK_Course] PRIMARY KEY CLUSTERED
  5892. (
  5893. [CourseID] ASC,
  5894. [Year] ASC
  5895. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
  5896. GO
  5897. SET ANSI_NULLS ON
  5898. GO
  5899. SET QUOTED_IDENTIFIER ON
  5900. GO
  5901. CREATE TABLE [dbo].[Department]([DepartmentID] [int] IDENTITY(1,1) NOT NULL,
  5902. [Name] [nvarchar](50) NOT NULL,
  5903. [Budget] [money] NOT NULL,
  5904. [StartDate] [datetime] NOT NULL,
  5905. [Administrator] [int] NULL,
  5906. CONSTRAINT [PK_Department] PRIMARY KEY CLUSTERED
  5907. (
  5908. [DepartmentID] ASC
  5909. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
  5910. GO
  5911. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C1045', 2012, N'Calculus', 4, 7)
  5912. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C1061', 2012, N'Physics', 4, 1)
  5913. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C2021', 2012, N'Composition', 3, 2)
  5914. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C2042', 2012, N'Literature', 4, 2)
  5915. SET IDENTITY_INSERT [dbo].[Department] ON
  5916. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (1, N'Engineering', 350000.0000, CAST(0x0000999C00000000 AS DateTime), 2)
  5917. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (2, N'English', 120000.0000, CAST(0x0000999C00000000 AS DateTime), 6)
  5918. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (4, N'Economics', 200000.0000, CAST(0x0000999C00000000 AS DateTime), 4)
  5919. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (7, N'Mathematics', 250024.0000, CAST(0x0000999C00000000 AS DateTime), 3)
  5920. SET IDENTITY_INSERT [dbo].[Department] OFF
  5921. ALTER TABLE [dbo].[Course] WITH CHECK ADD CONSTRAINT [FK_Course_Department] FOREIGN KEY([DepartmentID])
  5922. REFERENCES [dbo].[Department] ([DepartmentID])
  5923. GO
  5924. ALTER TABLE [dbo].[Course] CHECK CONSTRAINT [FK_Course_Department]
  5925. GO
  5926. ```
  5927. [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.
  5928. [!code-csharp[SqlConnection.GetSchema#1](~/../sqlclient/doc/samples/SqlConnection_GetSchema.cs#1)]
  5929. ]]></format>
  5930. </remarks><exception cref="T:System.ArgumentException">
  5931. <paramref name="collectionName" /> is specified as null.</exception>
  5932. </member>
  5933. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema(System.String,System.String[])">
  5934. <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>
  5935. <format type="text/markdown"><![CDATA[
  5936. ## Remarks
  5937. 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.
  5938. 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.
  5939. For a code sample demonstrating <xref:Microsoft.Data.SqlClient.SqlConnection.GetSchema%2A>, see <xref:Microsoft.Data.SqlClient.SqlConnection.GetSchema%2A>.
  5940. ]]></format>
  5941. </remarks><exception cref="T:System.ArgumentException">
  5942. <paramref name="collectionName" /> is specified as null.</exception><altmember cref="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema" />
  5943. </member>
  5944. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Open">
  5945. <summary>Opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />.</summary><remarks>
  5946. <format type="text/markdown"><![CDATA[
  5947. ## Remarks
  5948. 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.
  5949. > [!NOTE]
  5950. > 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>.
  5951. > [!NOTE]
  5952. > 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.
  5953. > [!NOTE]
  5954. > 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.
  5955. ## Examples
  5956. 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.
  5957. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  5958. ]]></format>
  5959. </remarks><exception cref="T:System.InvalidOperationException">Cannot open a connection without specifying a data source or server.
  5960. or
  5961. 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.
  5962. 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>
  5963. </member>
  5964. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Open(Microsoft.Data.SqlClient.SqlConnectionOverrides)">
  5965. <param name="overrides">Options to override default connection open behavior.</param><summary>
  5966. Opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />.
  5967. </summary><remarks>
  5968. <format type="text/markdown">
  5969. <![CDATA[
  5970. ## Remarks
  5971. 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. If overrides are specified, the first open attempt will apply the specified overrides to the open action.
  5972. > [!NOTE]
  5973. > 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>.
  5974. > [!NOTE]
  5975. > 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.
  5976. > [!NOTE]
  5977. > 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.
  5978. ## Examples
  5979. 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.
  5980. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  5981. ]]>
  5982. </format>
  5983. </remarks><exception cref="T:System.InvalidOperationException">Cannot open a connection without specifying a data source or server.
  5984. or
  5985. The connection is already open.
  5986. </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.
  5987. 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>
  5988. </member>
  5989. <member name="M:Microsoft.Data.SqlClient.SqlConnection.OpenAsync(System.Threading.CancellationToken)">
  5990. <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>
  5991. <format type="text/markdown"><![CDATA[
  5992. ## Remarks
  5993. 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>.
  5994. 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.
  5995. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  5996. ]]></format>
  5997. </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.
  5998. 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>
  5999. </member>
  6000. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProviders(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})">
  6001. <param name="customProviders">Dictionary of custom column encryption key store providers</param><summary>
  6002. 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.
  6003. The built-in column master key store providers that are available for the Windows Certificate Store, CNG Store and CSP are pre-registered.
  6004. </summary><remarks>
  6005. <format type="text/markdown"><![CDATA[
  6006. ## Examples
  6007. ```csharp
  6008. Dictionary<string, SqlColumnEncryptionKeyStoreProvider> customKeyStoreProviders = new Dictionary<string, SqlColumnEncryptionKeyStoreProvider>();
  6009. MySqlClientHSMProvider myProvider = new MySqlClientHSMProvider();
  6010. customKeyStoreProviders.Add(@"HSM Provider", myProvider);
  6011. SqlConnection.RegisterColumnEncryptionKeyStoreProviders(customKeyStoreProviders);
  6012. ```
  6013. ]]></format>
  6014. </remarks><exception cref="T:System.ArgumentNullException">
  6015. A null dictionary was provided.
  6016. -or-
  6017. A string key in the dictionary was null or empty.
  6018. -or-
  6019. A <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider" /> value in the dictionary was null.
  6020. </exception><exception cref="T:System.ArgumentException">
  6021. A string key in the dictionary started with "MSSQL_". This prefix is reserved for system providers.
  6022. </exception><exception cref="T:System.InvalidOperationException">
  6023. This function was called more than once.
  6024. </exception>
  6025. </member>
  6026. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProvidersOnConnection(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})">
  6027. <param name="customProviders">Dictionary of custom column encryption key providers</param><summary>Registers the encryption key store providers on the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> instance. If this function has been called, any providers registered using the static <see cref="M:Microsoft.Data.SqlClient.SqlConnection.RegisterColumnEncryptionKeyStoreProviders(System.Collections.Generic.IDictionary{System.String,Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider})" /> methods will be ignored. This function can be called more than once. This does shallow copying of the dictionary so that the app cannot alter the custom provider list once it has been set.</summary><exception cref="T:System.ArgumentNullException">
  6028. A null dictionary was provided.
  6029. -or-
  6030. A string key in the dictionary was null or empty.
  6031. -or-
  6032. A <see cref="T:Microsoft.Data.SqlClient.SqlColumnEncryptionKeyStoreProvider" /> value in the dictionary was null.
  6033. </exception><exception cref="T:System.ArgumentException">
  6034. A string key in the dictionary started with "MSSQL_". This prefix is reserved for system providers.
  6035. </exception><remarks>
  6036. <format type="text/markdown"><![CDATA[
  6037. ## Remarks
  6038. Custom master key store providers can be registered with the driver at three different layers. The precedence of the three registrations is as follows:
  6039. - The per-command registration will be checked if it is not empty.
  6040. - If the per-command registration is empty, the per-connection registration will be checked if it is not empty.
  6041. - If the per-connection registration is empty, the global registration will be checked.
  6042. Once any key store provider is found at a registration level, the driver will **NOT** fall back to the other registrations to search for a provider. If providers are registered but the proper provider is not found at a level, an exception will be thrown containing only the registered providers in the registration that was checked.
  6043. The built-in column master key store providers that are available for the Windows Certificate Store, CNG Store and CSP are pre-registered.
  6044. This does shallow copying of the dictionary so that the app cannot alter the custom provider list once it has been set.
  6045. ]]></format>
  6046. </remarks>
  6047. </member>
  6048. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ResetStatistics">
  6049. <summary>If statistics gathering is enabled, all values are reset to zero.</summary><remarks>
  6050. <format type="text/markdown"><![CDATA[
  6051. ## Remarks
  6052. If statistics gathering is not enabled and this method is called, no error is thrown.
  6053. ]]></format>
  6054. </remarks>
  6055. </member>
  6056. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RetrieveStatistics">
  6057. <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>
  6058. <format type="text/markdown"><![CDATA[
  6059. ## Remarks
  6060. 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.
  6061. ]]></format>
  6062. </remarks>
  6063. </member>
  6064. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RetrieveInternalInfo">
  6065. <summary>Returns a name value pair collection of internal properties at the point in time the method is called.</summary><returns>Returns a reference of type <see cref="T:System.Collections.Generic.IDictionary`2" /> of (string, object) items.</returns><remarks>
  6066. <format type="text/markdown"><![CDATA[
  6067. ## Remarks
  6068. 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.
  6069. |Supported internal properties|Type|Information provided|Return value|
  6070. |-----------------------------|---------|----------------------------|------------|
  6071. |`SQLDNSCachingSupportedState`|string|To indicate the IsSupported flag sent by the server for DNS Caching|"true", "false", "innerConnection is null!"|
  6072. |`SQLDNSCachingSupportedStateBeforeRedirect`|string|To indicate the IsSupported flag sent by the server for DNS Caching before redirection.|"true", "false", "innerConnection is null!"|
  6073. ]]></format>
  6074. </remarks>
  6075. </member>
  6076. <member name="P:Microsoft.Data.SqlClient.SqlConnection.RetryLogicProvider">
  6077. <summary> Gets or sets a value that specifies the
  6078. <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" />
  6079. object bound to this command.
  6080. </summary><value>
  6081. When set to null (default), the default non-retriable provider will be applied.
  6082. </value><remarks>
  6083. <format type="text/markdown"><![CDATA[
  6084. ## Remarks
  6085. You must set the value for this property before opening the connection to take effect.
  6086. To apply the retry logic, do the following steps before opening the connection:
  6087. 1. Define the configuration parameters by using <xref:Microsoft.Data.SqlClient.SqlRetryLogicOption> type.
  6088. 2. Create a <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> by using one of the following static methods of the <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory> class:
  6089. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider%2A>
  6090. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider%2A>
  6091. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider%2A>
  6092. - <xref:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider%2A>
  6093. 3. Assign the <xref:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider> object to the `RetryLogicProvider` property.
  6094. > [!NOTE]
  6095. > Detecting retriable exceptions is a vital part of the retry pattern. Before applying retry logic, it is important to investigate exceptions and choose a retry provider that best fits your scenario. First, log your exceptions and find transient faults.
  6096. > [!NOTE]
  6097. > The connection **timeout** restarts for each execution of a connection open. There is no timing overlap between these two actions.
  6098. > [!NOTE]
  6099. > The default retry logic provider is not enabled unless it is configured in an application configuration file. For more information, see [Configurable retry logic and configuration file](/sql/connect/ado-net/configurable-retry-logic-config-file-sqlclient).
  6100. ## Example
  6101. The following sample tries to open a connection to an invalid database to simulate a condition that the database service is temporarily unavailable . You should manually create the database while the <xref:Microsoft.Data.SqlClient.SqlConnection> tries to establish the connection.
  6102. [!code-csharp[SqlConfigurableRetryLogic_OpenConnection#1](~/../sqlclient/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs#1)]
  6103. ]]></format>
  6104. </remarks>
  6105. </member>
  6106. <member name="T:Microsoft.Data.SqlClient.SqlConnectionColumnEncryptionSetting">
  6107. <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>
  6108. </member>
  6109. <member name="F:Microsoft.Data.SqlClient.SqlConnectionColumnEncryptionSetting.Disabled">
  6110. <summary>Specifies the connection does not use Always Encrypted. Should be used if no queries sent over the connection access encrypted columns.</summary>
  6111. </member>
  6112. <member name="F:Microsoft.Data.SqlClient.SqlConnectionColumnEncryptionSetting.Enabled">
  6113. <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>
  6114. </member>
  6115. <member name="T:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol">
  6116. <summary>
  6117. Specifies a value for Attestation Protocol.
  6118. </summary>
  6119. </member>
  6120. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.NotSpecified">
  6121. <summary>If the attestation protocol is not specified. Use this as default value.</summary><value>0</value>
  6122. </member>
  6123. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.AAS">
  6124. <summary>Attestation portocol for Azure Attestation Service</summary><value>1</value>
  6125. </member>
  6126. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.None">
  6127. <summary>Attestation protocol for no attestation. Only compatible with Virtualization-based security (VBS) enclaves. An Enclave Attestation Url is not required when using this protocol.</summary><value>2</value>
  6128. </member>
  6129. <member name="F:Microsoft.Data.SqlClient.SqlConnectionAttestationProtocol.HGS">
  6130. <summary>Attestation protocol for Host Guardian Service</summary><value>3</value>
  6131. </member>
  6132. <member name="T:Microsoft.Data.SqlClient.SqlConnectionIPAddressPreference">
  6133. <summary>
  6134. Specifies a value for IP address preference during a TCP connection.
  6135. </summary><remarks>
  6136. <format type="text/markdown"><![CDATA[
  6137. ## Remarks
  6138. If `Multi Subnet Failover` or "Transparent Network IP Resolution" is set to `true`, this setting has no effect.
  6139. ]]></format>
  6140. </remarks>
  6141. </member>
  6142. <member name="F:Microsoft.Data.SqlClient.SqlConnectionIPAddressPreference.IPv4First">
  6143. <summary>Connects using IPv4 address(es) first. If the connection fails, try IPv6 address(es), if provided. This is the default value.</summary><value>0</value>
  6144. </member>
  6145. <member name="F:Microsoft.Data.SqlClient.SqlConnectionIPAddressPreference.IPv6First">
  6146. <summary>Connect using IPv6 address(es) first. If the connection fails, try IPv4 address(es), if available.</summary><value>1</value>
  6147. </member>
  6148. <member name="F:Microsoft.Data.SqlClient.SqlConnectionIPAddressPreference.UsePlatformDefault">
  6149. <summary>Connects with IP addresses in the order the underlying platform or operating system provides them.</summary><value>2</value>
  6150. </member>
  6151. <member name="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption">
  6152. <summary>These options are used to control encryption behavior of the communication between the server and the client.</summary><remarks>
  6153. <format type="text/markdown"><![CDATA[
  6154. ## Remarks
  6155. Implicit conversions have been added to maintain backwards compatibility with boolean behahavior for the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt%2A> property. When converting from a boolean, a value of `true` converts to <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory%2A> and a value of `false` converts to <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Optional%2A>. When converting to a boolean, <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory%2A>, <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Strict%2A> , and `null` convert to `true` and <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Optional%2A> converts `false`.
  6156. ]]></format>
  6157. </remarks>
  6158. </member>
  6159. <member name="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Optional">
  6160. <summary>Specifies that TLS encryption is optional when connecting to the server. If the server requires encryption, encryption will be negotiated.</summary>
  6161. </member>
  6162. <member name="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory">
  6163. <summary>Specifies that TLS encryption is required when connecting to the server. If the server doesn't support encryption, the connection will fail.</summary>
  6164. </member>
  6165. <member name="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Strict">
  6166. <summary>Enables and requires TDS 8.0, TLS encryption to the server. If the server doesn't support TDS 8.0, TLS encryption, the connection will fail.</summary>
  6167. </member>
  6168. <member name="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.op_Implicit(System.Boolean)~Microsoft.Data.SqlClient.SqlConnectionEncryptOption">
  6169. <param name="value">The boolean value to be used for implicit comparison.</param><summary>
  6170. Enables implicit converstion of a boolean to a <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" />. A value of <see langword="true" /> converts to <see cref="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory" />. A value of <see langword="false" /> converts to <see cref="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Optional" />.
  6171. </summary>
  6172. </member>
  6173. <member name="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.op_Implicit(Microsoft.Data.SqlClient.SqlConnectionEncryptOption)~System.Boolean">
  6174. <param name="value">The <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" /> value to be used for implicit comparison.</param><summary>
  6175. Enables implicit converstion of a <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" /> to a boolean. <see cref="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory" /> and <see cref="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Strict" /> convert to <see langword="true" />. <see cref="P:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Optional" /> converts to <see langword="false" />.
  6176. </summary>
  6177. </member>
  6178. <member name="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.ToString">
  6179. <summary>Returns the string value of <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" />.</summary>
  6180. </member>
  6181. <member name="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Equals(System.Object)">
  6182. <summary>
  6183. Compares the <see cref="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.ToString" /> representation of <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" /> to another <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" />.
  6184. </summary>
  6185. </member>
  6186. <member name="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.GetHashCode">
  6187. <summary>
  6188. Returns the hash code of the <see cref="M:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.ToString" /> value.
  6189. </summary>
  6190. </member>
  6191. <member name="T:Microsoft.Data.SqlClient.SqlConnectionOverrides">
  6192. <summary>
  6193. Specifies a value for Overrides.
  6194. </summary>
  6195. </member>
  6196. <member name="F:Microsoft.Data.SqlClient.SqlConnectionOverrides.None">
  6197. <summary>No overrides.</summary><value>0</value>
  6198. </member>
  6199. <member name="F:Microsoft.Data.SqlClient.SqlConnectionOverrides.OpenWithoutRetry">
  6200. <summary>Disable transient fault handling during the initial SqlConnection Open attempt.</summary><value>1</value>
  6201. </member>
  6202. <member name="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder">
  6203. <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>
  6204. <format type="text/markdown"><![CDATA[
  6205. ## Remarks
  6206. 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.
  6207. 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.
  6208. 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.
  6209. 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:
  6210. ```vb
  6211. Dim builder As New Microsoft.Data.SqlClient.SqlConnectionStringBuilder
  6212. builder("Data Source") = "(local)"
  6213. builder("Integrated Security") = True
  6214. builder("Initial Catalog") = "AdventureWorks;NewValue=Bad"
  6215. Console.WriteLine(builder.ConnectionString)
  6216. ```
  6217. ```csharp
  6218. Microsoft.Data.SqlClient.SqlConnectionStringBuilder builder =
  6219. new Microsoft.Data.SqlClient.SqlConnectionStringBuilder();
  6220. builder["Data Source"] = "(local)";
  6221. builder["Integrated Security"] = true;
  6222. builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad";
  6223. Console.WriteLine(builder.ConnectionString);
  6224. ```
  6225. The result is the following connection string that handles the invalid value in a safe manner:
  6226. ```
  6227. Source=(local);Initial Catalog="AdventureWorks;NewValue=Bad";
  6228. Integrated Security=True
  6229. ```
  6230. ## Examples
  6231. 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.
  6232. > [!NOTE]
  6233. > 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.
  6234. [!code-csharp[SqlConnectionStringBuilder#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder.cs#1)]
  6235. ]]></format>
  6236. </remarks>
  6237. </member>
  6238. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.#ctor">
  6239. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> class.</summary><remarks>To be added.</remarks>
  6240. </member>
  6241. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.#ctor(System.String)">
  6242. <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>
  6243. <format type="text/markdown"><![CDATA[
  6244. ## Remarks
  6245. 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.
  6246. ## Examples
  6247. 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.
  6248. > [!NOTE]
  6249. > 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.
  6250. [!code-csharp[SqlConnectionStringBuilder3#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder3.cs#1)]
  6251. ]]></format>
  6252. </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>
  6253. </member>
  6254. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationIntent">
  6255. <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](/sql/connect/ado-net/sql/sqlclient-support-high-availability-disaster-recovery).</summary><value>Returns the current value of the property.</value><remarks>
  6256. <format type="text/markdown"><![CDATA[
  6257. ## Remarks
  6258. This property corresponds to the "Application Intent" and "ApplicationIntent" keys within the connection string.
  6259. The default value is `ApplicationIntent.ReadWrite`.
  6260. ]]></format>
  6261. </remarks><related type="Article" href="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6262. </member>
  6263. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationName">
  6264. <summary>Gets or sets the name of the application associated with the connection string.</summary><value>The name of the application. If no name has been supplied, "Framework Microsoft SqlClient Data Provider" when running on .NET Framework and "Core Microsoft SqlClient Data Provider" otherwise.</value><remarks>
  6265. <format type="text/markdown"><![CDATA[
  6266. ## Remarks
  6267. This property corresponds to the "Application Name" and "app" keys within the connection string.
  6268. An application name can be 128 characters or less.
  6269. ## Examples
  6270. 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.
  6271. [!code-csharp[SqlConnectionStringBuilder.ApplicationName#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ApplicationName.cs#1)]
  6272. The sample displays the following text in the console window:
  6273. ```
  6274. Original: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  6275. ApplicationName="Core Microsoft SqlClient Data Provider"
  6276. Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True;Application Name="My Application"
  6277. ```
  6278. ]]></format>
  6279. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6280. </member>
  6281. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AttachDBFilename">
  6282. <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>
  6283. <format type="text/markdown"><![CDATA[
  6284. ## Remarks
  6285. This property corresponds to the "AttachDBFilename", "extended properties", and "initial file name" keys within the connection string.
  6286. `AttachDBFilename` is only supported for primary data files with an .mdf extension.
  6287. 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.
  6288. 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.
  6289. 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.
  6290. 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.
  6291. The database name must be specified with the keyword 'database' (or one of its aliases) as in the following:
  6292. `"AttachDbFileName=&#124;DataDirectory&#124;\data\YourDB.mdf;integrated security=true;database=YourDatabase"`
  6293. 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.
  6294. ## Examples
  6295. 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.
  6296. [!code-csharp[DataWorks SqlConnectionStringBuilder_AttachDBFilename#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_AttachDBFilename.cs#1)]
  6297. ]]></format>
  6298. </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="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6299. </member>
  6300. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Authentication">
  6301. <summary>Gets or sets 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).</summary><value>The authentication method of the connection string.</value><remarks>
  6302. <format type="text/markdown"><![CDATA[
  6303. ## Remarks
  6304. When no value is specified, secure enclaves are disabled on the connection.
  6305. For more information, see [Using Azure Active Directory authentication with SqlClient](/sql/connect/ado-net/sql/azure-active-directory-authentication).
  6306. ]]></format>
  6307. </remarks>
  6308. </member>
  6309. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ColumnEncryptionSetting">
  6310. <summary>Gets or sets the column encryption settings for the connection string builder.</summary><value>The column encryption settings for the connection string builder.This property enables or disables [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine) functionality for the connection.</value>
  6311. </member>
  6312. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.CommandTimeout">
  6313. <summary>
  6314. The default wait time (in seconds) before terminating the attempt to execute a command and generating an error. The default is 30 seconds.
  6315. </summary><value>
  6316. The time in seconds to wait for the command to execute. The default is 30 seconds.
  6317. </value><remarks>
  6318. <format type="text/markdown"><![CDATA[
  6319. ## Remarks
  6320. This property corresponds to the "Command Timeout" key within the <xref:Microsoft.Data.SqlClient.SqlConnection> connection string.
  6321. Valid values are greater than or equal to 0 and less than or equal to 2147483647.
  6322. ]]></format>
  6323. </remarks><exception cref="T:System.ArgumentException">The value set is less than 0.</exception>
  6324. </member>
  6325. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectionReset">
  6326. <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>
  6327. <format type="text/markdown"><![CDATA[
  6328. ## Remarks
  6329. 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.
  6330. ]]></format>
  6331. </remarks>
  6332. </member>
  6333. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryCount">
  6334. <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><remarks>
  6335. <format type="text/markdown">
  6336. <![CDATA[
  6337. ## Remarks
  6338. This property corresponds to the "Connect Retry Count" key within the <xref:Microsoft.Data.SqlClient.SqlConnection> connection string.
  6339. ]]>
  6340. </format>
  6341. </remarks>
  6342. </member>
  6343. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryInterval">
  6344. <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.</summary><value>Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure.</value><exception cref="T:System.ArgumentException">Value is outside of the allowed range.</exception><remarks>
  6345. <format type="text/markdown">
  6346. <![CDATA[
  6347. ## Remarks
  6348. This property corresponds to the "Connect Retry Interval" key within the <xref:Microsoft.Data.SqlClient.SqlConnection> connection string.
  6349. This value is 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.
  6350. ]]>
  6351. </format>
  6352. </remarks>
  6353. </member>
  6354. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectTimeout">
  6355. <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>
  6356. <format type="text/markdown"><![CDATA[
  6357. ## Remarks
  6358. This property corresponds to the "Connect Timeout", "connection timeout", and "timeout" keys within the connection string.
  6359. When opening a connection to a Azure SQL Database, set the connection timeout to 30 seconds.
  6360. Valid values are greater than or equal to 0 and less than or equal to 2147483647.
  6361. ## Examples
  6362. 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.
  6363. [!code-csharp[SqlConnectionStringBuilder_ConnectTimeout#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ConnectTimeout.cs#1)]
  6364. ]]></format>
  6365. </remarks>
  6366. </member>
  6367. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ContextConnection">
  6368. <summary>Obsolete. 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>
  6369. <format type="text/markdown"><![CDATA[
  6370. ## Remarks
  6371. This property corresponds to the "Context Connection" key within the connection string.
  6372. > [!NOTE]
  6373. > 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".
  6374. ]]></format>
  6375. </remarks>
  6376. </member>
  6377. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.CurrentLanguage">
  6378. <summary>Gets or sets the language used for database server warning or error messages..</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>
  6379. <format type="text/markdown"><![CDATA[
  6380. ## Remarks
  6381. This property corresponds to the "Current Language" and "language" keys within the connection string.
  6382. The language name can be 128 characters or less.
  6383. ]]></format>
  6384. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6385. </member>
  6386. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.DataSource">
  6387. <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>
  6388. <format type="text/markdown"><![CDATA[
  6389. ## Remarks
  6390. 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.
  6391. The port number can be specified after the server name: `server=tcp:servername, portnumber`.
  6392. When specifying a local instance, always use (local). To force a protocol, add one of the following prefixes:`np:(local), tcp:(local), lpc:(local)`.
  6393. You can also connect to a LocalDB database as follows: `server=(localdb)\\myInstance`. For more information about LocalDB, see [SqlClient Support for LocalDB](/sql/connect/ado-net/sql/sqlclient-support-localdb).
  6394. **Data Source** must use the TCP format or the Named Pipes format. TCP format is as follows:
  6395. - tcp:\<host name>\\<instance name\>
  6396. - tcp:\<host name>,\<TCP/IP port number>
  6397. 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.
  6398. The host name MUST be specified in one of the following ways:
  6399. - NetBIOSName
  6400. - IPv4Address
  6401. - IPv6Address
  6402. 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.
  6403. The Named Pipes format is as follows:
  6404. - np:\\\\<host name\>\pipe\\<pipe name\>
  6405. The Named Pipes format MUST start with the prefix "np:" and is followed by a named pipe name.
  6406. The host name MUST be specified in one of the following ways:
  6407. - NetBIOSName
  6408. - IPv4Address
  6409. - IPv6Address
  6410. The pipe name is used to identify the database instance to which the .NET application will connect.
  6411. 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**.
  6412. ## Examples
  6413. 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:
  6414. [!code-csharp[SqlConnectionStringBuilder_DataSource#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_DataSource.cs#1)]
  6415. ]]></format>
  6416. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6417. </member>
  6418. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.EnclaveAttestationUrl">
  6419. <summary>Gets or sets the enclave attestation URL to be used with enclave based Always Encrypted.</summary><value>The enclave attestation URL.</value>
  6420. </member>
  6421. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AttestationProtocol">
  6422. <summary>Gets or sets the value of Attestation Protocol.</summary><value>The attestation protocol.</value>
  6423. </member>
  6424. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IPAddressPreference">
  6425. <summary>Gets or sets the IP address family preference when establishing TCP connections.</summary><returns>Returns the IP address preference.</returns><remarks>
  6426. <format type="text/markdown"><![CDATA[
  6427. ## Remarks
  6428. If `Transparent Network IP Resolution` (in .NET Framework) or `Multi Subnet Failover` is set to true, this setting has no effect.
  6429. ]]></format>
  6430. </remarks>
  6431. </member>
  6432. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt">
  6433. <summary>Gets or sets a <see cref="T:Microsoft.Data.SqlClient.SqlConnectionEncryptOption" /> value since version 5.0 or a <see cref="T:System.Boolean" /> value for the earlier versions that indicates whether TLS encryption is required for all data sent between the client and server.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt" /> property.</value><remarks>
  6434. <format type="text/markdown"><![CDATA[
  6435. ## Remarks
  6436. This property corresponds to the "Encrypt" key within the connection string.
  6437. When `TrustServerCertificate` is false and `Encrypt` is <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory%2A>, <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Strict%2A> or `true`, the server name (or IP address) in a server's TLS 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 [Enable encrypted connections to the Database Engine](/sql/database-engine/configure-windows/enable-encrypted-connections-to-the-database-engine#certificate-requirements).
  6438. > [!NOTE]
  6439. > Starting from **version 4.0**, the default value of the property `Encrypt` is set to `true` while it is `false` for earlier versions.
  6440. > [!NOTE]
  6441. > Starting from **version 5.0**, the data type is updated to <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption>, and the default value of the `Encrypt` property is set to <xref:Microsoft.Data.SqlClient.SqlConnectionEncryptOption.Mandatory%2A>.
  6442. ]]></format>
  6443. </remarks><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6444. </member>
  6445. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.HostNameInCertificate">
  6446. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml" path="docs/members[@name=&quot;SqlConnectionStringBuilder&quot;]/HostNameInCertificate/*" />
  6447. </member>
  6448. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Enlist">
  6449. <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>
  6450. <format type="text/markdown"><![CDATA[
  6451. ## Remarks
  6452. This property corresponds to the "Enlist" key within the connection string.
  6453. ]]></format>
  6454. </remarks>
  6455. </member>
  6456. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartner">
  6457. <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><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception><remarks>
  6458. <format type="text/markdown"><![CDATA[
  6459. ## Remarks
  6460. If the value of this key is "", then **Initial Catalog** must be present, and its value must not be "".
  6461. The server name can be 128 characters or less.
  6462. 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.
  6463. 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.
  6464. ]]></format>
  6465. </remarks>
  6466. </member>
  6467. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartnerSPN">
  6468. <summary>Gets or sets the service principal name (SPN) of the failover partner for the connection.</summary><value>
  6469. The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartnerSPN" /> property, or <see langword="String.Empty" /> if none has been supplied.
  6470. </value><remarks>
  6471. <format type="text/markdown">
  6472. <![CDATA[
  6473. ## Remarks
  6474. This property corresponds to the "FailoverPartnerSPN" and "Failover Partner SPN" keys within the connection string.
  6475. > [!NOTE]
  6476. > This property only applies when using Integrated Security mode, otherwise it is ignored.
  6477. ]]>
  6478. </format>
  6479. </remarks>
  6480. </member>
  6481. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.InitialCatalog">
  6482. <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>
  6483. <format type="text/markdown"><![CDATA[
  6484. ## Remarks
  6485. This property corresponds to the "Initial Catalog" and "database" keys within the connection string.
  6486. The database name can be 128 characters or less.
  6487. ## Examples
  6488. 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.
  6489. [!code-csharp[SqlConnectionStringBuilder_InitialCatalog#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_InitialCatalog.cs#1)]
  6490. ]]></format>
  6491. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6492. </member>
  6493. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IntegratedSecurity">
  6494. <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>
  6495. <format type="text/markdown"><![CDATA[
  6496. ## Remarks
  6497. This property corresponds to the "Integrated Security" and "trusted_connection" keys within the connection string.
  6498. 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.
  6499. <xref:Microsoft.Data.SqlClient.SqlCredential> is a more secure way to specify credentials for a connection that uses SQL Server Authentication (`Integrated Security=false`).
  6500. ## Examples
  6501. 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.
  6502. > [!NOTE]
  6503. > 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.
  6504. [!code-csharp[SqlConnectionStringBuilder_IntegratedSecurity#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_IntegratedSecurity.cs#1)]
  6505. ]]></format>
  6506. </remarks>
  6507. </member>
  6508. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IsFixedSize">
  6509. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> has a fixed size.</summary><value>
  6510. <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="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6511. </member>
  6512. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item(System.String)">
  6513. <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>
  6514. <format type="text/markdown"><![CDATA[
  6515. ## Remarks
  6516. 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>.
  6517. ## Examples
  6518. 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.
  6519. [!code-csharp[SqlConnectionStringBuilder2#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder2.cs#1)]
  6520. ]]></format>
  6521. </remarks><exception cref="T:System.ArgumentNullException">
  6522. <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>
  6523. </member>
  6524. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys">
  6525. <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>
  6526. <format type="text/markdown"><![CDATA[
  6527. ## Remarks
  6528. 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.
  6529. ## Examples
  6530. 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.
  6531. [!code-csharp[SqlConnectionStringBuilder_Keys#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Keys.cs#1)]
  6532. ]]></format>
  6533. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values" /><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item(System.String)" />
  6534. </member>
  6535. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.LoadBalanceTimeout">
  6536. <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>
  6537. <format type="text/markdown"><![CDATA[
  6538. ## Remarks
  6539. This property corresponds to the "Load Balance Timeout" and "connection lifetime" keys within the connection string.
  6540. 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.
  6541. A value of zero (0) causes pooled connections to have the maximum connection timeout.
  6542. ]]></format>
  6543. </remarks>
  6544. </member>
  6545. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MaxPoolSize">
  6546. <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>
  6547. <format type="text/markdown"><![CDATA[
  6548. ## Remarks
  6549. This property corresponds to the "Max Pool Size" key within the connection string.
  6550. ]]></format>
  6551. </remarks>
  6552. </member>
  6553. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MinPoolSize">
  6554. <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>
  6555. <format type="text/markdown"><![CDATA[
  6556. ## Remarks
  6557. This property corresponds to the "Min Pool Size" key within the connection string.
  6558. ]]></format>
  6559. </remarks>
  6560. </member>
  6561. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultipleActiveResultSets">
  6562. <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>
  6563. <format type="text/markdown"><![CDATA[
  6564. ## Remarks
  6565. This property corresponds to the "Multiple Active Result Sets" key within the connection string.
  6566. ## Examples
  6567. The following example explicitly enables the Multiple Active Result Sets feature.
  6568. [!code-csharp[SqlConnectionStringBuilder_MultipleActiveResultSets.MARS#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_MultipleActiveResultSets.cs#1)]
  6569. ]]></format>
  6570. </remarks>
  6571. </member>
  6572. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultiSubnetFailover">
  6573. <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](/sql/connect/ado-net/sql/sqlclient-support-high-availability-disaster-recovery).</summary><value>Returns <see cref="T:System.Boolean" /> indicating the current value of the property.</value><remarks>
  6574. <format type="text/markdown"><![CDATA[
  6575. ## Remarks
  6576. 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.
  6577. ]]></format>
  6578. </remarks>
  6579. </member>
  6580. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.NetworkLibrary">
  6581. <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>
  6582. <format type="text/markdown"><![CDATA[
  6583. ## Remarks
  6584. This property corresponds to the "Network Library", "network", and "net" keys within the connection string.
  6585. 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.
  6586. ]]></format>
  6587. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6588. </member>
  6589. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PacketSize">
  6590. <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>
  6591. <format type="text/markdown"><![CDATA[
  6592. ## Remarks
  6593. This property corresponds to the "Packet Size" key within the connection string.
  6594. The packet size can be greater than or equal to 512 and less than or equal to 32768.
  6595. ]]></format>
  6596. </remarks>
  6597. </member>
  6598. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password">
  6599. <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>
  6600. <format type="text/markdown"><![CDATA[
  6601. ## Remarks
  6602. This property corresponds to the "Password" and "pwd" keys within the connection string.
  6603. Setting this property is 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.
  6604. 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.
  6605. The password must be 128 characters or less.
  6606. ## Examples
  6607. The following example shows how to set <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password%2A>.
  6608. [!code-csharp[SqlConnectionStringBuilder_Password#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Password.cs#1)]
  6609. ]]></format>
  6610. </remarks><exception cref="T:System.ArgumentNullException">The password was incorrectly set to null. See code sample below.</exception>
  6611. </member>
  6612. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PersistSecurityInfo">
  6613. <summary>Gets or sets a Boolean value indicating if security-sensitive information, such as the password or access token, should be returned as part of the connection string on a connection created with this <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> after that connection has ever been in an open state. This property should only be set to <see langword="true" /> if your application has a specific need to read the password out of an already-opened database connection. The default value of <see langword="false" /> is the more secure setting; using <see langword="true" /> for this property opens your application to security risks such as accidentally logging or tracing the database password.</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>
  6614. <format type="text/markdown"><![CDATA[
  6615. ## Remarks
  6616. This property corresponds to the "Persist Security Info" and "persistsecurityinfo" keys within the connection string.
  6617. Resetting the connection string resets all connection string values including the password.
  6618. ]]></format>
  6619. </remarks>
  6620. </member>
  6621. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod">
  6622. <summary>The blocking period behavior for a connection pool.</summary><value>The available blocking period settings.</value><remarks>
  6623. <format type="text/markdown">
  6624. <![CDATA[
  6625. ## Remarks
  6626. This property corresponds to the "Pool Blocking Period" key within the connection string.
  6627. 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.
  6628. 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.
  6629. ]]></format>
  6630. </remarks>
  6631. </member>
  6632. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Pooling">
  6633. <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>
  6634. <format type="text/markdown"><![CDATA[
  6635. ## Remarks
  6636. This property corresponds to the "Pooling" key within the connection string.
  6637. Connections are considered the same if they have the same connection string. Different connections have different connection strings.
  6638. ]]></format>
  6639. </remarks>
  6640. </member>
  6641. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Replication">
  6642. <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>
  6643. <format type="text/markdown"><![CDATA[
  6644. ## Remarks
  6645. This property corresponds to the "Replication" key within the connection string.
  6646. ]]></format>
  6647. </remarks>
  6648. </member>
  6649. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ServerSPN">
  6650. <summary>Gets or sets the service principal name (SPN) of the data source.</summary><value>
  6651. The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ServerSPN" /> property, or <see langword="String.Empty" /> if none has been supplied.
  6652. </value><remarks>
  6653. <format type="text/markdown">
  6654. <![CDATA[
  6655. ## Remarks
  6656. This property corresponds to the "ServerSPN" and "Server SPN" keys within the connection string.
  6657. > [!NOTE]
  6658. > This property only applies when using Integrated Security mode, otherwise it is ignored.
  6659. ]]>
  6660. </format>
  6661. </remarks>
  6662. </member>
  6663. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding">
  6664. <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 `Implicit Unbind` if none has been supplied.</value><remarks>
  6665. <format type="text/markdown"><![CDATA[
  6666. ## Remarks
  6667. 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>.
  6668. The following table shows the possible values for the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding%2A> property:
  6669. |Value|Description|
  6670. |-----------|-----------------|
  6671. |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.|
  6672. |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.|
  6673. ]]></format>
  6674. </remarks>
  6675. </member>
  6676. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransparentNetworkIPResolution">
  6677. <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>
  6678. <format type="text/markdown"><![CDATA[
  6679. ## Remarks
  6680. If the `Multi Subnet Failover` key is set to `true`, `Transparent Network IP Resolution` is ignored.
  6681. If the `Failover Partner` key is set, `Transparent Network IP Resolution` is ignored.
  6682. The value of this key must be `true`, `false`, `yes`, or `no`.
  6683. A value of `yes` is treated the same as a value of `true`.
  6684. A value of `no` is treated the same as a value of `false`.
  6685. This key defaults to `false` when:
  6686. - Connecting to Azure SQL Database where the data source ends with:
  6687. - .database.chinacloudapi.cn
  6688. - .database.usgovcloudapi.net
  6689. - .database.cloudapi.de
  6690. - .database.windows.net
  6691. - `Authentication` is 'Active Directory Password' or 'Active Directory Integrated'
  6692. Otherwise it defaults to `true`.
  6693. ]]></format>
  6694. </remarks>
  6695. </member>
  6696. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TrustServerCertificate">
  6697. <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 boolean. The default is `false`.</value><remarks>
  6698. <format type="text/markdown"><![CDATA[
  6699. ## Remarks
  6700. This property corresponds to the "Trust Server Certificate" and "TrustServerCertificate" keys within the connection string.
  6701. When `Trust Server Certificate` is set to `true`, the transport layer will use TLS to encrypt the channel and bypass walking the certificate chain to validate trust. If `Trust Server Certificate` is set to `true` and encryption is enforced by target server, the encryption level specified on the server will be used even if `Encrypt` is set to `false`. The connection will fail otherwise.
  6702. 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).
  6703. ]]></format>
  6704. </remarks>
  6705. </member>
  6706. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TypeSystemVersion">
  6707. <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:
  6708. <list type="table"><listheader><term> Value
  6709. </term><description> Description
  6710. </description></listheader><item><term> SQL Server 2005
  6711. </term><description> Uses the SQL Server 2005 type system. No conversions are made for the current version of ADO.NET.
  6712. </description></item><item><term> SQL Server 2008
  6713. </term><description> Uses the SQL Server 2008 type system.
  6714. </description></item><item><term> Latest
  6715. </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.
  6716. </description></item></list></value><remarks>
  6717. <format type="text/markdown"><![CDATA[
  6718. ## Remarks
  6719. 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.
  6720. ]]></format>
  6721. </remarks>
  6722. </member>
  6723. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserID">
  6724. <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>
  6725. <format type="text/markdown"><![CDATA[
  6726. ## Remarks
  6727. This property corresponds to the "User ID", "user", and "uid" keys within the connection string.
  6728. Setting this property is 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.
  6729. The user ID must be 128 characters or less.
  6730. ]]></format>
  6731. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6732. </member>
  6733. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserInstance">
  6734. <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>
  6735. <format type="text/markdown"><![CDATA[
  6736. ## Remarks
  6737. This property corresponds to the "User Instance" key within the connection string.
  6738. > [!NOTE]
  6739. > This feature is available only with the SQL Server Express Edition. For more information on user instances, see [SQL Server Express User Instances](/sql/connect/ado-net/sql/sql-server-express-user-instances).
  6740. ]]></format>
  6741. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6742. </member>
  6743. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values">
  6744. <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>
  6745. <format type="text/markdown"><![CDATA[
  6746. ## Remarks
  6747. 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.
  6748. ## Examples
  6749. The following example first creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>, and then iterates through all the values within the object.
  6750. [!code-csharp[SqlConnectionStringBuilder_Values#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Values.cs#1)]
  6751. ]]></format>
  6752. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys" />
  6753. </member>
  6754. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.WorkstationID">
  6755. <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>
  6756. <format type="text/markdown"><![CDATA[
  6757. ## Remarks
  6758. This property corresponds to the "Workstation ID" and "wsid" keys within the connection string.
  6759. The ID must be 128 characters or less.
  6760. ]]></format>
  6761. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  6762. </member>
  6763. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Clear">
  6764. <summary>Clears the contents of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> instance.</summary><remarks>
  6765. <format type="text/markdown"><![CDATA[
  6766. ## Remarks
  6767. 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.
  6768. ## Examples
  6769. 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.
  6770. [!code-csharp[DataWorks SqlConnectionStringBuilder_Clear#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Clear.cs#1)]
  6771. ]]></format>
  6772. </remarks>
  6773. </member>
  6774. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ContainsKey(System.String)">
  6775. <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>
  6776. <format type="text/markdown"><![CDATA[
  6777. ## Remarks
  6778. 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.
  6779. ## Examples
  6780. 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.
  6781. [!code-csharp[SqlConnectionStringBuilder_ContainsKey#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ContainsKey.cs#1)]
  6782. The example displays the following output in the console window:
  6783. ```
  6784. Connection string = Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  6785. True
  6786. True
  6787. True
  6788. False
  6789. ```
  6790. ]]></format>
  6791. </remarks><exception cref="T:System.ArgumentNullException">
  6792. <paramref name="keyword" /> is null (<see langword="Nothing" /> in Visual Basic)</exception>
  6793. </member>
  6794. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Remove(System.String)">
  6795. <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>
  6796. <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>
  6797. <format type="text/markdown"><![CDATA[
  6798. ## Remarks
  6799. 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.
  6800. 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.
  6801. |Key|Default value|
  6802. |---------|-------------------|
  6803. |Application Name|"Framework Microsoft SqlClient Data Provider" when running on .NET Framework. "Core Microsoft SqlClient Data Provider" otherwise.|
  6804. |AttachDBFilename|Empty string|
  6805. |Connection Timeout|15|
  6806. |Context Connection(Obsolete)|False|
  6807. |Current Language|Empty string|
  6808. |Data Source|Empty string|
  6809. |Encrypt|False|
  6810. |Enlist|True|
  6811. |Failover Partner|Empty string|
  6812. |Initial Catalog|Empty string|
  6813. |Integrated Security|False|
  6814. |Load Balance Timeout|0|
  6815. |Max Pool Size|100|
  6816. |Min Pool Size|0|
  6817. |MultipleActiveResultSets|False|
  6818. |Network Library|Empty string|
  6819. |Packet Size|8000|
  6820. |Password|Empty string|
  6821. |Persist Security Info|False|
  6822. |Pooling|True|
  6823. |Replication|False|
  6824. |Transaction Binding|Implicit Unbind|
  6825. |User ID|Empty string|
  6826. |User Instance|False|
  6827. |Workstation ID|Empty string|
  6828. ## Examples
  6829. 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.
  6830. > [!NOTE]
  6831. > 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.
  6832. [!code-csharp[SqlConnectionStringBuilder_Remove#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Remove.cs#1)]
  6833. The example displays the following text in the console window:
  6834. ```
  6835. Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password= a1Pass@@11
  6836. Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  6837. Database = AdventureWorks
  6838. ```
  6839. ]]></format>
  6840. </remarks><exception cref="T:System.ArgumentNullException">
  6841. <paramref name="keyword" /> is null (<see langword="Nothing" /> in Visual Basic)</exception>
  6842. </member>
  6843. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ShouldSerialize(System.String)">
  6844. <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>
  6845. <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>
  6846. <format type="text/markdown"><![CDATA[
  6847. ## Remarks
  6848. This method behaves identically to the <xref:System.Data.Common.DbConnectionStringBuilder.ContainsKey%2A> method.
  6849. ]]></format>
  6850. </remarks>
  6851. </member>
  6852. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TryGetValue(System.String,System.Object@)">
  6853. <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>
  6854. <see langword="true" /> if <paramref name="keyword" /> was found within the connection string; otherwise, <see langword="false" />.</returns><remarks>
  6855. <format type="text/markdown"><![CDATA[
  6856. ## Remarks
  6857. 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.
  6858. ## Examples
  6859. The following example demonstrates the behavior of the **TryGetValue** method.
  6860. [!code-csharp[SqlConnectionStringBuilder_TryGetValue#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs#1)]
  6861. The sample displays the following results:
  6862. ```
  6863. Data Source=(local)
  6864. Trusted_Connection=True
  6865. Unable to retrieve value for 'InvalidKey'
  6866. Unable to retrieve value for null key.
  6867. ```
  6868. ]]></format>
  6869. </remarks><exception cref="T:System.ArgumentNullException">
  6870. <paramref name="keyword" /> contains a null value (<see langword="Nothing" /> in Visual Basic).</exception>
  6871. </member>
  6872. <member name="T:Microsoft.Data.SqlClient.SqlCredential">
  6873. <summary>
  6874. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> provides a more secure way to specify the password for a login attempt using SQL Server Authentication.
  6875. <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" />.
  6876. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> cannot be inherited.
  6877. Windows Authentication (<see langword="Integrated Security = true" />) remains the most secure way to log in to a SQL Server database.</summary><remarks>
  6878. <format type="text/markdown"><![CDATA[
  6879. ## Remarks
  6880. 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)](/sql/connect/ado-net/sql-server-connection-pooling).
  6881. 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:
  6882. - `Integrated Security = true`
  6883. - `Password`
  6884. - `User ID`
  6885. The following sample connects to a SQL Server database using <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A>:
  6886. ```
  6887. // change connection string in the APP.CONFIG file
  6888. <connectionStrings>
  6889. <add name="MyConnString"
  6890. connectionString="Initial Catalog=myDB;Server=myServer"
  6891. providerName="Microsoft.Data.SqlClient" />
  6892. </connectionStrings>
  6893. // then use the following snippet:
  6894. using System.Configuration;
  6895. System.Windows.Controls.TextBox txtUserId = new System.Windows.Controls.TextBox();
  6896. System.Windows.Controls.PasswordBox txtPwd = new System.Windows.Controls.PasswordBox();
  6897. Configuration config = Configuration.WebConfigurationManager.OpenWebConfiguration(Null);
  6898. ConnectionStringSettings connString = config.ConnectionStrings.ConnectionString["MyConnString"];
  6899. using (SqlConnection conn = new SqlConnection(connString.ConnectionString))
  6900. {
  6901. SecureString pwd = txtPwd.SecurePassword;
  6902. pwd.MakeReadOnly();
  6903. SqlCredential cred = new SqlCredential(txtUserId.Text, pwd);
  6904. conn.Credential = cred;
  6905. conn.Open();
  6906. }
  6907. ```
  6908. ]]></format>
  6909. </remarks>
  6910. </member>
  6911. <member name="M:Microsoft.Data.SqlClient.SqlCredential.#ctor(System.String,System.Security.SecureString)">
  6912. <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>
  6913. <format type="text/markdown"><![CDATA[
  6914. ## Remarks
  6915. 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.
  6916. ]]></format>
  6917. </remarks><related type="Article" href="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6918. </member>
  6919. <member name="P:Microsoft.Data.SqlClient.SqlCredential.Password">
  6920. <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="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6921. </member>
  6922. <member name="P:Microsoft.Data.SqlClient.SqlCredential.UserId">
  6923. <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="/sql/connect/ado-net/overview-sqlclient-driver">Overview of the SqlClient driver</related>
  6924. </member>
  6925. <member name="T:Microsoft.Data.SqlClient.SqlDataAdapter">
  6926. <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>
  6927. <format type="text/markdown"><![CDATA[
  6928. ## Remarks
  6929. 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](/sql/connect/ado-net/add-existing-constraints-to-dataset).
  6930. <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.
  6931. > [!NOTE]
  6932. > 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.
  6933. 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.
  6934. 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.
  6935. 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.
  6936. 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.
  6937. > [!NOTE]
  6938. > 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).
  6939. ## Examples
  6940. 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.
  6941. [!code-csharp[SqlDataAdapter_SelectCommand Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SelectCommand.cs#1)]
  6942. ]]></format>
  6943. </remarks>
  6944. </member>
  6945. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor">
  6946. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> class.</summary><remarks>
  6947. <format type="text/markdown"><![CDATA[
  6948. ## Remarks
  6949. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6950. |Properties|Initial value|
  6951. |----------------|-------------------|
  6952. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6953. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6954. You can change the value of any of these properties through a separate call to the property.
  6955. ## Examples
  6956. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6957. [!code-csharp[SqlDataAdapter.SqlDataAdapter Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter.cs#1)]
  6958. ]]></format>
  6959. </remarks>
  6960. </member>
  6961. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(Microsoft.Data.SqlClient.SqlCommand)">
  6962. <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>
  6963. <format type="text/markdown"><![CDATA[
  6964. ## Remarks
  6965. 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.
  6966. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6967. |Properties|Initial value|
  6968. |----------------|-------------------|
  6969. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6970. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6971. You can change the value of any of these properties through a separate call to the property.
  6972. 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.
  6973. ## Examples
  6974. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6975. [!code-csharp[SqlDataAdapter_SqlDataAdapter1 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter1.cs#1)]
  6976. ]]></format>
  6977. </remarks>
  6978. </member>
  6979. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)">
  6980. <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>
  6981. <format type="text/markdown"><![CDATA[
  6982. ## Remarks
  6983. 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.
  6984. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  6985. |Properties|Initial value|
  6986. |----------------|-------------------|
  6987. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  6988. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  6989. You can change the value of either of these properties through a separate call to the property.
  6990. ## Examples
  6991. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  6992. [!code-csharp[SqlDataAdapter_SqlDataAdapter3 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter3.cs#1)]
  6993. ]]></format>
  6994. </remarks>
  6995. </member>
  6996. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,System.String)">
  6997. <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>
  6998. <format type="text/markdown"><![CDATA[
  6999. ## Remarks
  7000. 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.
  7001. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  7002. |Properties|Initial value|
  7003. |----------------|-------------------|
  7004. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  7005. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  7006. You can change the value of any of these properties through a separate call to the property.
  7007. ## Examples
  7008. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  7009. [!code-csharp[SqlDataAdapter_SqlDataAdapter2 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter2.cs#1)]
  7010. ]]></format>
  7011. </remarks>
  7012. </member>
  7013. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand">
  7014. <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>
  7015. <format type="text/markdown"><![CDATA[
  7016. ## Remarks
  7017. 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](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  7018. 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.
  7019. 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.
  7020. ## Examples
  7021. 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.
  7022. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  7023. ]]></format>
  7024. </remarks>
  7025. </member>
  7026. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand">
  7027. <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>
  7028. <format type="text/markdown"><![CDATA[
  7029. ## Remarks
  7030. 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](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  7031. 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.
  7032. 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.
  7033. 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.
  7034. ## Examples
  7035. 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.
  7036. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  7037. ]]></format>
  7038. </remarks>
  7039. </member>
  7040. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand">
  7041. <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>
  7042. <format type="text/markdown"><![CDATA[
  7043. ## Remarks
  7044. 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.
  7045. 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.
  7046. ## Examples
  7047. 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.
  7048. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  7049. ]]></format>
  7050. </remarks>
  7051. </member>
  7052. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize">
  7053. <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.
  7054. <list type="table"><listheader><term> Value is
  7055. </term><description> Effect
  7056. </description></listheader><item><term> 0
  7057. </term><description> There is no limit on the batch size.
  7058. </description></item><item><term> 1
  7059. </term><description> Disables batch updating.
  7060. </description></item><item><term> &gt;1
  7061. </term><description> Changes are sent using batches of <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize" /> operations at a time.
  7062. </description></item></list>
  7063. 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>
  7064. <format type="text/markdown"><![CDATA[
  7065. ## Remarks
  7066. 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.
  7067. 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.
  7068. Executing an extremely large batch could decrease performance. Therefore, you should test for the optimum batch size setting before implementing your application.
  7069. An <xref:System.ArgumentOutOfRangeException> is thrown if the value is set to a number less than zero.
  7070. ]]></format>
  7071. </remarks>
  7072. </member>
  7073. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand">
  7074. <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>
  7075. <format type="text/markdown"><![CDATA[
  7076. ## Remarks
  7077. 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](/sql/connect/ado-net/generate-commands-with-commandbuilders).
  7078. 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.
  7079. > [!NOTE]
  7080. > 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.
  7081. 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`.
  7082. 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.
  7083. ## Examples
  7084. 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.
  7085. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  7086. ]]></format>
  7087. </remarks>
  7088. </member>
  7089. <member name="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated">
  7090. <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>
  7091. <format type="text/markdown"><![CDATA[
  7092. ## Remarks
  7093. 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:
  7094. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  7095. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  7096. 3. The command executes.
  7097. 4. If the command is set to `FirstReturnedRecord`, the first returned result is placed in the <xref:System.Data.DataRow>.
  7098. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  7099. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  7100. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  7101. ## Examples
  7102. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  7103. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  7104. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  7105. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  7106. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  7107. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  7108. ]]></format>
  7109. </remarks>
  7110. </member>
  7111. <member name="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating">
  7112. <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>
  7113. <format type="text/markdown"><![CDATA[
  7114. ## Remarks
  7115. 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:
  7116. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  7117. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  7118. 3. The command executes.
  7119. 4. If the command is set to `FirstReturnedRecord`, the first returned result is placed in the <xref:System.Data.DataRow>.
  7120. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  7121. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  7122. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  7123. ## Examples
  7124. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  7125. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  7126. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  7127. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  7128. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  7129. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  7130. ]]></format>
  7131. </remarks>
  7132. </member>
  7133. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.AddToBatch(System.Data.IDbCommand)">
  7134. <param name="command">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  7135. </member>
  7136. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.ClearBatch">
  7137. <summary>To be added.</summary><remarks>To be added.</remarks>
  7138. </member>
  7139. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.CreateRowUpdatedEvent(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  7140. <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>
  7141. </member>
  7142. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.CreateRowUpdatingEvent(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  7143. <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>
  7144. </member>
  7145. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.ExecuteBatch">
  7146. <summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  7147. </member>
  7148. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.GetBatchedParameter(System.Int32,System.Int32)">
  7149. <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>
  7150. </member>
  7151. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.GetBatchedRecordsAffected(System.Int32,System.Int32@,System.Exception@)">
  7152. <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>
  7153. </member>
  7154. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.InitializeBatching">
  7155. <summary>To be added.</summary><remarks>To be added.</remarks>
  7156. </member>
  7157. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.OnRowUpdated(System.Data.Common.RowUpdatedEventArgs)">
  7158. <param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  7159. </member>
  7160. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.OnRowUpdating(System.Data.Common.RowUpdatingEventArgs)">
  7161. <param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  7162. </member>
  7163. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.TerminateBatching">
  7164. <summary>To be added.</summary><remarks>To be added.</remarks>
  7165. </member>
  7166. <member name="T:Microsoft.Data.SqlClient.SqlDataReader">
  7167. <summary>Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.</summary><remarks>
  7168. <format type="text/markdown"><![CDATA[
  7169. ## Remarks
  7170. 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.
  7171. 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>.
  7172. 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.
  7173. <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.
  7174. 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.
  7175. > [!NOTE]
  7176. > 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>.
  7177. ## Examples
  7178. 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.
  7179. [!code-csharp[SqlDataReader_Read Example#1](~/../sqlclient/doc/samples/SqlDataReader_Read.cs#1)]
  7180. ]]></format>
  7181. </remarks>
  7182. </member>
  7183. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Connection">
  7184. <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>
  7185. </member>
  7186. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Depth">
  7187. <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>
  7188. <format type="text/markdown"><![CDATA[
  7189. ## Remarks
  7190. The outermost table has a depth of zero. The .NET Framework Data Provider for SQL Server does not support nesting and always returns zero.
  7191. ]]></format>
  7192. </remarks>
  7193. </member>
  7194. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.FieldCount">
  7195. <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>
  7196. <format type="text/markdown"><![CDATA[
  7197. ## Remarks
  7198. 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.
  7199. ]]></format>
  7200. </remarks><exception cref="T:System.NotSupportedException">There is no current connection to an instance of SQL Server.</exception>
  7201. </member>
  7202. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.HasRows">
  7203. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> contains one or more rows.</summary><value>
  7204. <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>
  7205. </member>
  7206. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.IsClosed">
  7207. <summary>Retrieves a Boolean value that indicates whether the specified <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> instance has been closed.</summary><value>
  7208. <see langword="true" /> if the specified <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> instance is closed; otherwise <see langword="false" />.</value><remarks>
  7209. <format type="text/markdown"><![CDATA[
  7210. ## Remarks
  7211. It is not possible to read from a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance that is closed.
  7212. ]]></format>
  7213. </remarks>
  7214. </member>
  7215. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Item(System.Int32)">
  7216. <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>
  7217. </member>
  7218. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Item(System.String)">
  7219. <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>
  7220. <format type="text/markdown"><![CDATA[
  7221. ## Remarks
  7222. 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".
  7223. This method is kana-width insensitive.
  7224. ]]></format>
  7225. </remarks><exception cref="T:System.IndexOutOfRangeException">No column with the specified name was found.</exception>
  7226. </member>
  7227. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected">
  7228. <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>
  7229. <format type="text/markdown"><![CDATA[
  7230. ## Remarks
  7231. The value of this property is cumulative. For example, if two records are inserted in batch mode, the value of `RecordsAffected` will be two.
  7232. <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.
  7233. ]]></format>
  7234. </remarks>
  7235. </member>
  7236. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.SensitivityClassification">
  7237. <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>
  7238. </member>
  7239. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.VisibleFieldCount">
  7240. <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>
  7241. <format type="text/markdown"><![CDATA[
  7242. ## Remarks
  7243. 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.
  7244. ]]></format>
  7245. </remarks>
  7246. </member>
  7247. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.Close">
  7248. <summary>Closes the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> object.</summary><remarks>
  7249. <format type="text/markdown"><![CDATA[
  7250. ## Remarks
  7251. 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 `Dispose` method, disposing directly or in the context of [the using statement](/dotnet/csharp/language-reference/language-specification/statements#the-using-statement) block.
  7252. 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.
  7253. > [!CAUTION]
  7254. > 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](/dotnet/standard/garbage-collection/).
  7255. ## Examples
  7256. 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.
  7257. [!code-csharp[SqlDataReader_Close Example#1](~/../sqlclient/doc/samples/SqlDataReader_Close.cs#1)]
  7258. ]]></format>
  7259. </remarks>
  7260. </member>
  7261. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetBoolean(System.Int32)">
  7262. <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>
  7263. <format type="text/markdown"><![CDATA[
  7264. ## Remarks
  7265. No conversions are performed; therefore, the data retrieved must already be a Boolean, or an exception is generated.
  7266. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7267. ]]></format>
  7268. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7269. </member>
  7270. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetByte(System.Int32)">
  7271. <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>
  7272. <format type="text/markdown"><![CDATA[
  7273. ## Remarks
  7274. No conversions are performed; therefore, the data retrieved must already be a byte.
  7275. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7276. ]]></format>
  7277. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7278. </member>
  7279. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  7280. <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>
  7281. <format type="text/markdown"><![CDATA[
  7282. ## Remarks
  7283. <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>.
  7284. 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.
  7285. No conversions are performed; therefore, the data retrieved must already be a byte array.
  7286. ]]></format>
  7287. </remarks>
  7288. </member>
  7289. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetChar(System.Int32)">
  7290. <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>
  7291. <format type="text/markdown"><![CDATA[
  7292. ## Remarks
  7293. Not supported for <xref:Microsoft.Data.SqlClient>.
  7294. ]]></format>
  7295. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7296. </member>
  7297. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  7298. <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>
  7299. <format type="text/markdown"><![CDATA[
  7300. ## Remarks
  7301. <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>.
  7302. 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.
  7303. No conversions are performed; therefore. the data retrieved must already be a character array.
  7304. > [!NOTE]
  7305. > The <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> method returns 0 when `dataIndex` is negative.
  7306. ]]></format>
  7307. </remarks>
  7308. </member>
  7309. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDataTypeName(System.Int32)">
  7310. <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>
  7311. <format type="text/markdown"><![CDATA[
  7312. ## Remarks
  7313. Returns the name of the back-end data type.
  7314. `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.
  7315. ]]></format>
  7316. </remarks>
  7317. </member>
  7318. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDateTime(System.Int32)">
  7319. <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>
  7320. <format type="text/markdown"><![CDATA[
  7321. ## Remarks
  7322. No conversions are performed; therefore, the data retrieved must already be a <xref:System.DateTime> object.
  7323. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7324. ]]></format>
  7325. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7326. </member>
  7327. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDateTimeOffset(System.Int32)">
  7328. <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>
  7329. <format type="text/markdown"><![CDATA[
  7330. ## Remarks
  7331. No conversions are performed; therefore, the data retrieved must already be a <xref:System.DateTimeOffset> object.
  7332. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7333. ]]></format>
  7334. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7335. </member>
  7336. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDecimal(System.Int32)">
  7337. <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>
  7338. <format type="text/markdown"><![CDATA[
  7339. ## Remarks
  7340. No conversions are performed; therefore, the data retrieved must already be a <xref:System.Decimal> object.
  7341. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7342. ]]></format>
  7343. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7344. </member>
  7345. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDouble(System.Int32)">
  7346. <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>
  7347. <format type="text/markdown"><![CDATA[
  7348. ## Remarks
  7349. No conversions are performed. Therefore, the data retrieved must already be a double-precision floating point number.
  7350. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7351. ]]></format>
  7352. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7353. </member>
  7354. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetEnumerator">
  7355. <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>
  7356. <format type="text/markdown"><![CDATA[
  7357. ## Remarks
  7358. 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.
  7359. ]]></format>
  7360. </remarks>
  7361. </member>
  7362. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldType(System.Int32)">
  7363. <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>
  7364. </member>
  7365. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValue``1(System.Int32)">
  7366. <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>
  7367. <format type="text/markdown">
  7368. <![CDATA[
  7369. ## Remarks
  7370. `T` can be one of the following types:
  7371. |||||
  7372. |-|-|-|-|
  7373. |Boolean|Byte|Char|DateTime|
  7374. |DateTimeOffset|Decimal|Double|Float|
  7375. |Guid|Int16|Int32|Int64|
  7376. |SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
  7377. |SqlDouble|SqlGuid|SqlInt16|SqlInt32|
  7378. |SqlInt64|SqlMoney|SqlSingle|SqlString|
  7379. |Stream|String|TextReader|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|
  7380. |XmlReader||||
  7381. For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  7382. ]]></format>
  7383. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  7384. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  7385. 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).
  7386. Tried to read a previously-read column in sequential mode.
  7387. 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">
  7388. <typeparamref name="T" /> doesn't match the type returned by SQL Server or cannot be cast.</exception>
  7389. </member>
  7390. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValueAsync``1(System.Int32,System.Threading.CancellationToken)">
  7391. <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>
  7392. <format type="text/markdown">
  7393. <![CDATA[
  7394. ## Remarks
  7395. `T` can be one of the following types:
  7396. |||||
  7397. |-|-|-|-|
  7398. |Boolean|Byte|Char|DateTime|
  7399. |DateTimeOffset|Decimal|Double|Float|
  7400. |Guid|Int16|Int32|Int64|
  7401. |SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
  7402. |SqlDouble|SqlGuid|SqlInt16|SqlInt32|
  7403. |SqlInt64|SqlMoney|SqlSingle|SqlString|
  7404. |Stream|String|TextReader|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|
  7405. |XmlReader||||
  7406. For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  7407. ]]></format>
  7408. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  7409. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  7410. 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).
  7411. Tried to read a previously-read column in sequential mode.
  7412. 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">
  7413. <typeparamref name="T" /> doesn't match the type returned by SQL Server or cannot be cast.</exception>
  7414. </member>
  7415. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFloat(System.Int32)">
  7416. <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>
  7417. <format type="text/markdown"><![CDATA[
  7418. ## Remarks
  7419. No conversions are performed. Therefore, the data retrieved must already be a single-precision floating point number.
  7420. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7421. ]]></format>
  7422. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7423. </member>
  7424. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetGuid(System.Int32)">
  7425. <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>
  7426. <format type="text/markdown"><![CDATA[
  7427. ## Remarks
  7428. No conversions are performed; therefore, the data retrieved must already be a GUID.
  7429. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7430. ]]></format>
  7431. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7432. </member>
  7433. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt16(System.Int32)">
  7434. <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>
  7435. <format type="text/markdown"><![CDATA[
  7436. ## Remarks
  7437. No conversions are performed; therefore, the data retrieved must already be a 16-bit signed integer.
  7438. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7439. ]]></format>
  7440. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7441. </member>
  7442. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt32(System.Int32)">
  7443. <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>
  7444. <format type="text/markdown"><![CDATA[
  7445. ## Remarks
  7446. No conversions are performed; therefore, the data retrieved must already be a 32-bit signed integer.
  7447. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7448. ]]></format>
  7449. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7450. </member>
  7451. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt64(System.Int32)">
  7452. <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>
  7453. <format type="text/markdown"><![CDATA[
  7454. ## Remarks
  7455. No conversions are performed; therefore, the data retrieved must already be a 64-bit signed integer.
  7456. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7457. ]]></format>
  7458. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7459. </member>
  7460. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetName(System.Int32)">
  7461. <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>
  7462. </member>
  7463. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetOrdinal(System.String)">
  7464. <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>
  7465. <format type="text/markdown"><![CDATA[
  7466. ## Remarks
  7467. `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.
  7468. `GetOrdinal` is kana-width insensitive.
  7469. 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.
  7470. ## Examples
  7471. The following example demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlDataReader.GetOrdinal%2A> method.
  7472. [!code-csharp[SqlDataReader_GetOrdinal#1](~/../sqlclient/doc/samples/SqlDataReader_GetOrdinal.cs#1)]
  7473. ]]></format>
  7474. </remarks><exception cref="T:System.IndexOutOfRangeException">The name specified is not a valid column name.</exception>
  7475. </member>
  7476. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificFieldType(System.Int32)">
  7477. <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>
  7478. </member>
  7479. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificValue(System.Int32)">
  7480. <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>
  7481. </member>
  7482. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificValues(System.Object[])">
  7483. <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>
  7484. </member>
  7485. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBinary(System.Int32)">
  7486. <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>
  7487. <format type="text/markdown"><![CDATA[
  7488. ## Remarks
  7489. No conversions are performed; therefore the data retrieved must already be a binary structure or an exception is generated.
  7490. ]]></format>
  7491. </remarks>
  7492. </member>
  7493. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBoolean(System.Int32)">
  7494. <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>
  7495. <format type="text/markdown"><![CDATA[
  7496. ## Remarks
  7497. No conversions are performed; therefore, the data retrieved must already be a Boolean or an exception is generated.
  7498. ]]></format>
  7499. </remarks>
  7500. </member>
  7501. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlByte(System.Int32)">
  7502. <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>
  7503. <format type="text/markdown"><![CDATA[
  7504. ## Remarks
  7505. No conversions are performed; therefore the data retrieved must already be a byte, or an exception is generated.
  7506. ]]></format>
  7507. </remarks>
  7508. </member>
  7509. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBytes(System.Int32)">
  7510. <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>
  7511. </member>
  7512. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlChars(System.Int32)">
  7513. <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>
  7514. </member>
  7515. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDateTime(System.Int32)">
  7516. <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>
  7517. <format type="text/markdown"><![CDATA[
  7518. ## Remarks
  7519. No conversions are performed; therefore, the data retrieved must already be a date/time value, or an exception is generated.
  7520. ]]></format>
  7521. </remarks>
  7522. </member>
  7523. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDecimal(System.Int32)">
  7524. <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>
  7525. <format type="text/markdown"><![CDATA[
  7526. ## Remarks
  7527. No conversions are performed; therefore, the data retrieved must already be a decimal value, or an exception is generated.
  7528. ]]></format>
  7529. </remarks>
  7530. </member>
  7531. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDouble(System.Int32)">
  7532. <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>
  7533. <format type="text/markdown"><![CDATA[
  7534. ## Remarks
  7535. No conversions are performed; therefore, the data retrieved must already be a double-precision floating-point number, or an exception is generated.
  7536. ]]></format>
  7537. </remarks>
  7538. </member>
  7539. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlGuid(System.Int32)">
  7540. <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>
  7541. <format type="text/markdown"><![CDATA[
  7542. ## Remarks
  7543. No conversions are performed; therefore, the data retrieved must already be a GUID, or an exception is generated.
  7544. ]]></format>
  7545. </remarks>
  7546. </member>
  7547. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt16(System.Int32)">
  7548. <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>
  7549. <format type="text/markdown"><![CDATA[
  7550. ## Remarks
  7551. No conversions are performed; therefore, the data retrieved must already be a 16-bit signed integer, or an exception is generated.
  7552. ]]></format>
  7553. </remarks>
  7554. </member>
  7555. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt32(System.Int32)">
  7556. <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>
  7557. <format type="text/markdown"><![CDATA[
  7558. ## Remarks
  7559. No conversions are performed; therefore the data retrieved must already be a 32-bit signed integer, or an exception is generated.
  7560. ]]></format>
  7561. </remarks>
  7562. </member>
  7563. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt64(System.Int32)">
  7564. <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>
  7565. <format type="text/markdown"><![CDATA[
  7566. ## Remarks
  7567. No conversions are performed; therefore, the data retrieved must already be a 64-bit signed integer, or an exception is generated.
  7568. ]]></format>
  7569. </remarks>
  7570. </member>
  7571. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlMoney(System.Int32)">
  7572. <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>
  7573. <format type="text/markdown"><![CDATA[
  7574. ## Remarks
  7575. No conversions are performed; therefore, the data retrieved must already be a decimal value, or an exception is generated.
  7576. ]]></format>
  7577. </remarks>
  7578. </member>
  7579. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlSingle(System.Int32)">
  7580. <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>
  7581. <format type="text/markdown"><![CDATA[
  7582. ## Remarks
  7583. No conversions are performed; therefore, the data retrieved must already be a single precision floating point number, or an exception is generated.
  7584. ]]></format>
  7585. </remarks>
  7586. </member>
  7587. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlString(System.Int32)">
  7588. <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>
  7589. <format type="text/markdown"><![CDATA[
  7590. ## Remarks
  7591. No conversions are performed; therefore, the data retrieved must already be a string, or an exception is generated.
  7592. ]]></format>
  7593. </remarks>
  7594. </member>
  7595. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValue(System.Int32)">
  7596. <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>
  7597. <format type="text/markdown"><![CDATA[
  7598. ## Remarks
  7599. <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>.
  7600. ]]></format>
  7601. </remarks>
  7602. </member>
  7603. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValues(System.Object[])">
  7604. <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>
  7605. <format type="text/markdown"><![CDATA[
  7606. ## Remarks
  7607. 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.
  7608. ]]></format>
  7609. </remarks><exception cref="T:System.ArgumentNullException">
  7610. <paramref name="values" /> is null.</exception>
  7611. </member>
  7612. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlXml(System.Int32)">
  7613. <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>
  7614. <format type="text/markdown"><![CDATA[
  7615. ## Remarks
  7616. No conversions are performed; therefore, the data retrieved must already be an XML value.
  7617. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7618. ]]></format>
  7619. </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>
  7620. </member>
  7621. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSchemaTable">
  7622. <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>
  7623. <format type="text/markdown"><![CDATA[
  7624. ## Remarks
  7625. The <xref:Microsoft.Data.SqlClient.SqlDataReader.GetSchemaTable%2A> method returns the following metadata about each column:
  7626. |DataReader column|Description|
  7627. |-----------------------|-----------------|
  7628. |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.|
  7629. |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.|
  7630. |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.|
  7631. |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.|
  7632. |BaseServerName|The name of the instance of Microsoft SQL Server used by the <xref:Microsoft.Data.SqlClient.SqlDataReader>.|
  7633. |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.|
  7634. |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.|
  7635. |ColumnOrdinal|The zero-based ordinal of the column. This column cannot contain a null value.|
  7636. |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).|
  7637. |DataTypeName|Returns a string representing the data type of the specified column.|
  7638. |IsAliased|`true`: The column name is an alias.<br /><br /> `false`: The column name is not an alias.|
  7639. |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`.|
  7640. |IsColumnSet|`true`: The column is a sparse column that is a member of a column set.|
  7641. |IsExpression|`true`: The column is an expression.<br /><br /> `false`: The column is not an expression.|
  7642. |IsHidden|`true`: The column is hidden.<br /><br /> `false`: The column is not hidden.|
  7643. |IsIdentity|`true`: The column is an identity column.<br /><br /> `false`: The column is not an identity column.|
  7644. |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.|
  7645. |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.|
  7646. |IsReadOnly|`true`: The column cannot be modified.<br /><br /> `false`: The column can be modified.|
  7647. |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.|
  7648. |IsUnique|`true`: Column is of type `timestamp`.<br /><br /> `false`: Column is not of type `timestamp`.|
  7649. |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.|
  7650. |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.|
  7651. |NumericScale|If `ProviderType` is DBTYPE_DECIMAL or DBTYPE_NUMERIC, the number of digits to the right of the decimal point. Otherwise, this is 255.|
  7652. |ProviderSpecificDataType|Returns the provider-specific data type of the column based on the `Type System Version` keyword in the connection string.|
  7653. |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.|
  7654. |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.|
  7655. |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.|
  7656. |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.|
  7657. |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.|
  7658. > [!NOTE]
  7659. > 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.
  7660. ]]></format>
  7661. </remarks><exception cref="T:System.InvalidOperationException">The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed.</exception>
  7662. </member>
  7663. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetStream(System.Int32)">
  7664. <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>
  7665. <format type="text/markdown"><![CDATA[
  7666. ## Remarks
  7667. <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>.
  7668. Null values will be returned as an empty (zero bytes) <xref:System.IO.Stream>.
  7669. <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.
  7670. <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>.
  7671. The following <xref:System.IO.Stream> members are not available for objects returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A>:
  7672. - BeginWrite
  7673. - EndWrite
  7674. - Length
  7675. - Position
  7676. - Seek
  7677. - SetLength
  7678. - Write
  7679. - WriteByte
  7680. - WriteTimeout
  7681. For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  7682. ]]></format>
  7683. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  7684. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  7685. 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).
  7686. Tried to read a previously-read column in sequential mode.
  7687. 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:
  7688. - binary
  7689. - image
  7690. - varbinary
  7691. - udt</exception>
  7692. </member>
  7693. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetString(System.Int32)">
  7694. <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>
  7695. <format type="text/markdown"><![CDATA[
  7696. ## Remarks
  7697. No conversions are performed; therefore, the data retrieved must already be a string.
  7698. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7699. ]]></format>
  7700. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7701. </member>
  7702. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader(System.Int32)">
  7703. <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>
  7704. <format type="text/markdown"><![CDATA[
  7705. ## Remarks
  7706. <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>.
  7707. Null values will be returned as an empty (zero bytes) <xref:System.IO.TextReader>.
  7708. <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.
  7709. For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  7710. ]]></format>
  7711. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  7712. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  7713. 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).
  7714. Tried to read a previously-read column in sequential mode.
  7715. 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:
  7716. - char
  7717. - nchar
  7718. - ntext
  7719. - nvarchar
  7720. - text
  7721. - varchar</exception>
  7722. </member>
  7723. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetTimeSpan(System.Int32)">
  7724. <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>
  7725. <format type="text/markdown"><![CDATA[
  7726. ## Remarks
  7727. No conversions are performed; therefore, the data retrieved must already be a <xref:System.TimeSpan> object.
  7728. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  7729. ]]></format>
  7730. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  7731. </member>
  7732. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetValue(System.Int32)">
  7733. <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>
  7734. <format type="text/markdown"><![CDATA[
  7735. ## Remarks
  7736. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetValue%2A> returns data using the .NET Framework types.
  7737. ]]></format>
  7738. </remarks>
  7739. </member>
  7740. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetValues(System.Object[])">
  7741. <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>
  7742. <format type="text/markdown"><![CDATA[
  7743. ## Remarks
  7744. For most applications, this method provides an efficient means for retrieving all columns, instead of retrieving each column individually.
  7745. 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.
  7746. This method returns <xref:System.DBNull> for null database columns.
  7747. ## Examples
  7748. 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.
  7749. [!code-csharp[DataTableReader_GetValues#2](~/../sqlclient/doc/samples/DataTableReader_GetValues.cs#2)]
  7750. ]]></format>
  7751. </remarks>
  7752. </member>
  7753. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetXmlReader(System.Int32)">
  7754. <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>
  7755. <format type="text/markdown"><![CDATA[
  7756. ## Remarks
  7757. 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>.
  7758. <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>.
  7759. <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.
  7760. For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  7761. ]]></format>
  7762. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  7763. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  7764. 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).
  7765. Trying to read a previously read column in sequential mode.
  7766. 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>
  7767. </member>
  7768. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsCommandBehavior(System.Data.CommandBehavior)">
  7769. <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>
  7770. <see langword="true" /> if the specified <see cref="T:System.Data.CommandBehavior" /> is true, <see langword="false" /> otherwise.</returns><remarks>
  7771. <format type="text/markdown"><![CDATA[
  7772. ## Remarks
  7773. This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  7774. ]]></format>
  7775. </remarks>
  7776. </member>
  7777. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)">
  7778. <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>
  7779. <see langword="true" /> if the specified column value is equivalent to <see cref="T:System.DBNull" />; otherwise <see langword="false" />.</returns><remarks>
  7780. <format type="text/markdown"><![CDATA[
  7781. ## Remarks
  7782. 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.
  7783. [!code-csharp[SqlDataReader_IsDBNull#1](~/../sqlclient/doc/samples/SqlDataReader_IsDBNull.cs#1)]
  7784. ]]></format>
  7785. </remarks>
  7786. </member>
  7787. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNullAsync(System.Int32,System.Threading.CancellationToken)">
  7788. <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.
  7789. 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>
  7790. <see langword="true" /> if the specified column value is equivalent to <see langword="DBNull" /> otherwise <see langword="false" />.</returns><remarks>
  7791. <format type="text/markdown"><![CDATA[
  7792. ## Remarks
  7793. For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  7794. ]]></format>
  7795. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  7796. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  7797. 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).
  7798. Trying to read a previously read column in sequential mode.
  7799. 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>
  7800. </member>
  7801. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.NextResult">
  7802. <summary>Advances the data reader to the next result, when reading the results of batch Transact-SQL statements.</summary><returns>
  7803. <see langword="true" /> if there are more result sets; otherwise <see langword="false" />.</returns><remarks>
  7804. <format type="text/markdown"><![CDATA[
  7805. ## Remarks
  7806. Used to process multiple results, which can be generated by executing batch Transact-SQL statements.
  7807. By default, the data reader is positioned on the first result.
  7808. ]]></format>
  7809. </remarks>
  7810. </member>
  7811. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.NextResultAsync(System.Threading.CancellationToken)">
  7812. <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.
  7813. 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>
  7814. <format type="text/markdown"><![CDATA[
  7815. ## Remarks
  7816. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  7817. ]]></format>
  7818. </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.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  7819. </member>
  7820. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.Read">
  7821. <summary>Advances the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> to the next record.</summary><returns>
  7822. <see langword="true" /> if there are more rows; otherwise <see langword="false" />.</returns><remarks>
  7823. <format type="text/markdown"><![CDATA[
  7824. ## Remarks
  7825. 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.
  7826. 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>.
  7827. ## Examples
  7828. 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.
  7829. [!code-csharp[SqlDataReader_Read Example#1](~/../sqlclient/doc/samples/SqlDataReader_Read.cs#1)]
  7830. ]]></format>
  7831. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  7832. </member>
  7833. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)">
  7834. <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.
  7835. 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>
  7836. <format type="text/markdown"><![CDATA[
  7837. ## Remarks
  7838. 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.
  7839. For more information, including code samples, about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/sql/connect/ado-net/asynchronous-programming).
  7840. ]]></format>
  7841. </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.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  7842. </member>
  7843. <member name="T:Microsoft.Data.SqlClient.SQLDebugging">
  7844. <summary>
  7845. Included to support debugging applications. Not intended for direct use.
  7846. </summary><remarks>To be added.</remarks>
  7847. </member>
  7848. <member name="M:Microsoft.Data.SqlClient.SQLDebugging.#ctor">
  7849. <summary>
  7850. Initiates instance of <see cref="T:Microsoft.Data.SqlClient.SQLDebugging" /> class object. Not intended for direct use.
  7851. </summary><remarks>To be added.</remarks>
  7852. </member>
  7853. <member name="T:Microsoft.Data.SqlClient.SqlDependency">
  7854. <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>
  7855. <format type="text/markdown"><![CDATA[
  7856. ## Remarks
  7857. <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.
  7858. 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).
  7859. > [!NOTE]
  7860. > <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.
  7861. For more information, see [Query Notifications in SQL Server](/sql/connect/ado-net/sql/query-notifications-sql-server) and [Building Notification Solutions](https://docs.microsoft.com/previous-versions/sql/sql-server-2005/ms171065(v%3dsql.90)).
  7862. > [!NOTE]
  7863. > The <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event may be generated on a different thread from the thread that initiated command execution.
  7864. Query notifications are supported only for SELECT statements that meet a list of specific requirements.
  7865. ]]></format>
  7866. </remarks>
  7867. </member>
  7868. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor">
  7869. <summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class with the default settings.</summary><remarks>
  7870. <format type="text/markdown"><![CDATA[
  7871. ## Remarks
  7872. 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.
  7873. 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).
  7874. ]]></format>
  7875. </remarks>
  7876. </member>
  7877. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor(Microsoft.Data.SqlClient.SqlCommand)">
  7878. <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>
  7879. <format type="text/markdown"><![CDATA[
  7880. ## Remarks
  7881. 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.
  7882. 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).
  7883. ]]></format>
  7884. </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>
  7885. </member>
  7886. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor(Microsoft.Data.SqlClient.SqlCommand,System.String,System.Int32)">
  7887. <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>
  7888. <format type="text/markdown"><![CDATA[
  7889. ## Remarks
  7890. 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).
  7891. ]]></format>
  7892. </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.
  7893. An attempt was made to create a **SqlDependency** instance from within SQLCLR.</exception>
  7894. </member>
  7895. <member name="P:Microsoft.Data.SqlClient.SqlDependency.HasChanges">
  7896. <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>
  7897. <format type="text/markdown"><![CDATA[
  7898. ## Remarks
  7899. 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.
  7900. 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.
  7901. ]]></format>
  7902. </remarks>
  7903. </member>
  7904. <member name="P:Microsoft.Data.SqlClient.SqlDependency.Id">
  7905. <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>
  7906. <format type="text/markdown"><![CDATA[
  7907. ## Remarks
  7908. The <xref:Microsoft.Data.SqlClient.SqlDependency.Id%2A> property is used to uniquely identify a given <xref:Microsoft.Data.SqlClient.SqlDependency> instance.
  7909. ]]></format>
  7910. </remarks>
  7911. </member>
  7912. <member name="E:Microsoft.Data.SqlClient.SqlDependency.OnChange">
  7913. <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>
  7914. <format type="text/markdown"><![CDATA[
  7915. ## Remarks
  7916. <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.
  7917. 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>.
  7918. ]]></format>
  7919. </remarks>
  7920. </member>
  7921. <member name="M:Microsoft.Data.SqlClient.SqlDependency.AddCommandDependency(Microsoft.Data.SqlClient.SqlCommand)">
  7922. <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>
  7923. <format type="text/markdown"><![CDATA[
  7924. ## Remarks
  7925. 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).
  7926. ]]></format>
  7927. </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>
  7928. </member>
  7929. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String)">
  7930. <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>
  7931. <see langword="true" /> if the listener initialized successfully; <see langword="false" /> if a compatible listener already exists.</returns><remarks>
  7932. <format type="text/markdown"><![CDATA[
  7933. ## Remarks
  7934. 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.
  7935. For additional remarks, see <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A>.
  7936. ]]></format>
  7937. </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.
  7938. 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.
  7939. Also, any underlying **SqlClient** exceptions.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />
  7940. </member>
  7941. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)">
  7942. <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>
  7943. <see langword="true" /> if the listener initialized successfully; <see langword="false" /> if a compatible listener already exists.</returns><remarks>
  7944. <format type="text/markdown"><![CDATA[
  7945. ## Remarks
  7946. 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.
  7947. 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.
  7948. For additional remarks, see <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A>.
  7949. ]]></format>
  7950. </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.
  7951. 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.
  7952. Also, any underlying **SqlClient** exceptions.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />
  7953. </member>
  7954. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Stop(System.String)">
  7955. <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="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String)" /> call.</summary><returns>
  7956. <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>
  7957. <format type="text/markdown"><![CDATA[
  7958. ## Remarks
  7959. 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.
  7960. ]]></format>
  7961. </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>
  7962. </member>
  7963. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Stop(System.String,System.String)">
  7964. <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="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</summary><returns>
  7965. <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>
  7966. <format type="text/markdown"><![CDATA[
  7967. ## Remarks
  7968. 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.
  7969. ]]></format>
  7970. </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>
  7971. </member>
  7972. <member name="T:Microsoft.Data.SqlClient.SqlError">
  7973. <summary>Collects information relevant to a warning or error returned by SQL Server.</summary><remarks>
  7974. <format type="text/markdown"><![CDATA[
  7975. ## Remarks
  7976. 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.
  7977. 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.
  7978. 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.
  7979. 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).
  7980. ## Examples
  7981. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7982. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  7983. ]]></format>
  7984. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlException" />
  7985. </member>
  7986. <member name="P:Microsoft.Data.SqlClient.SqlError.Class">
  7987. <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>
  7988. <format type="text/markdown"><![CDATA[
  7989. ## Remarks
  7990. 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.
  7991. 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.
  7992. 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).
  7993. ## Examples
  7994. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  7995. [!code-csharp[SqlError_State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  7996. ]]></format>
  7997. </remarks>
  7998. </member>
  7999. <member name="P:Microsoft.Data.SqlClient.SqlError.LineNumber">
  8000. <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>
  8001. <format type="text/markdown"><![CDATA[
  8002. ## Remarks
  8003. Line numbering starts at 1. If the value is 0, the line number is not applicable.
  8004. 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).
  8005. ## Examples
  8006. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8007. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8008. ]]></format>
  8009. </remarks>
  8010. </member>
  8011. <member name="P:Microsoft.Data.SqlClient.SqlError.Message">
  8012. <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>
  8013. <format type="text/markdown"><![CDATA[
  8014. ## Examples
  8015. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8016. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8017. ]]></format>
  8018. </remarks>
  8019. </member>
  8020. <member name="P:Microsoft.Data.SqlClient.SqlError.Number">
  8021. <summary>Gets a number that identifies the type of error.</summary><value>The number that identifies the type of error.</value><remarks>
  8022. <format type="text/markdown"><![CDATA[
  8023. ## Remarks
  8024. The following table describes the possible values for this property:
  8025. |Source of Error|SqlError.Number|SqlError.State|SqlException has inner Win32Exception (beginning with.NET Framework 4.5)|
  8026. |---------------------|---------------------|--------------------|--------------------------------------------------------------------------------|
  8027. |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|
  8028. |Connection timeout|-2|0|Yes (Number = 258)|
  8029. |Communication error (non-LocalDB)|Win32 error code|0|Yes (Number = Win32 error code)|
  8030. |Communication error (LocalDB)|Win32 error code|0|No|
  8031. |Encryption capability mismatch|20|0|No|
  8032. |Failed to start LocalDB|Win32 error code|0|No|
  8033. |Read-only routing failure|0|0|No|
  8034. |Server had severe error processing query|0|0|No|
  8035. |Processed cancellation while parsing results|0|0|No|
  8036. |Failed to create user instance|0|0|No|
  8037. 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).
  8038. ## Examples
  8039. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8040. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8041. ]]></format>
  8042. </remarks>
  8043. </member>
  8044. <member name="P:Microsoft.Data.SqlClient.SqlError.Procedure">
  8045. <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>
  8046. <format type="text/markdown"><![CDATA[
  8047. ## Examples
  8048. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8049. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8050. ]]></format>
  8051. </remarks>
  8052. </member>
  8053. <member name="P:Microsoft.Data.SqlClient.SqlError.Server">
  8054. <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>
  8055. <format type="text/markdown"><![CDATA[
  8056. ## Examples
  8057. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8058. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8059. ]]></format>
  8060. </remarks>
  8061. </member>
  8062. <member name="P:Microsoft.Data.SqlClient.SqlError.Source">
  8063. <summary>Gets the name of the provider that generated the error.</summary><value>The name of the provider that generated the error.</value><remarks>
  8064. <format type="text/markdown"><![CDATA[
  8065. ## Examples
  8066. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8067. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8068. ]]></format>
  8069. </remarks>
  8070. </member>
  8071. <member name="P:Microsoft.Data.SqlClient.SqlError.State">
  8072. <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>
  8073. <format type="text/markdown"><![CDATA[
  8074. ## Remarks
  8075. State is only set for errors that are received from the server.
  8076. For more information on errors generated by SQL Server, see [Understanding Database Engine Errors](https://msdn.microsoft.com/library/ms165761.aspx).
  8077. ## Examples
  8078. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8079. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  8080. ]]></format>
  8081. </remarks>
  8082. </member>
  8083. <member name="M:Microsoft.Data.SqlClient.SqlError.ToString">
  8084. <summary>Gets the complete text of the error message.</summary><returns>The complete text of the error.</returns><remarks>
  8085. <format type="text/markdown"><![CDATA[
  8086. ## Remarks
  8087. The string is in the form "SqlError:", followed by the <xref:Microsoft.Data.SqlClient.SqlError.Message%2A>, and the stack trace. For example:
  8088. SqlError:UserId or Password not valid. \<stack trace>
  8089. ## Examples
  8090. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8091. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  8092. ]]></format>
  8093. </remarks>
  8094. </member>
  8095. <member name="T:Microsoft.Data.SqlClient.SqlErrorCollection">
  8096. <summary>Collects all errors generated by the .NET Framework Data Provider for SQL Server. This class cannot be inherited.</summary><remarks>
  8097. <format type="text/markdown"><![CDATA[
  8098. ## Remarks
  8099. 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.
  8100. ## Examples
  8101. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8102. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  8103. ]]></format>
  8104. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlError" /><altmember cref="T:Microsoft.Data.SqlClient.SqlException" />
  8105. </member>
  8106. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.Count">
  8107. <summary>Gets the number of errors in the collection.</summary><value>The total number of errors in the collection.</value><remarks>
  8108. <format type="text/markdown"><![CDATA[
  8109. ## Examples
  8110. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8111. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  8112. ]]></format>
  8113. </remarks>
  8114. </member>
  8115. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.Item(System.Int32)">
  8116. <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>
  8117. <format type="text/markdown"><![CDATA[
  8118. ## Examples
  8119. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8120. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  8121. ]]></format>
  8122. </remarks><exception cref="T:System.IndexOutOfRangeException">Index parameter is outside array bounds.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlErrorCollection.Count" />
  8123. </member>
  8124. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.System#Collections#ICollection#IsSynchronized">
  8125. <summary>For a description of this member, see <see cref="P:System.Collections.ICollection.IsSynchronized" />.</summary><value>
  8126. <see langword="true" /> if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, <see langword="false" />.</value><remarks>
  8127. <format type="text/markdown"><![CDATA[
  8128. ## Remarks
  8129. 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.
  8130. ]]></format>
  8131. </remarks>
  8132. </member>
  8133. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.System#Collections#ICollection#SyncRoot">
  8134. <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>
  8135. <format type="text/markdown"><![CDATA[
  8136. ## Remarks
  8137. 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.
  8138. ]]></format>
  8139. </remarks>
  8140. </member>
  8141. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.CopyTo(System.Array,System.Int32)">
  8142. <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>
  8143. </member>
  8144. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.CopyTo(Microsoft.Data.SqlClient.SqlError[],System.Int32)">
  8145. <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>
  8146. </member>
  8147. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.GetEnumerator">
  8148. <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>
  8149. <format type="text/markdown"><![CDATA[
  8150. ## Remarks
  8151. Enumerators can be used to read the data in a collection, but they cannot be used to modify the underlying collection.
  8152. ]]></format>
  8153. </remarks>
  8154. </member>
  8155. <member name="T:Microsoft.Data.SqlClient.SqlException">
  8156. <summary>The exception that is thrown when SQL Server returns a warning or error. This class cannot be inherited.</summary><remarks>
  8157. <format type="text/markdown"><![CDATA[
  8158. ## Remarks
  8159. 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>.
  8160. 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.
  8161. 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.
  8162. 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.
  8163. 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.
  8164. Note that beginning with .NET Framework 4.5, <xref:Microsoft.Data.SqlClient.SqlException> can return an inner <xref:System.ComponentModel.Win32Exception>.
  8165. 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.
  8166. 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.
  8167. 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.
  8168. 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:
  8169. ```csharp
  8170. try {
  8171. // code here
  8172. }
  8173. catch (SqlException odbcEx) {
  8174. // Handle more specific SqlException exception here.
  8175. }
  8176. catch (Exception ex) {
  8177. // Handle generic ones here.
  8178. }
  8179. ```
  8180. Or:
  8181. ```csharp
  8182. try {
  8183. // code here
  8184. }
  8185. catch (Exception ex) {
  8186. if (ex is SqlException) {
  8187. // Handle more specific SqlException exception here.
  8188. }
  8189. else {
  8190. // Handle generic ones here.
  8191. }
  8192. }
  8193. ```
  8194. 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.
  8195. ## Examples
  8196. The following example generates a <xref:Microsoft.Data.SqlClient.SqlException> and then displays the exception.
  8197. [!code-csharp[SqlException_Errors1 Example#1](~/../sqlclient/doc/samples/SqlException_Errors1.cs#1)]
  8198. ]]></format>
  8199. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlError" /><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />
  8200. </member>
  8201. <member name="P:Microsoft.Data.SqlClient.SqlException.Class">
  8202. <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>
  8203. <format type="text/markdown"><![CDATA[
  8204. ## Remarks
  8205. 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.
  8206. 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.
  8207. For information about the warning and informational messages sent by SQL Server, see the Troubleshooting section of the SQL Server documentation.
  8208. 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.
  8209. If <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> is `null`, the [`default`](https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/default-values) value for `byte` is returned.
  8210. ## Examples
  8211. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8212. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8213. ]]></format>
  8214. </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" />
  8215. </member>
  8216. <member name="P:Microsoft.Data.SqlClient.SqlException.ClientConnectionId">
  8217. <summary>Represents the client connection ID. For more information, see <see href="https://docs.microsoft.com/sql/connect/ado-net/data-tracing">Data Tracing in ADO.NET</see>.</summary><value>The client connection ID.</value><remarks>
  8218. <format type="text/markdown"><![CDATA[
  8219. ## Remarks
  8220. For a code sample, see <xref:Microsoft.Data.SqlClient.SqlException.ToString%2A>.
  8221. ]]></format>
  8222. </remarks>
  8223. </member>
  8224. <member name="P:Microsoft.Data.SqlClient.SqlException.Errors">
  8225. <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>
  8226. <format type="text/markdown"><![CDATA[
  8227. ## Remarks
  8228. The <xref:Microsoft.Data.SqlClient.SqlErrorCollection> class always contains at least one instance of the <xref:Microsoft.Data.SqlClient.SqlError> class.
  8229. 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).
  8230. ## Examples
  8231. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8232. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  8233. ]]></format>
  8234. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlError" />
  8235. </member>
  8236. <member name="P:Microsoft.Data.SqlClient.SqlException.LineNumber">
  8237. <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>
  8238. <format type="text/markdown"><![CDATA[
  8239. ## Remarks
  8240. The line numbering starts at 1; if 0 is returned, the line number is not applicable.
  8241. 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.
  8242. If <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> is `null`, the [`default`](https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/default-values) value for `int` is returned.
  8243. ## Examples
  8244. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8245. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8246. ]]></format>
  8247. </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" />
  8248. </member>
  8249. <member name="P:Microsoft.Data.SqlClient.SqlException.Number">
  8250. <summary>Gets a number that identifies the type of error.</summary><value>The number that identifies the type of error.</value><remarks>
  8251. <format type="text/markdown"><![CDATA[
  8252. ## Remarks
  8253. 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.
  8254. If <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> is `null`, the [`default`](https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/default-values) value for `int` is returned.
  8255. For more information on SQL Server engine errors, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  8256. ## Examples
  8257. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8258. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8259. ]]></format>
  8260. </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" />
  8261. </member>
  8262. <member name="P:Microsoft.Data.SqlClient.SqlException.Procedure">
  8263. <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>
  8264. <format type="text/markdown"><![CDATA[
  8265. ## Remarks
  8266. 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.
  8267. If <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> is `null`, the [`default`](https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/default-values) value for `string` is returned.
  8268. ## Examples
  8269. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8270. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8271. ]]></format>
  8272. </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" />
  8273. </member>
  8274. <member name="P:Microsoft.Data.SqlClient.SqlException.Server">
  8275. <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>
  8276. <format type="text/markdown"><![CDATA[
  8277. ## Remarks
  8278. 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.
  8279. If <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> is `null`, the [`default`](https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/default-values) value for `string` is returned.
  8280. ## Examples
  8281. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8282. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8283. ]]></format>
  8284. </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" />
  8285. </member>
  8286. <member name="P:Microsoft.Data.SqlClient.SqlException.Source">
  8287. <summary>Gets the name of the provider that generated the error.</summary><value>The name of the provider that generated the error.</value><remarks>
  8288. <format type="text/markdown"><![CDATA[
  8289. ## Remarks
  8290. 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.
  8291. ## Examples
  8292. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8293. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8294. ]]></format>
  8295. </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" />
  8296. </member>
  8297. <member name="P:Microsoft.Data.SqlClient.SqlException.State">
  8298. <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>
  8299. <format type="text/markdown"><![CDATA[
  8300. ## Remarks
  8301. 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.
  8302. If <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> is `null`, the [`default`](https://docs.microsoft.com/dotnet/csharp/language-reference/builtin-types/default-values) value for `byte` is returned.
  8303. ## Examples
  8304. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  8305. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  8306. ]]></format>
  8307. </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" />
  8308. </member>
  8309. <member name="M:Microsoft.Data.SqlClient.SqlException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
  8310. <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>
  8311. <format type="text/markdown"><![CDATA[
  8312. ## Remarks
  8313. `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.
  8314. ]]></format>
  8315. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="si" /> parameter is a null reference (<see langword="Nothing" /> in Visual Basic).</exception>
  8316. </member>
  8317. <member name="M:Microsoft.Data.SqlClient.SqlException.ToString">
  8318. <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>
  8319. <format type="text/markdown"><![CDATA[
  8320. ## Examples
  8321. 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:
  8322. ```csharp
  8323. using Microsoft.Data.SqlClient;
  8324. using System;
  8325. public class A {
  8326. public static void Main() {
  8327. SqlConnection connection = new SqlConnection();
  8328. connection.ConnectionString = "Data Source=a_valid_server;Initial Catalog=Northwinda;Integrated Security=true";
  8329. try {
  8330. connection.Open();
  8331. }
  8332. catch (SqlException p) {
  8333. Console.WriteLine("{0}", p.ClientConnectionId);
  8334. Console.WriteLine("{0}", p.ToString());
  8335. }
  8336. connection.Close();
  8337. }
  8338. }
  8339. ```
  8340. The following Visual Basic sample is functionally equivalent to the previous (C#) sample:
  8341. ```vb
  8342. Imports Microsoft.Data.SqlClient
  8343. Imports System
  8344. Module Module1
  8345. Sub Main()
  8346. Dim connection As New SqlConnection()
  8347. connection.ConnectionString = "Data Source=a_valid_server;Initial Catalog=Northwinda;Integrated Security=true"
  8348. Try
  8349. connection.Open()
  8350. Catch p As SqlException
  8351. Console.WriteLine("{0}", p.ClientConnectionId)
  8352. Console.WriteLine("{0}", p.ToString())
  8353. End Try
  8354. connection.Close()
  8355. End Sub
  8356. End Module
  8357. ```
  8358. ]]></format>
  8359. </remarks>
  8360. </member>
  8361. <member name="T:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs">
  8362. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage" /> event.</summary><remarks>
  8363. <format type="text/markdown"><![CDATA[
  8364. ## Remarks
  8365. The <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event contains a <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection which contains the warnings sent from the server.
  8366. An <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event is generated when a SQL Server message with a severity level of 10 or less occurs.
  8367. ]]></format>
  8368. </remarks>
  8369. </member>
  8370. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Errors">
  8371. <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>
  8372. </member>
  8373. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Message">
  8374. <summary>Gets the full text of the error sent from the database.</summary><value>The full text of the error.</value><remarks>
  8375. <format type="text/markdown"><![CDATA[
  8376. ## Remarks
  8377. 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.
  8378. ]]></format>
  8379. </remarks>
  8380. </member>
  8381. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Source">
  8382. <summary>Gets the name of the object that generated the error.</summary><value>The name of the object that generated the error.</value><remarks>
  8383. <format type="text/markdown"><![CDATA[
  8384. ## Remarks
  8385. 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.
  8386. ]]></format>
  8387. </remarks>
  8388. </member>
  8389. <member name="M:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.ToString">
  8390. <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>
  8391. </member>
  8392. <member name="T:Microsoft.Data.SqlClient.SqlInfoMessageEventHandler">
  8393. <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>
  8394. <format type="text/markdown"><![CDATA[
  8395. ## Remarks
  8396. 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](/dotnet/standard/events/).
  8397. ]]></format>
  8398. </remarks>
  8399. </member>
  8400. <member name="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs">
  8401. <summary>Represents the set of arguments passed to the notification event handler.</summary><remarks>To be added.</remarks>
  8402. </member>
  8403. <member name="M:Microsoft.Data.SqlClient.SqlNotificationEventArgs.#ctor(Microsoft.Data.SqlClient.SqlNotificationType,Microsoft.Data.SqlClient.SqlNotificationInfo,Microsoft.Data.SqlClient.SqlNotificationSource)">
  8404. <param name="type">
  8405. <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">
  8406. <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">
  8407. <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>
  8408. </member>
  8409. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Info">
  8410. <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>
  8411. <format type="text/markdown"><![CDATA[
  8412. ## Remarks
  8413. This event may occur because the data in the store actually changed, or the notification is no longer valid (for example, it timed out).
  8414. ]]></format>
  8415. </remarks>
  8416. </member>
  8417. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Source">
  8418. <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>
  8419. </member>
  8420. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Type">
  8421. <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>
  8422. </member>
  8423. <member name="T:Microsoft.Data.SqlClient.SqlNotificationInfo">
  8424. <summary>This enumeration provides additional information about the different notifications that can be received by the dependency event handler.</summary><remarks>
  8425. <format type="text/markdown"><![CDATA[
  8426. ## Remarks
  8427. The <xref:Microsoft.Data.SqlClient.SqlNotificationInfo> enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class.
  8428. ]]></format>
  8429. </remarks>
  8430. </member>
  8431. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.AlreadyChanged">
  8432. <summary>The <see langword="SqlDependency" /> object already fired, and new commands cannot be added to it.</summary>
  8433. </member>
  8434. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Alter">
  8435. <summary>An underlying server object related to the query was modified.</summary>
  8436. </member>
  8437. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Delete">
  8438. <summary>Data was changed by a DELETE statement.</summary>
  8439. </member>
  8440. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Drop">
  8441. <summary>An underlying object related to the query was dropped.</summary>
  8442. </member>
  8443. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Error">
  8444. <summary>An internal server error occurred.</summary>
  8445. </member>
  8446. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Expired">
  8447. <summary>The <see langword="SqlDependency" /> object has expired.</summary>
  8448. </member>
  8449. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Insert">
  8450. <summary>Data was changed by an INSERT statement.</summary>
  8451. </member>
  8452. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Invalid">
  8453. <summary>A statement was provided that cannot be notified (for example, an UPDATE statement).</summary>
  8454. </member>
  8455. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Isolation">
  8456. <summary>The statement was executed under an isolation mode that was not valid (for example, Snapshot).</summary>
  8457. </member>
  8458. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Merge">
  8459. <summary>Used to distinguish the server-side cause for a query notification firing.</summary>
  8460. </member>
  8461. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Options">
  8462. <summary>The SET options were not set appropriately at subscription time.</summary>
  8463. </member>
  8464. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.PreviousFire">
  8465. <summary>A previous statement has caused query notifications to fire under the current transaction.</summary>
  8466. </member>
  8467. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Query">
  8468. <summary>A SELECT statement that cannot be notified or was provided.</summary>
  8469. </member>
  8470. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Resource">
  8471. <summary>Fires as a result of server resource pressure.</summary>
  8472. </member>
  8473. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Restart">
  8474. <summary>The server was restarted (notifications are sent during restart.).</summary>
  8475. </member>
  8476. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.TemplateLimit">
  8477. <summary>The subscribing query causes the number of templates on one of the target tables to exceed the maximum allowable limit.</summary>
  8478. </member>
  8479. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Truncate">
  8480. <summary>One or more tables were truncated.</summary>
  8481. </member>
  8482. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Unknown">
  8483. <summary>Used when the info option sent by the server was not recognized by the client.</summary>
  8484. </member>
  8485. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Update">
  8486. <summary>Data was changed by an UPDATE statement.</summary>
  8487. </member>
  8488. <member name="T:Microsoft.Data.SqlClient.SqlNotificationSource">
  8489. <summary>Indicates the source of the notification received by the dependency event handler.</summary><remarks>
  8490. <format type="text/markdown"><![CDATA[
  8491. ## Remarks
  8492. The `SqlNotificationSource` enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class.
  8493. 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).
  8494. ]]></format>
  8495. </remarks>
  8496. </member>
  8497. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Client">
  8498. <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>
  8499. </member>
  8500. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Data">
  8501. <summary>Data has changed; for example, an insert, update, delete, or truncate operation occurred.</summary>
  8502. </member>
  8503. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Database">
  8504. <summary>The database state changed; for example, the database related to the query was dropped or detached.</summary>
  8505. </member>
  8506. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Environment">
  8507. <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>
  8508. </member>
  8509. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Execution">
  8510. <summary>A run-time error occurred during execution.</summary>
  8511. </member>
  8512. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Object">
  8513. <summary>A database object changed; for example, an underlying object related to the query was dropped or modified.</summary>
  8514. </member>
  8515. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Owner">
  8516. <summary>Internal only; not intended to be used in your code.</summary>
  8517. </member>
  8518. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Statement">
  8519. <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>
  8520. </member>
  8521. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.System">
  8522. <summary>A system-related event occurred. For example, there was an internal error, the server was restarted, or resource pressure caused the invalidation.</summary>
  8523. </member>
  8524. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Timeout">
  8525. <summary>The subscription time-out expired.</summary>
  8526. </member>
  8527. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Unknown">
  8528. <summary>Used when the source option sent by the server was not recognized by the client.</summary>
  8529. </member>
  8530. <member name="T:Microsoft.Data.SqlClient.SqlNotificationType">
  8531. <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>
  8532. <format type="text/markdown"><![CDATA[
  8533. ## Remarks
  8534. 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.
  8535. ]]></format>
  8536. </remarks>
  8537. </member>
  8538. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Change">
  8539. <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>
  8540. </member>
  8541. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Subscribe">
  8542. <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>
  8543. </member>
  8544. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Unknown">
  8545. <summary>Used when the type option sent by the server was not recognized by the client.</summary>
  8546. </member>
  8547. <member name="T:Microsoft.Data.SqlClient.SqlParameter">
  8548. <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](/sql/connect/ado-net/configure-parameters).</summary><remarks>
  8549. <format type="text/markdown"><![CDATA[
  8550. ## Remarks
  8551. Parameter names are not case sensitive.
  8552. > [!NOTE]
  8553. > Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
  8554. For more information, along with additional sample code demonstrating how to use parameters, see [Commands and Parameters](/sql/connect/ado-net/commands-parameters).
  8555. ## Examples
  8556. 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](/sql/connect/ado-net/retrieving-modifying-data) and [Configuring parameters](/sql/connect/ado-net/configure-parameters).
  8557. [!code-csharp[SqlParameterCollection_Add6](~/../sqlclient/doc/samples/SqlParameterCollection_Add6.cs#1)]
  8558. ]]></format>
  8559. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  8560. </member>
  8561. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor">
  8562. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class.</summary><remarks>
  8563. <format type="text/markdown"><![CDATA[
  8564. ## Examples
  8565. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8566. [!code-csharp[SqlParameter_SqlParameter Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter.cs#1)]
  8567. ]]></format>
  8568. </remarks>
  8569. </member>
  8570. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType)">
  8571. <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>
  8572. <format type="text/markdown"><![CDATA[
  8573. ## Remarks
  8574. The data type and, if appropriate, **Size** and <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> are inferred from the value of the `dbType` parameter.
  8575. ## Examples
  8576. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8577. [!code-csharp[SqlParameter_SqlParameter2 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter2.cs#1)]
  8578. ]]></format>
  8579. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  8580. </member>
  8581. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32)">
  8582. <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>
  8583. <format type="text/markdown"><![CDATA[
  8584. ## Remarks
  8585. The **Size** is inferred from the value of the `dbType` parameter if it is not explicitly set in the `size` parameter.
  8586. ## Examples
  8587. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8588. [!code-csharp[SqlParameter_SqlParameter4 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter4.cs#1)]
  8589. ]]></format>
  8590. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  8591. </member>
  8592. <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)">
  8593. <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">
  8594. <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="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</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>
  8595. <format type="text/markdown"><![CDATA[
  8596. ## Remarks
  8597. 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.
  8598. ## Examples
  8599. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8600. [!code-csharp[SqlParameter_SqlParameter1 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter1.cs#1)]
  8601. ]]></format>
  8602. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  8603. </member>
  8604. <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)">
  8605. <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="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />&gt;.</param><param name="sourceVersion">One of the <see cref="T:System.Data.DataRowVersion" /> values.</param><param name="sourceColumnNullMapping">
  8606. <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>
  8607. <format type="text/markdown"><![CDATA[
  8608. ## Remarks
  8609. 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.
  8610. ]]></format>
  8611. </remarks>
  8612. </member>
  8613. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32,System.String)">
  8614. <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="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />&gt;.</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>
  8615. <format type="text/markdown"><![CDATA[
  8616. ## Remarks
  8617. The **Size** is inferred from the value of the `dbType` parameter if it is not explicitly set in the `size` parameter.
  8618. ## Examples
  8619. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8620. [!code-csharp[SqlParameter_SqlParameter5 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter5.cs#1)]
  8621. ]]></format>
  8622. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  8623. </member>
  8624. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Object)">
  8625. <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>
  8626. <format type="text/markdown"><![CDATA[
  8627. ## Remarks
  8628. 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>.
  8629. 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.
  8630. ```csharp
  8631. Parameter = new SqlParameter("@pname", (object)0);
  8632. ```
  8633. 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.
  8634. ## Examples
  8635. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8636. [!code-csharp[SqlParameter_SqlParameter6 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter6.cs#1)]
  8637. ]]></format>
  8638. </remarks>
  8639. </member>
  8640. <member name="P:Microsoft.Data.SqlClient.SqlParameter.CompareInfo">
  8641. <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>
  8642. </member>
  8643. <member name="P:Microsoft.Data.SqlClient.SqlParameter.DbType">
  8644. <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>
  8645. <format type="text/markdown"><![CDATA[
  8646. ## Remarks
  8647. 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>.
  8648. For a list of the supported data types, see the appropriate <xref:System.Data.SqlDbType> member. For more information, see [DataAdapter Parameters](/sql/connect/ado-net/dataadapter-parameters).
  8649. ## Examples
  8650. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8651. [!code-csharp[SqlParameter_IsNullable Example#1](~/../sqlclient/doc/samples/SqlParameter_IsNullable.cs#1)]
  8652. ]]></format>
  8653. </remarks>
  8654. </member>
  8655. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Direction">
  8656. <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>
  8657. <format type="text/markdown"><![CDATA[
  8658. ## Remarks
  8659. 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.
  8660. `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>.
  8661. ## Examples
  8662. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8663. [Commands and Parameters](/sql/connect/ado-net/commands-parameters)
  8664. [DataAdapter Parameters](/sql/connect/ado-net/dataadapter-parameters)
  8665. [SQL Server and ADO.NET](/sql/connect/ado-net/sql/)
  8666. ]]></format>
  8667. </remarks><exception cref="T:System.ArgumentException">The property was not set to one of the valid <see cref="T:System.Data.ParameterDirection" /> values.</exception>
  8668. </member>
  8669. <member name="P:Microsoft.Data.SqlClient.SqlParameter.ForceColumnEncryption">
  8670. <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>
  8671. <see langword="true" /> if the parameter has a force column encryption; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  8672. </member>
  8673. <member name="P:Microsoft.Data.SqlClient.SqlParameter.IsNullable">
  8674. <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>
  8675. <see langword="true" /> if null values are accepted; otherwise, <see langword="false" />. The default is <see langword="false" />.</value><remarks>
  8676. <format type="text/markdown"><![CDATA[
  8677. ## Remarks
  8678. Null values are handled using the <xref:System.DBNull> class.
  8679. ## Examples
  8680. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8681. [!code-csharp[SqlParameter#2](~/../sqlclient/doc/samples/SqlParameter.cs#2)]
  8682. ]]></format>
  8683. </remarks>
  8684. </member>
  8685. <member name="P:Microsoft.Data.SqlClient.SqlParameter.LocaleId">
  8686. <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>
  8687. <format type="text/markdown"><![CDATA[
  8688. ## Remarks
  8689. 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.
  8690. ```csharp
  8691. static void CreateSqlParameterLocaleId(){
  8692. SqlParameter parameter = new SqlParameter("pName", SqlDbType.VarChar);
  8693. parameter.LocaleId = 1033; // English - United States
  8694. }
  8695. ```
  8696. ]]></format>
  8697. </remarks>
  8698. </member>
  8699. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Offset">
  8700. <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>
  8701. <format type="text/markdown"><![CDATA[
  8702. ## Remarks
  8703. 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.
  8704. `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.
  8705. ## Examples
  8706. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8707. [!code-csharp[SqlParameter#3](~/../sqlclient/doc/samples/SqlParameter.cs#3)]
  8708. ]]></format>
  8709. </remarks>
  8710. </member>
  8711. <member name="P:Microsoft.Data.SqlClient.SqlParameter.ParameterName">
  8712. <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>
  8713. <format type="text/markdown"><![CDATA[
  8714. ## Remarks
  8715. 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.
  8716. ## Examples
  8717. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8718. [!code-csharp[SqlParameter_ParameterName Example#1](~/../sqlclient/doc/samples/SqlParameter_ParameterName.cs#1)]
  8719. ]]></format>
  8720. </remarks>
  8721. </member>
  8722. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Precision">
  8723. <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>
  8724. <format type="text/markdown"><![CDATA[
  8725. ## Remarks
  8726. The <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
  8727. 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.
  8728. > [!NOTE]
  8729. > 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.
  8730. > [!NOTE]
  8731. > 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.
  8732. ## Examples
  8733. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8734. [!code-csharp[SqlParameter_Precision Example#1](~/../sqlclient/doc/samples/SqlParameter_Precision.cs#1)]
  8735. ]]></format>
  8736. </remarks>
  8737. </member>
  8738. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Scale">
  8739. <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>
  8740. <format type="text/markdown"><![CDATA[
  8741. ## Remarks
  8742. The <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
  8743. > [!WARNING]
  8744. > 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).
  8745. 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.
  8746. > [!NOTE]
  8747. > 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.
  8748. > [!NOTE]
  8749. > .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.
  8750. ## Examples
  8751. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8752. [!code-csharp[SqlParameter#4](~/../sqlclient/doc/samples/SqlParameter.cs#4)]
  8753. ]]></format>
  8754. </remarks>
  8755. </member>
  8756. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Size">
  8757. <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>
  8758. <format type="text/markdown"><![CDATA[
  8759. ## Remarks
  8760. Return values are not affected by this property; return parameters from stored procedures are always fixed-size integers.
  8761. 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.
  8762. 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.
  8763. 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.
  8764. 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.
  8765. If not explicitly set, the size is inferred from the actual size of the specified parameter value.
  8766. If the fractional part of the parameter value is greater than the size, then the value will be truncated to match the size.
  8767. 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.
  8768. For information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  8769. ## Examples
  8770. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8771. [!code-csharp[SqlParameter#5](~/../sqlclient/doc/samples/SqlParameter.cs#5)]
  8772. ]]></format>
  8773. </remarks>
  8774. </member>
  8775. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn">
  8776. <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>
  8777. <format type="text/markdown"><![CDATA[
  8778. ## Remarks
  8779. 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.
  8780. For more information about how to use the <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumn%2A> property, see [DataAdapter Parameters](/sql/connect/ado-net/dataadapter-parameters) and [Updating Data Sources with DataAdapters](/sql/connect/ado-net/update-data-sources-with-dataadapters).
  8781. ## Examples
  8782. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8783. [!code-csharp[SqlParameter#6](~/../sqlclient/doc/samples/SqlParameter.cs#6)]
  8784. ]]></format>
  8785. </remarks>
  8786. </member>
  8787. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping">
  8788. <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>
  8789. <see langword="true" /> if the source column is nullable; <see langword="false" /> if it is not.</value><remarks>
  8790. <format type="text/markdown"><![CDATA[
  8791. ## Remarks
  8792. <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>.
  8793. <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):
  8794. ```
  8795. ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR
  8796. (FieldName = @Original_FieldName))
  8797. ```
  8798. If <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping%2A> for the field is false, <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> generates the following WHERE clause:
  8799. ```
  8800. FieldName = @OriginalFieldName
  8801. ```
  8802. 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.
  8803. ]]></format>
  8804. </remarks>
  8805. </member>
  8806. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceVersion">
  8807. <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>
  8808. <format type="text/markdown"><![CDATA[
  8809. ## Remarks
  8810. 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.
  8811. ## Examples
  8812. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8813. [!code-csharp[SqlParameter#7](~/../sqlclient/doc/samples/SqlParameter.cs#7)]
  8814. ]]></format>
  8815. </remarks>
  8816. </member>
  8817. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType">
  8818. <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>
  8819. <format type="text/markdown"><![CDATA[
  8820. ## Remarks
  8821. 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>.
  8822. For a list of the supported data types, see the appropriate <xref:System.Data.SqlDbType> member. For more information, see [DataAdapter Parameters](/sql/connect/ado-net/dataadapter-parameters).
  8823. For information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  8824. ]]></format>
  8825. </remarks>
  8826. </member>
  8827. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SqlValue">
  8828. <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>
  8829. <format type="text/markdown"><![CDATA[
  8830. ## Remarks
  8831. 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.
  8832. 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.
  8833. 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.
  8834. 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>.
  8835. The <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType> property is overwritten by `SqlDataAdapter.UpdateCommand`.
  8836. Use the <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType> property to return parameter values as common language runtime (CLR) types.
  8837. For information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  8838. ]]></format>
  8839. </remarks>
  8840. </member>
  8841. <member name="P:Microsoft.Data.SqlClient.SqlParameter.TypeName">
  8842. <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>
  8843. </member>
  8844. <member name="P:Microsoft.Data.SqlClient.SqlParameter.UdtTypeName">
  8845. <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>
  8846. <format type="text/markdown"><![CDATA[
  8847. ## Remarks
  8848. For a sample demonstrating <xref:Microsoft.Data.SqlClient.SqlParameter.UdtTypeName%2A>, see [Retrieving UDT Data](https://msdn.microsoft.com/library/ms131080.aspx).
  8849. ]]></format>
  8850. </remarks>
  8851. </member>
  8852. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Value">
  8853. <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>
  8854. <format type="text/markdown"><![CDATA[
  8855. ## Remarks
  8856. 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.
  8857. 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.
  8858. An exception is thrown if non-Unicode XML data is passed as a string.
  8859. 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.
  8860. 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.
  8861. The <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A> property is overwritten by `SqlDataAdapter.UpdateCommand`.
  8862. For information about streaming, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
  8863. ## Examples
  8864. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  8865. [!code-csharp[SqlParameter#8](~/../sqlclient/doc/samples/SqlParameter.cs#8)]
  8866. ]]></format>
  8867. </remarks>
  8868. </member>
  8869. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionDatabase">
  8870. <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>
  8871. <format type="text/markdown"><![CDATA[
  8872. ## Remarks
  8873. 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.
  8874. ]]></format>
  8875. </remarks>
  8876. </member>
  8877. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionName">
  8878. <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>
  8879. <format type="text/markdown"><![CDATA[
  8880. ## Remarks
  8881. 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.
  8882. ]]></format>
  8883. </remarks>
  8884. </member>
  8885. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionOwningSchema">
  8886. <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>
  8887. <format type="text/markdown"><![CDATA[
  8888. ## Remarks
  8889. 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.
  8890. ]]></format>
  8891. </remarks>
  8892. </member>
  8893. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ResetDbType">
  8894. <summary>Resets the type associated with this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  8895. <format type="text/markdown"><![CDATA[
  8896. ## Remarks
  8897. 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>.
  8898. ]]></format>
  8899. </remarks>
  8900. </member>
  8901. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ResetSqlDbType">
  8902. <summary>Resets the type associated with this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  8903. <format type="text/markdown"><![CDATA[
  8904. ## Remarks
  8905. 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>.
  8906. ]]></format>
  8907. </remarks>
  8908. </member>
  8909. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ToString">
  8910. <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>
  8911. </member>
  8912. <member name="T:Microsoft.Data.SqlClient.SqlParameterCollection">
  8913. <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>
  8914. <format type="text/markdown"><![CDATA[
  8915. ## Remarks
  8916. 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.
  8917. For more information with additional sample code demonstrating how to use parameters, see [Commands and Parameters](/sql/connect/ado-net/commands-parameters).
  8918. ## Examples
  8919. 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.
  8920. [!code-csharp[SqlParameterCollection_Add6 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add6.cs#1)]
  8921. ]]></format>
  8922. </remarks>
  8923. </member>
  8924. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Count">
  8925. <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>
  8926. </member>
  8927. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsFixedSize">
  8928. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> has a fixed size.</summary><value>
  8929. <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>
  8930. </member>
  8931. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsReadOnly">
  8932. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is read-only.</summary><value>
  8933. <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>
  8934. </member>
  8935. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsSynchronized">
  8936. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is synchronized.</summary><value>
  8937. <see langword="true" /> if the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is synchronized; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  8938. </member>
  8939. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Item(System.Int32)">
  8940. <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>
  8941. <format type="text/markdown"><![CDATA[
  8942. ## Examples
  8943. 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.
  8944. [!code-csharp[SqlParameterCollection_Count Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Count.cs#1)]
  8945. ]]></format>
  8946. </remarks><exception cref="T:System.IndexOutOfRangeException">The specified index does not exist.</exception>
  8947. </member>
  8948. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Item(System.String)">
  8949. <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>
  8950. <format type="text/markdown"><![CDATA[
  8951. ## Remarks
  8952. 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.
  8953. ]]></format>
  8954. </remarks><exception cref="T:System.IndexOutOfRangeException">The specified <paramref name="parameterName" /> is not valid.</exception>
  8955. </member>
  8956. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.SyncRoot">
  8957. <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>
  8958. </member>
  8959. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(Microsoft.Data.SqlClient.SqlParameter)">
  8960. <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>
  8961. <format type="text/markdown"><![CDATA[
  8962. ## Examples
  8963. [!code-csharp[SqlParameterCollection_Add Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add.cs#1)]
  8964. ]]></format>
  8965. </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>
  8966. </member>
  8967. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.Object)">
  8968. <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>
  8969. </member>
  8970. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType)">
  8971. <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>
  8972. <format type="text/markdown"><![CDATA[
  8973. ## Examples
  8974. [!code-csharp[SqlParameterCollection_Add3 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add3.cs#1)]
  8975. ]]></format>
  8976. </remarks>
  8977. </member>
  8978. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType,System.Int32)">
  8979. <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>
  8980. <format type="text/markdown"><![CDATA[
  8981. ## Remarks
  8982. This overload is useful when you are adding a parameter of a variable-length data type such as `varchar` or `binary`.
  8983. ## Examples
  8984. [!code-csharp[SqlParameterCollection_Add1 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add1.cs#1)]
  8985. ]]></format>
  8986. </remarks>
  8987. </member>
  8988. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType,System.Int32,System.String)">
  8989. <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="M:System.Data.Common.DbDataAdapter.Update(System.Data.DataSet)" />.</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>
  8990. <format type="text/markdown"><![CDATA[
  8991. ## Examples
  8992. [!code-csharp[SqlParameterCollection_Add5 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add5.cs#1)]
  8993. ]]></format>
  8994. </remarks>
  8995. </member>
  8996. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Object)">
  8997. <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.
  8998. 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.
  8999. ```
  9000. parameters.Add("@pname", Convert.ToInt32(0));
  9001. ```
  9002. 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>
  9003. <format type="text/markdown"><![CDATA[
  9004. ## Examples
  9005. [!code-csharp[SqlParameterCollection_Add1 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add1.cs#1)]
  9006. ]]></format>
  9007. </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>
  9008. </member>
  9009. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddRange(Microsoft.Data.SqlClient.SqlParameter[])">
  9010. <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>
  9011. </member>
  9012. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddRange(System.Array)">
  9013. <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>
  9014. </member>
  9015. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddWithValue(System.String,System.Object)">
  9016. <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>
  9017. <format type="text/markdown"><![CDATA[
  9018. ## Remarks
  9019. <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.
  9020. 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.
  9021. ## Examples
  9022. The following example demonstrates how to use the `AddWithValue` method.
  9023. [!code-csharp[SqlParameterCollection_AddWithValue#1](~/../sqlclient/doc/samples/SqlParameterCollection_AddWithValue.cs#1)]
  9024. ]]></format>
  9025. </remarks>
  9026. </member>
  9027. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Clear">
  9028. <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>
  9029. </member>
  9030. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(Microsoft.Data.SqlClient.SqlParameter)">
  9031. <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>
  9032. <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>
  9033. </member>
  9034. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(System.Object)">
  9035. <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>
  9036. <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>
  9037. </member>
  9038. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(System.String)">
  9039. <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>
  9040. <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>
  9041. </member>
  9042. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.CopyTo(System.Array,System.Int32)">
  9043. <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>
  9044. </member>
  9045. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.CopyTo(Microsoft.Data.SqlClient.SqlParameter[],System.Int32)">
  9046. <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>
  9047. </member>
  9048. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetEnumerator">
  9049. <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>
  9050. </member>
  9051. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetParameter(System.Int32)">
  9052. <param name="index">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  9053. </member>
  9054. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetParameter(System.String)">
  9055. <param name="parameterName">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  9056. </member>
  9057. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(Microsoft.Data.SqlClient.SqlParameter)">
  9058. <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>
  9059. </member>
  9060. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(System.Object)">
  9061. <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>
  9062. </member>
  9063. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(System.String)">
  9064. <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>
  9065. </member>
  9066. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlParameter)">
  9067. <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>
  9068. </member>
  9069. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Insert(System.Int32,System.Object)">
  9070. <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>
  9071. </member>
  9072. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Remove(Microsoft.Data.SqlClient.SqlParameter)">
  9073. <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>
  9074. <format type="text/markdown"><![CDATA[
  9075. ## Examples
  9076. 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>.
  9077. [!code-csharp[SqlParameterCollection_Remove Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Remove.cs#1)]
  9078. ]]></format>
  9079. </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>
  9080. </member>
  9081. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Remove(System.Object)">
  9082. <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>
  9083. </member>
  9084. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.RemoveAt(System.Int32)">
  9085. <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>
  9086. </member>
  9087. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.RemoveAt(System.String)">
  9088. <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>
  9089. </member>
  9090. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.SetParameter(System.Int32,System.Data.Common.DbParameter)">
  9091. <param name="index">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  9092. </member>
  9093. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.SetParameter(System.String,System.Data.Common.DbParameter)">
  9094. <param name="parameterName">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  9095. </member>
  9096. <member name="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs">
  9097. <summary>Represents the set of arguments passed to the <see cref="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventHandler" />.</summary><remarks>To be added.</remarks>
  9098. </member>
  9099. <member name="M:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.#ctor(System.Int64)">
  9100. <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>
  9101. <format type="text/markdown"><![CDATA[
  9102. ## Remarks
  9103. The value in the `rowsCopied` parameter is reset on each call to any one of the `SqlBulkCopy.WriteToServer` methods.
  9104. ]]></format>
  9105. </remarks>
  9106. </member>
  9107. <member name="P:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort">
  9108. <summary>Gets or sets a value that indicates whether the bulk copy operation should be aborted.</summary><value>
  9109. <see langword="true" /> if the bulk copy operation should be aborted; otherwise <see langword="false" />.</value><remarks>
  9110. <format type="text/markdown"><![CDATA[
  9111. ## Remarks
  9112. 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.
  9113. 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.
  9114. 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.
  9115. ]]></format>
  9116. </remarks>
  9117. </member>
  9118. <member name="P:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.RowsCopied">
  9119. <summary>Gets a value that returns the number of rows copied during the current bulk copy operation.</summary><value>
  9120. <see langword="int" /> that returns the number of rows copied.</value><remarks>
  9121. <format type="text/markdown"><![CDATA[
  9122. ## Remarks
  9123. The value in the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.RowsCopied%2A> property is reset on each call to any of the `SqlBulkCopy.WriteToServer` methods.
  9124. ]]></format>
  9125. </remarks>
  9126. </member>
  9127. <member name="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventHandler">
  9128. <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>
  9129. </member>
  9130. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs">
  9131. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated" /> event.</summary><remarks>
  9132. <format type="text/markdown"><![CDATA[
  9133. ## Remarks
  9134. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event is raised when an <xref:System.Data.Common.DbDataAdapter.Update%2A> to a row is completed.
  9135. 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:
  9136. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  9137. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  9138. 3. The command executes.
  9139. 4. If the command is set to `FirstReturnedRecord`, and the first returned result is placed in the <xref:System.Data.DataRow>.
  9140. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  9141. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  9142. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  9143. ## Examples
  9144. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  9145. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  9146. Event Arguments: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  9147. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  9148. Event Arguments: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  9149. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  9150. ]]></format>
  9151. </remarks>
  9152. </member>
  9153. <member name="M:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs.#ctor(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  9154. <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>
  9155. </member>
  9156. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs.Command">
  9157. <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>
  9158. </member>
  9159. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventHandler">
  9160. <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>
  9161. <format type="text/markdown"><![CDATA[
  9162. ## Remarks
  9163. 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.
  9164. 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](/dotnet/standard/events/).
  9165. ]]></format>
  9166. </remarks>
  9167. </member>
  9168. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs">
  9169. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating" /> event.</summary><remarks>
  9170. <format type="text/markdown"><![CDATA[
  9171. ## Remarks
  9172. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event is raised before an <xref:System.Data.Common.DbDataAdapter.Update%2A> to a row.
  9173. 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:
  9174. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  9175. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  9176. 3. The command executes.
  9177. 4. If the command is set to `FirstReturnedRecord`, and the first returned result is placed in the <xref:System.Data.DataRow>.
  9178. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  9179. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  9180. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  9181. ## Examples
  9182. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  9183. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  9184. event args: (command=Microsoft.Data.SqlClient.SQLCommand commandType=2 status=0)
  9185. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  9186. event args: (command=Microsoft.Data.SqlClient.SQLCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  9187. [!code-csharp[SqlRowUpdatingEventArgs Example#1](~/../sqlclient/doc/samples/SqlRowUpdatingEventArgs.cs#1)]
  9188. ]]></format>
  9189. </remarks>
  9190. </member>
  9191. <member name="M:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.#ctor(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  9192. <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>
  9193. </member>
  9194. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.BaseCommand">
  9195. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  9196. </member>
  9197. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.Command">
  9198. <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>
  9199. </member>
  9200. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventHandler">
  9201. <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>
  9202. <format type="text/markdown"><![CDATA[
  9203. ## Remarks
  9204. 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.
  9205. 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.
  9206. 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](/dotnet/standard/events/).
  9207. ]]></format>
  9208. </remarks>
  9209. </member>
  9210. <member name="T:Microsoft.Data.SqlClient.SqlTransaction">
  9211. <summary>Represents a Transact-SQL transaction to be made in a SQL Server database. This class cannot be inherited.</summary><remarks>
  9212. <format type="text/markdown"><![CDATA[
  9213. ## Remarks
  9214. 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.
  9215. > [!NOTE]
  9216. > `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.
  9217. 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).
  9218. ## Examples
  9219. 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.
  9220. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  9221. ]]></format>
  9222. </remarks>
  9223. </member>
  9224. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.Connection">
  9225. <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>
  9226. <format type="text/markdown"><![CDATA[
  9227. ## Remarks
  9228. 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>.
  9229. ]]></format>
  9230. </remarks>
  9231. </member>
  9232. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.DbConnection">
  9233. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  9234. </member>
  9235. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.IsolationLevel">
  9236. <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>
  9237. <format type="text/markdown"><![CDATA[
  9238. ## Remarks
  9239. Parallel transactions are not supported. Therefore, the <xref:System.Data.IsolationLevel> applies to the whole transaction.
  9240. For more information on SQL Server isolation levels, see [Transaction Isolation Levels](/sql/t-sql/language-elements/transaction-isolation-levels).
  9241. ]]></format>
  9242. </remarks>
  9243. </member>
  9244. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Commit">
  9245. <summary>Commits the database transaction.</summary><remarks>
  9246. <format type="text/markdown"><![CDATA[
  9247. ## Remarks
  9248. 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).
  9249. > [!NOTE]
  9250. > `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.
  9251. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  9252. ## Examples
  9253. 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.
  9254. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  9255. ]]></format>
  9256. </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.
  9257. -or-
  9258. The connection is broken.</exception>
  9259. </member>
  9260. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Dispose(System.Boolean)">
  9261. <summary>Releases the resources that are held by the object.</summary><remarks>To be added.</remarks>
  9262. </member>
  9263. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Rollback">
  9264. <summary>Rolls back a transaction from a pending state.</summary>
  9265. </member>
  9266. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Rollback(System.String)">
  9267. <summary>Rolls back a transaction from a pending state.</summary><remarks>
  9268. <format type="text/markdown"><![CDATA[
  9269. ## Remarks
  9270. 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)
  9271. ](/sql/t-sql/language-elements/rollback-transaction-transact-sql).
  9272. 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.
  9273. > [!NOTE]
  9274. > `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.
  9275. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  9276. ## Examples
  9277. 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.
  9278. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  9279. ]]></format>
  9280. </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.
  9281. -or-
  9282. The connection is broken.</exception>
  9283. </member>
  9284. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Save(System.String)">
  9285. <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>
  9286. <format type="text/markdown"><![CDATA[
  9287. ## Remarks
  9288. <xref:Microsoft.Data.SqlClient.SqlTransaction.Save%2A> method is equivalent to the Transact-SQL SAVE TRANSACTION statement.
  9289. 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.
  9290. 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.
  9291. ]]></format>
  9292. </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.
  9293. -or-
  9294. The connection is broken.</exception>
  9295. </member>
  9296. <member name="T:Microsoft.Data.SqlClient.SqlRetryingEventArgs">
  9297. <summary>Represents the set of arguments passed to the <see cref="E:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.Retrying" /> event.</summary>
  9298. </member>
  9299. <member name="M:Microsoft.Data.SqlClient.SqlRetryingEventArgs.#ctor(System.Int32,System.TimeSpan,System.Collections.Generic.IList{System.Exception})">
  9300. <param name="retryCount">The current retry attempt count.</param><param name="delay">The delay that indicates how long the current thread will be suspended before the next iteration is invoked.</param><param name="exceptions">The list of exceptions since the first retry that caused the retry logic to re-execute the function.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRetryingEventArgs" /> class.</summary>
  9301. </member>
  9302. <member name="P:Microsoft.Data.SqlClient.SqlRetryingEventArgs.RetryCount">
  9303. <summary>Retry-attempt-number, after the first exception occurrence.</summary><value>
  9304. <see langword="int" /> that returns the number of retry execution attempts; starting from 1.</value>
  9305. </member>
  9306. <member name="P:Microsoft.Data.SqlClient.SqlRetryingEventArgs.Delay">
  9307. <summary>Gets the current waiting time as a <see cref="T:System.TimeSpan" /> object.</summary><value>
  9308. <see cref="T:System.TimeSpan" /> The upcoming gap time before the next execution attempt.</value>
  9309. </member>
  9310. <member name="P:Microsoft.Data.SqlClient.SqlRetryingEventArgs.Cancel">
  9311. <summary>Gets or sets a value that indicates whether the retry logic should be canceled.</summary><value> If set to <see langword="true" />, the execution attempt will be interrupted immediately.</value>
  9312. </member>
  9313. <member name="P:Microsoft.Data.SqlClient.SqlRetryingEventArgs.Exceptions">
  9314. <summary>Gets the list of exceptions since the first attempt failure.</summary><value>List of occurred exceptions.</value>
  9315. </member>
  9316. <member name="T:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator">
  9317. <summary>Generates a sequence of time intervals.</summary>
  9318. </member>
  9319. <member name="P:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.GapTimeInterval">
  9320. <summary>The default gap time of each interval.</summary>
  9321. </member>
  9322. <member name="P:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.MaxTimeInterval">
  9323. <summary>The maximum allowed time interval value.</summary>
  9324. </member>
  9325. <member name="P:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.MinTimeInterval">
  9326. <summary>The minimum allowed time interval value.</summary>
  9327. </member>
  9328. <member name="P:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.Current">
  9329. <summary>Gets the element in the collection at the current position of the enumerator.</summary>
  9330. </member>
  9331. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.#ctor">
  9332. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator" /> class with a default value of zero for the gap time, minimum, and maximum interval time.</summary>
  9333. </member>
  9334. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.#ctor(System.TimeSpan,System.TimeSpan,System.TimeSpan)">
  9335. <param name="timeInterval">The gap time used to calculate the time delay before each attempt.</param><param name="maxTime">The maximum time allowed as a gap time.</param><param name="minTime">The minimum time allowed as a gap time.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator" /> class.</summary><exception cref="T:System.ArgumentOutOfRangeException">The supplied arguments failed <see cref="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.Validate(System.TimeSpan,System.TimeSpan,System.TimeSpan)" /> validation.</exception>
  9336. </member>
  9337. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.Reset">
  9338. <summary>Sets the enumerator to its initial position, which is before the first element in the collection.</summary>
  9339. </member>
  9340. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.Validate(System.TimeSpan,System.TimeSpan,System.TimeSpan)">
  9341. <param name="timeInterval">The gap time of each interval. Must be between 0 and 120 seconds.</param><param name="maxTimeInterval">Maximum time interval value. Must be between 0 and 120 seconds.</param><param name="minTimeInterval">Minimum time interval value. Must be less than maximum time interval and between 0 and 120 seconds.</param><summary>Validate the enumeration parameters.</summary><exception cref="T:System.ArgumentOutOfRangeException">The supplied arguments failed validation.</exception>
  9342. </member>
  9343. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.GetNextInterval">
  9344. <summary>Calculates the next interval time.</summary><returns>Returns the next gap time interval.</returns>
  9345. </member>
  9346. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.MoveNext">
  9347. <summary>Advances the enumerator to the next element of the collection.</summary><returns>Returns <see langword="true" />, if the enumerator was successfully advanced to the next element; <see langword="false" /> if the enumerator has passed the end of the collection.</returns>
  9348. </member>
  9349. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.Dispose">
  9350. <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
  9351. </member>
  9352. <member name="M:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator.Clone">
  9353. <summary>Creates a new object that is a copy of the current instance.</summary><returns>A new object that is a copy of this instance.</returns>
  9354. </member>
  9355. <member name="T:Microsoft.Data.SqlClient.SqlRetryLogicBase">
  9356. <summary>Retrieves the next time interval with respect to the number of retries if a transient condition occurs.</summary>
  9357. </member>
  9358. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicBase.NumberOfTries">
  9359. <summary>Maximum number of retries.</summary><value>
  9360. <see langword="int" /> that returns the maximum number of retry execution attempts that will be attempted after the first failure.</value>
  9361. </member>
  9362. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicBase.Current">
  9363. <summary>Current retry number starting from zero.</summary><value>
  9364. <see langword="int" /> that returns the number of retry execution attempts after the first failure.</value>
  9365. </member>
  9366. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicBase.RetryIntervalEnumerator">
  9367. <summary>The timer interval enumerator.</summary><value>
  9368. <see cref="T:Microsoft.Data.SqlClient.SqlRetryIntervalBaseEnumerator" /> value that indicates an enumerator to generate a sequence of time intervals.</value>
  9369. </member>
  9370. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicBase.TransientPredicate">
  9371. <summary>Delegate to a transient condition predicate. The function that this delegate points to must return a true value when an expected transient exception happens.</summary><value>
  9372. <see cref="T:System.Predicate`1" /> value that delegates to a function that receives a <see cref="T:System.Exception" /> input parameter.</value>
  9373. </member>
  9374. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBase.RetryCondition(System.Object)">
  9375. <param name="sender">The sender object.</param><summary>Pre-retry validation for the sender state.</summary><returns>Returns <see langword="true" /> if the sender is authorized to retry the operation.</returns><remarks>
  9376. <format type="text/markdown"><![CDATA[
  9377. > [IMPORTANT!]
  9378. > Operations that are part of a **Transaction** are not safe to retry without specific knowledge of business logic. Due to this complexity, retry logic should be managed at the application level.
  9379. > [!NOTE]
  9380. > The `RetryCondition` is an extra condition that checks before executing the `TransientPredicate` and the default condition always returns **true**.
  9381. ]]></format>
  9382. </remarks>
  9383. </member>
  9384. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBase.TryNextInterval(System.TimeSpan@)">
  9385. <param name="intervalTime">The interval time that is generated by the `RetryIntervalEnumerator`.</param><summary>Try to get the next interval time by using the enumerator if the counter does not exceed the number of retries.</summary><returns>Returns <see langword="true" /> if the number of retry attempts has not been exceeded; otherwise <see langword="false" />.</returns>
  9386. </member>
  9387. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBase.Reset">
  9388. <summary>Set the counters and enumerator to default values for next use.</summary>
  9389. </member>
  9390. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBase.Clone">
  9391. <summary>Creates a new object that is a copy of the current instance.</summary><returns>When implemented in a derived class, the method is expected to return a new object of the current instance. The default implementation throws NotImplementedException.</returns><exception cref="T:System.NotImplementedException">In all cases.</exception>
  9392. </member>
  9393. <member name="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider">
  9394. <summary>Applies retry logic on an operation through the `Execute` or `ExecuteAsync` function.</summary>
  9395. </member>
  9396. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.Retrying">
  9397. <summary>Occurs before applying the calculated delay time and executing the function on a next attempt.</summary><value>
  9398. <see cref="T:System.EventHandler" /> with event argument of <see cref="T:Microsoft.Data.SqlClient.SqlRetryingEventArgs" /> object can be subscribed.</value><remarks>
  9399. <format type="text/markdown"><![CDATA[
  9400. > [IMPORTAMT!]
  9401. > Don't block execution with a time consuming action when an event occurs. For instance, if you log data to a file, run it in a new thread to avoid blocking the main execution thread.
  9402. ]]>
  9403. </format>
  9404. </remarks>
  9405. </member>
  9406. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.RetryLogic">
  9407. <summary>Defines the retry logic used to decide when to retry based on the encountered exception.</summary><remarks>
  9408. <format type="text/markdown"><![CDATA[
  9409. > [!NOTE]
  9410. > The `RetryLogic` property is assigned at `SqlRetryLogicBaseProvider` creation and its value is used as a template internally. Don't use it to monitor the status of the retry logic during and after execution. Instead, use the <xref=E:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.Retrying> event to collect data about retry executions.
  9411. ]]>
  9412. </format>
  9413. </remarks>
  9414. </member>
  9415. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.Execute``1(System.Object,System.Func{``0})">
  9416. <typeparam name="TResult">The object that the `function` returns when executed.</typeparam><param name="sender">The source of the event.</param><param name="function">The operation to re-execute if a transient condition occurs.</param><summary>Executes a function and applies retry logic, if enabled. **Note:** Exceptions will be reported via an aggregate exception if the execution isn't successful via retry attempts.
  9417. </summary><returns>The return value of the `function` if it runs without exception.</returns><remarks>
  9418. <format type="text/markdown"><![CDATA[
  9419. > [!NOTE]
  9420. > The type of exception depends on the `function`'s internal implementation. But if the exception is due to all retry attempts failing, it will be an <xref:System.AggregateException> that consists of all exceptions that happened during the failed attempts.
  9421. ]]>
  9422. </format>
  9423. </remarks><exception cref="T:System.ArgumentNullException">The `function` parameter can't be `null`.</exception><exception cref="T:System.AggregateException">The collection of exceptions after all retry attempts have failed.</exception>
  9424. </member>
  9425. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.ExecuteAsync``1(System.Object,System.Func{System.Threading.Tasks.Task{``0}},System.Threading.CancellationToken)">
  9426. <typeparam name="TResult">The object that the `function` returns in a Task when executed.</typeparam><param name="sender">The source of the event.</param><param name="function">The operation to re-execute if a transient condition occurs.</param><param name="cancellationToken">The cancellation instruction.</param><summary>Executes a function and applies retry logic, if enabled. The cancellation token can be used to request that the operation be abandoned before the execution attempts are exceeded. **Note:** Exceptions will be reported via the returned Task object, which will contain an aggregate exception if execution fails for all retry attempts.</summary><returns>A task representing the asynchronous operation. The results of the task will be the return value of the `function`, if it runs without exception.</returns><remarks>
  9427. <format type="text/markdown"><![CDATA[
  9428. > [!NOTE]
  9429. > If the exception comes from all retry attempts failing, it will be an <xref:System.AggregateException> that consists of all exceptions from the failed attempts.
  9430. ]]>
  9431. </format>
  9432. </remarks><exception cref="T:System.ArgumentNullException">The `function` parameter can't be `null`.</exception><exception cref="T:System.AggregateException">The collection of exceptions after failed retry attempts.</exception>
  9433. </member>
  9434. <member name="M:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider.ExecuteAsync(System.Object,System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken)">
  9435. <param name="sender">The source of the event.</param><param name="function">The operation to re-execute if a transient condition occurs.</param><param name="cancellationToken">The cancellation instruction.</param><summary>Executes a function and applies retry logic, if enabled. The cancellation token can be used to request that the operation be abandoned before the execution attempts are exceeded. **Note:** Exceptions will be reported via the returned Task object, which will contain an aggregate exception if execution fails for all retry attempts.</summary><returns>A Task or an exception.</returns><remarks>
  9436. <format type="text/markdown"><![CDATA[
  9437. > [!NOTE]
  9438. > If the exception comes from all retry attempts failing, it will be an <xref:System.AggregateException> that consists of all exceptions from the failed attempts.
  9439. ]]>
  9440. </format>
  9441. </remarks><exception cref="T:System.ArgumentNullException">The `function` parameter can't be `null`.</exception><exception cref="T:System.AggregateException">The collection of exceptions after failed retry attempts.</exception>
  9442. </member>
  9443. <member name="T:Microsoft.Data.SqlClient.SqlRetryLogicOption">
  9444. <summary>Provides the retry logic parameters to create an instance of the <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" /> class by using <see cref="T:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory" /> methods.</summary>
  9445. </member>
  9446. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicOption.NumberOfTries">
  9447. <summary>Sets the number of times to try and execute the function.</summary><value>
  9448. <see langword="int" /> between 1 and 60; 1 means to execute one time and if an error is encountered, don't retry.</value>
  9449. </member>
  9450. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicOption.DeltaTime">
  9451. <summary>Sets the gap time interval as a <see cref="T:System.TimeSpan" /> object.</summary><value>
  9452. <see cref="T:System.TimeSpan" /> The upcoming gap time before the next execution attempt; must be between 0 and 120 seconds.</value>
  9453. </member>
  9454. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicOption.MinTimeInterval">
  9455. <summary>Sets the minimum allowed gap time interval as a <see cref="T:System.TimeSpan" /> object.</summary><value>
  9456. <see cref="T:System.TimeSpan" /> The minimum upcoming gap time before the next execution attempt; the default value is **zero** and must be between 0 and 120 seconds.</value>
  9457. </member>
  9458. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicOption.MaxTimeInterval">
  9459. <summary>Sets the allowed maximum gap time interval as a <see cref="T:System.TimeSpan" /> object.</summary><value>
  9460. <see cref="T:System.TimeSpan" /> The maximum upcoming gap time interval before the next execution attempt; must be between 0 and 120 seconds.</value>
  9461. </member>
  9462. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicOption.TransientErrors">
  9463. <summary>Sets the list of transient error numbers on which to retry when they occur.</summary><value>List of <see cref="T:Microsoft.Data.SqlClient.SqlException.Number" />; Set to <see langword="null" /> to use the internal list of exceptions from the <see cref="T:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory" /> object.</value>
  9464. </member>
  9465. <member name="P:Microsoft.Data.SqlClient.SqlRetryLogicOption.AuthorizedSqlCondition">
  9466. <summary>Sets a pre-retry validation function on the <see cref="T:Microsoft.Data.SqlClient.SqlCommand.CommandText" /> to only include specific SQL statements.</summary><value>
  9467. <see cref="T:System.Predicate`1" /> The pre-retry validation delegate function; <see langword="true" /> if the `CommandText` is authorized to retry the operation.</value>
  9468. </member>
  9469. <member name="T:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory">
  9470. <summary>Provides different retry logic providers with a common list of transient errors.</summary><remarks>
  9471. <format type="text/markdown"><![CDATA[
  9472. ## Remarks
  9473. The following table shows the inner transient error list.
  9474. |Error Number|Description|
  9475. |-------------|-----------------|
  9476. |1204|The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.|
  9477. |1205|Transaction (Process ID) was deadlocked on resources with another process and has been chosen as the deadlock victim. Rerun the transaction.|
  9478. |1222|Lock request time out period exceeded.|
  9479. |49918|Cannot process request. Not enough resources to process request.|
  9480. |49919|Cannot process create or update request. Too many create or update operations in progress for subscription "%ld".|
  9481. |49920|Cannot process request. Too many operations in progress for subscription "%ld".|
  9482. |4060|Cannot open database "%.*ls" requested by the login. The login failed.|
  9483. |4221|Login to read-secondary failed due to long wait on 'HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING'. The replica is not available for login because row versions are missing for transactions that were in-flight when the replica was recycled. The issue can be resolved by rolling back or committing the active transactions on the primary replica. Occurrences of this condition can be minimized by avoiding long write transactions on the primary.|
  9484. |40143|The service has encountered an error processing your request. Please try again.|
  9485. |40613|Database '%.*ls' on server '%.*ls' is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of '%.*ls'.|
  9486. |40501|The service is currently busy. Retry the request after 10 seconds. Incident ID: %ls. Code: %d.|
  9487. |40540|The service has encountered an error processing your request. Please try again.|
  9488. |40197|The service has encountered an error processing your request. Please try again. Error code %d.|
  9489. |10929|Resource ID: %d. The %s minimum guarantee is %d, maximum limit is %d and the current usage for the database is %d. However, the server is currently too busy to support requests greater than %d for this database. For more information, see http://go.microsoft.com/fwlink/?LinkId=267637. Otherwise, please try again later.|
  9490. |10928|Resource ID: %d. The %s limit for the database is %d and has been reached. For more information, see http://go.microsoft.com/fwlink/?LinkId=267637.|
  9491. |10060|An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)|
  9492. |10054|The data value for one or more columns overflowed the type used by the provider.|
  9493. |10053|Could not convert the data value due to reasons other than sign mismatch or overflow.|
  9494. |997|A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - Overlapped I/O operation is in progress)|
  9495. |233|A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)|
  9496. ]]>
  9497. </format>
  9498. </remarks>
  9499. </member>
  9500. <member name="M:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateExponentialRetryProvider(Microsoft.Data.SqlClient.SqlRetryLogicOption)">
  9501. <param name="retryLogicOption">An object of <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicOption" /> containing the configuration for the object.</param><summary>Provides an exponential time interval retry logic provider.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" /> object.</returns><remarks>
  9502. <format type="text/markdown"><![CDATA[
  9503. > [!NOTE]
  9504. > The inner enumerator includes randomization to prevent multiple instances of the client from performing subsequent retry attempts at the same time.
  9505. ]]></format>
  9506. </remarks><exception cref="T:System.ArgumentNullException">If the `retryLogicOption` parameter was null.</exception><exception cref="T:System.ArgumentOutOfRangeException">If at least one of the following conditions occurs:
  9507. - `NumberOfTries` is less than 1 or bigger than 60.
  9508. - `DeltaTime` is bigger than 120 seconds.
  9509. - `MinTimeInterval` is bigger than 120 seconds.
  9510. - `MaxTimeInterval` is bigger than 120 seconds.
  9511. - `MinTimeInterval` is not less than `MaxTimeInterval`.
  9512. </exception>
  9513. </member>
  9514. <member name="M:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateIncrementalRetryProvider(Microsoft.Data.SqlClient.SqlRetryLogicOption)">
  9515. <param name="retryLogicOption">An object of <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicOption" /> containing the configuration for the object.</param><summary>Provides an incremental time interval retry logic provider.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" /> object.</returns><remarks>
  9516. <format type="text/markdown"><![CDATA[
  9517. > [!NOTE]
  9518. > The inner enumerator includes randomization to prevent multiple instances of the client from performing subsequent retry attempts at the same time.
  9519. ]]></format>
  9520. </remarks><exception cref="T:System.ArgumentNullException">If the `retryLogicOption` parameter was null.</exception><exception cref="T:System.ArgumentOutOfRangeException">If at least one of the following conditions occurs:
  9521. - `NumberOfTries` is less than 1 or bigger than 60.
  9522. - `DeltaTime` is bigger than 120 seconds.
  9523. - `MinTimeInterval` is bigger than 120 seconds.
  9524. - `MaxTimeInterval` is bigger than 120 seconds.
  9525. - `MinTimeInterval` is not less than `MaxTimeInterval`.
  9526. </exception>
  9527. </member>
  9528. <member name="M:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateFixedRetryProvider(Microsoft.Data.SqlClient.SqlRetryLogicOption)">
  9529. <param name="retryLogicOption">An object of <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicOption" /> containing the configuration for the object.</param><summary>Provides a fixed interval time retry logic provider.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" /> object.</returns><remarks>
  9530. <format type="text/markdown"><![CDATA[
  9531. > [!NOTE]
  9532. > The inner enumerator includes randomization to prevent multiple instances of the client from performing subsequent retry attempts at the same time.
  9533. ]]></format>
  9534. </remarks><exception cref="T:System.ArgumentNullException">If the `retryLogicOption` parameter was null.</exception><exception cref="T:System.ArgumentOutOfRangeException">If at least one of the following conditions occurs:
  9535. - `NumberOfTries` is less than 1 or bigger than 60.
  9536. - `DeltaTime` is bigger than 120 seconds.
  9537. - `MinTimeInterval` is bigger than 120 seconds.
  9538. - `MaxTimeInterval` is bigger than 120 seconds.
  9539. - `MinTimeInterval` is not less than `MaxTimeInterval`.
  9540. </exception>
  9541. </member>
  9542. <member name="M:Microsoft.Data.SqlClient.SqlConfigurableRetryFactory.CreateNoneRetryProvider">
  9543. <summary>Provides a non-retriable provider with a <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBase.TransientPredicate" /> that returns <see langword="false" />.</summary><returns>A <see cref="T:Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider" /> object.</returns><remarks>
  9544. <format type="text/markdown"><![CDATA[
  9545. > [!NOTE]
  9546. > The returned provider of this function performs a single execution without any retry logic.
  9547. ]]>
  9548. </format>
  9549. </remarks>
  9550. </member>
  9551. <member name="T:Microsoft.Data.SqlClient.Server.SqlDataRecord">
  9552. <summary>Represents a single row of data and its metadata.</summary><remarks>
  9553. <format type="text/markdown"><![CDATA[
  9554. ## Remarks
  9555. This class is used together with <xref:Microsoft.SqlServer.Server.SqlPipe> to send result sets to the client from managed code stored-procedures.
  9556. 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.
  9557. ## Examples
  9558. 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.
  9559. [!code-csharp[SqlDataRecord Samples#1](~/../sqlclient/doc/samples/SqlDataRecord.cs#1)]
  9560. ]]></format>
  9561. </remarks>
  9562. </member>
  9563. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.#ctor(Microsoft.Data.SqlClient.Server.SqlMetaData[])">
  9564. <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>
  9565. <format type="text/markdown"><![CDATA[
  9566. ## Examples
  9567. 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.
  9568. [!code-csharp[SqlDataRecord Samples#2](~/../sqlclient/doc/samples/SqlDataRecord.cs#2)]
  9569. ]]></format>
  9570. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="metaData" /> is <see langword="null" />.</exception>
  9571. </member>
  9572. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount">
  9573. <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>
  9574. </member>
  9575. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.Item(System.Int32)">
  9576. <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>
  9577. <format type="text/markdown"><![CDATA[
  9578. ## Remarks
  9579. For columns with null value, <xref:System.DBNull.Value> is returned.
  9580. ]]></format>
  9581. </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>
  9582. </member>
  9583. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.Item(System.String)">
  9584. <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>
  9585. <format type="text/markdown"><![CDATA[
  9586. ## Remarks
  9587. For columns with null value, <xref:System.DBNull.Value> is returned.
  9588. ]]></format>
  9589. </remarks>
  9590. </member>
  9591. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBoolean(System.Int32)">
  9592. <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>
  9593. </member>
  9594. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetByte(System.Int32)">
  9595. <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>
  9596. </member>
  9597. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  9598. <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>
  9599. <format type="text/markdown"><![CDATA[
  9600. ## Remarks
  9601. 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.
  9602. 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.
  9603. ]]></format>
  9604. </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>
  9605. </member>
  9606. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChar(System.Int32)">
  9607. <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>
  9608. </member>
  9609. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  9610. <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>
  9611. <format type="text/markdown"><![CDATA[
  9612. ## Remarks
  9613. 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.
  9614. 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.
  9615. ]]></format>
  9616. </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>
  9617. </member>
  9618. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.System#Data#IDataRecord#GetData(System.Int32)">
  9619. <param name="ordinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  9620. </member>
  9621. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDataTypeName(System.Int32)">
  9622. <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>
  9623. <format type="text/markdown"><![CDATA[
  9624. ## Remarks
  9625. 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.
  9626. ]]></format>
  9627. </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>
  9628. </member>
  9629. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDateTime(System.Int32)">
  9630. <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>
  9631. </member>
  9632. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDateTimeOffset(System.Int32)">
  9633. <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>
  9634. </member>
  9635. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDecimal(System.Int32)">
  9636. <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>
  9637. </member>
  9638. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDouble(System.Int32)">
  9639. <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>
  9640. </member>
  9641. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetFieldType(System.Int32)">
  9642. <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>
  9643. </member>
  9644. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetFloat(System.Int32)">
  9645. <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>
  9646. </member>
  9647. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetGuid(System.Int32)">
  9648. <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>
  9649. </member>
  9650. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt16(System.Int32)">
  9651. <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>
  9652. </member>
  9653. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt32(System.Int32)">
  9654. <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>
  9655. </member>
  9656. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt64(System.Int32)">
  9657. <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>
  9658. </member>
  9659. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetName(System.Int32)">
  9660. <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>
  9661. </member>
  9662. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetOrdinal(System.String)">
  9663. <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">
  9664. <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>
  9665. </member>
  9666. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBinary(System.Int32)">
  9667. <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>
  9668. </member>
  9669. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBoolean(System.Int32)">
  9670. <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>
  9671. </member>
  9672. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlByte(System.Int32)">
  9673. <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>
  9674. </member>
  9675. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBytes(System.Int32)">
  9676. <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>
  9677. </member>
  9678. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlChars(System.Int32)">
  9679. <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>
  9680. </member>
  9681. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDateTime(System.Int32)">
  9682. <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>
  9683. </member>
  9684. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDecimal(System.Int32)">
  9685. <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>
  9686. </member>
  9687. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDouble(System.Int32)">
  9688. <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>
  9689. </member>
  9690. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlFieldType(System.Int32)">
  9691. <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>
  9692. </member>
  9693. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlGuid(System.Int32)">
  9694. <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>
  9695. </member>
  9696. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt16(System.Int32)">
  9697. <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>
  9698. </member>
  9699. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt32(System.Int32)">
  9700. <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>
  9701. </member>
  9702. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt64(System.Int32)">
  9703. <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>
  9704. </member>
  9705. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlMetaData(System.Int32)">
  9706. <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>
  9707. </member>
  9708. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlMoney(System.Int32)">
  9709. <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>
  9710. </member>
  9711. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlSingle(System.Int32)">
  9712. <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>
  9713. </member>
  9714. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlString(System.Int32)">
  9715. <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>
  9716. </member>
  9717. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlValue(System.Int32)">
  9718. <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>
  9719. <format type="text/markdown"><![CDATA[
  9720. ## Remarks
  9721. For null values, a SQL Server type instance is returned where the <xref:System.Data.SqlTypes.INullable.IsNull%2A> property is true.
  9722. ]]></format>
  9723. </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" />
  9724. </member>
  9725. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlValues(System.Object[])">
  9726. <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>
  9727. <format type="text/markdown"><![CDATA[
  9728. ## Remarks
  9729. 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.
  9730. 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.
  9731. ]]></format>
  9732. </remarks><exception cref="T:System.ArgumentNullException">
  9733. <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" />
  9734. </member>
  9735. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlXml(System.Int32)">
  9736. <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>
  9737. </member>
  9738. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetString(System.Int32)">
  9739. <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>
  9740. </member>
  9741. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetTimeSpan(System.Int32)">
  9742. <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>
  9743. </member>
  9744. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetValue(System.Int32)">
  9745. <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>
  9746. <format type="text/markdown"><![CDATA[
  9747. ## Remarks
  9748. For columns with null value, <xref:System.DBNull.Value> is returned.
  9749. ]]></format>
  9750. </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>
  9751. </member>
  9752. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetValues(System.Object[])">
  9753. <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>
  9754. <format type="text/markdown"><![CDATA[
  9755. ## Remarks
  9756. 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.
  9757. 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.
  9758. ]]></format>
  9759. </remarks><exception cref="T:System.ArgumentNullException">
  9760. <paramref name="values" /> is <see langword="null" />.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  9761. </member>
  9762. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.IsDBNull(System.Int32)">
  9763. <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>
  9764. <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>
  9765. </member>
  9766. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetBoolean(System.Int32,System.Boolean)">
  9767. <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>
  9768. </member>
  9769. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetByte(System.Int32,System.Byte)">
  9770. <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>
  9771. </member>
  9772. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  9773. <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>
  9774. </member>
  9775. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetChar(System.Int32,System.Char)">
  9776. <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>
  9777. </member>
  9778. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  9779. <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>
  9780. </member>
  9781. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDateTime(System.Int32,System.DateTime)">
  9782. <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>
  9783. </member>
  9784. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDateTimeOffset(System.Int32,System.DateTimeOffset)">
  9785. <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>
  9786. </member>
  9787. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDBNull(System.Int32)">
  9788. <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>
  9789. </member>
  9790. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDecimal(System.Int32,System.Decimal)">
  9791. <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>
  9792. </member>
  9793. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDouble(System.Int32,System.Double)">
  9794. <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>
  9795. </member>
  9796. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetFloat(System.Int32,System.Single)">
  9797. <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>
  9798. </member>
  9799. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetGuid(System.Int32,System.Guid)">
  9800. <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>
  9801. </member>
  9802. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt16(System.Int32,System.Int16)">
  9803. <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>
  9804. </member>
  9805. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt32(System.Int32,System.Int32)">
  9806. <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>
  9807. </member>
  9808. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt64(System.Int32,System.Int64)">
  9809. <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>
  9810. </member>
  9811. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBinary(System.Int32,System.Data.SqlTypes.SqlBinary)">
  9812. <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>
  9813. </member>
  9814. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBoolean(System.Int32,System.Data.SqlTypes.SqlBoolean)">
  9815. <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>
  9816. </member>
  9817. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlByte(System.Int32,System.Data.SqlTypes.SqlByte)">
  9818. <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>
  9819. </member>
  9820. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBytes(System.Int32,System.Data.SqlTypes.SqlBytes)">
  9821. <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>
  9822. </member>
  9823. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlChars(System.Int32,System.Data.SqlTypes.SqlChars)">
  9824. <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>
  9825. </member>
  9826. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDateTime(System.Int32,System.Data.SqlTypes.SqlDateTime)">
  9827. <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>
  9828. </member>
  9829. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDecimal(System.Int32,System.Data.SqlTypes.SqlDecimal)">
  9830. <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>
  9831. </member>
  9832. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDouble(System.Int32,System.Data.SqlTypes.SqlDouble)">
  9833. <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>
  9834. </member>
  9835. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlGuid(System.Int32,System.Data.SqlTypes.SqlGuid)">
  9836. <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>
  9837. </member>
  9838. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt16(System.Int32,System.Data.SqlTypes.SqlInt16)">
  9839. <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>
  9840. </member>
  9841. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt32(System.Int32,System.Data.SqlTypes.SqlInt32)">
  9842. <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>
  9843. </member>
  9844. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt64(System.Int32,System.Data.SqlTypes.SqlInt64)">
  9845. <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>
  9846. </member>
  9847. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlMoney(System.Int32,System.Data.SqlTypes.SqlMoney)">
  9848. <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>
  9849. </member>
  9850. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlSingle(System.Int32,System.Data.SqlTypes.SqlSingle)">
  9851. <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>
  9852. </member>
  9853. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlString(System.Int32,System.Data.SqlTypes.SqlString)">
  9854. <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>
  9855. </member>
  9856. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlXml(System.Int32,System.Data.SqlTypes.SqlXml)">
  9857. <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>
  9858. </member>
  9859. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetString(System.Int32,System.String)">
  9860. <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>
  9861. </member>
  9862. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetTimeSpan(System.Int32,System.TimeSpan)">
  9863. <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>
  9864. </member>
  9865. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetValue(System.Int32,System.Object)">
  9866. <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>
  9867. <format type="text/markdown"><![CDATA[
  9868. ## Remarks
  9869. `value` is a SQL type boxed as a <xref:System.Object> instance.
  9870. ]]></format>
  9871. </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>
  9872. </member>
  9873. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetValues(System.Object[])">
  9874. <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>
  9875. <format type="text/markdown"><![CDATA[
  9876. ## Remarks
  9877. The length of values must match the number of columns in the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> instance.
  9878. ]]></format>
  9879. </remarks><exception cref="T:System.ArgumentNullException">
  9880. <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>
  9881. </member>
  9882. <member name="T:Microsoft.Data.SqlClient.Server.SqlMetaData">
  9883. <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>
  9884. <format type="text/markdown"><![CDATA[
  9885. ## Examples
  9886. 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.
  9887. [!code-csharp[SqlMetaData Samples#1](~/../sqlclient/doc/samples/SqlMetaData.cs#1)]
  9888. ]]></format>
  9889. </remarks>
  9890. </member>
  9891. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType)">
  9892. <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>
  9893. <format type="text/markdown"><![CDATA[
  9894. ## Remarks
  9895. 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`.
  9896. 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`):
  9897. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9898. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9899. |`Bit`|1|1|0|0|None|
  9900. |`BigInt`|8|19|0|0|None|
  9901. |`DateTime`|8|23|3|0|None|
  9902. |`Decimal`|9|18|0|0|None|
  9903. |`Float`|8|53|0|0|None|
  9904. |`Int`|4|10|0|0|None|
  9905. |`Money`|8|19|4|0|None|
  9906. |`Numeric`|9|18|0|0|None|
  9907. |`SmallDateTime`|4|16|0|0|None|
  9908. |`SmallInt`|2|5|0|0|None|
  9909. |`SmallMoney`|4|10|4|0|None|
  9910. |`TimeStamp`|8|0|0|0|None|
  9911. |`TinyInt`|1|3|0|0|None|
  9912. |`UniqueIdentifier`|16|0|0|0|None|
  9913. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9914. ## Examples
  9915. 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`.
  9916. [!code-csharp[SqlMetaData Samples#3](~/../sqlclient/doc/samples/SqlMetaData.cs#3)]
  9917. ]]></format>
  9918. </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>
  9919. </member>
  9920. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  9921. <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>
  9922. <format type="text/markdown"><![CDATA[
  9923. ## Remarks
  9924. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  9925. ]]></format>
  9926. </remarks>
  9927. </member>
  9928. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Byte,System.Byte)">
  9929. <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>
  9930. <format type="text/markdown"><![CDATA[
  9931. ## Remarks
  9932. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `Decimal`.
  9933. 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`):
  9934. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9935. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9936. |Decimal|9|18|0|0|None|
  9937. ]]></format>
  9938. </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>
  9939. </member>
  9940. <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)">
  9941. <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>
  9942. <format type="text/markdown"><![CDATA[
  9943. ## Remarks
  9944. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  9945. ]]></format>
  9946. </remarks>
  9947. </member>
  9948. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64)">
  9949. <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>
  9950. <format type="text/markdown"><![CDATA[
  9951. ## Remarks
  9952. Only the following are allowed to be passed to the constructor as `dbType`: `Binary`, `Char`, `Image`, `NChar`, `Ntext`, `NVarChar`, `Text`, `VarBinary`, `VarChar`.
  9953. 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`.
  9954. 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.
  9955. 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`):
  9956. |SqlDbType|Precision|Scale|Locale|Compare options|
  9957. |---------------|---------------|-----------|------------|---------------------|
  9958. |Binary|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9959. |Char|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9960. |Image|0|0|0|None|
  9961. |NChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9962. |NText|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9963. |NVarChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9964. |Text|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9965. |VarBinary|0|0||IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9966. |VarChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9967. ## Examples
  9968. 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.
  9969. [!code-csharp[SqlMetaData Samples#2](~/../sqlclient/doc/samples/SqlMetaData.cs#2)]
  9970. ]]></format>
  9971. </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>
  9972. </member>
  9973. <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)">
  9974. <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>
  9975. <format type="text/markdown"><![CDATA[
  9976. ## Remarks
  9977. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  9978. ]]></format>
  9979. </remarks>
  9980. </member>
  9981. <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)">
  9982. <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>
  9983. <format type="text/markdown"><![CDATA[
  9984. ## Remarks
  9985. 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`.
  9986. 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`):
  9987. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  9988. |---------------|--------------------|---------------|-----------|------------|---------------------|
  9989. |`BigInt`|8|19|0|0|None|
  9990. |`Bit`|1|1|0|0|None|
  9991. |`DateTime`|8|23|3|0|None|
  9992. |`Decimal`|9|18|0|0|None|
  9993. |`Float`|8|53|0|0|None|
  9994. |`Image`|Max (-1)|0|0|0|None|
  9995. |`Int`|4|10|0|0|None|
  9996. |`Money`|8|19|4|0|None|
  9997. |`Ntext`|Max (-1)|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  9998. |`Real`|4|24|0|0|None|
  9999. |`Row`|\<number of columns>|0|0|0|None|
  10000. |`SmallDateTime`|4|16|0|0|None|
  10001. |`SmallInt`|2|5|0|0|None|
  10002. |`SmallMoney`|4|10|4|0|None|
  10003. |`Text`|Max (-1)|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  10004. |`TimeStamp`|8|0|0|0|None|
  10005. |`TinyInt`|1|3|0|0|None|
  10006. |`UniqueIdentifier`|16|0|0|0|None|
  10007. |`UDT`|\<Max length of the type> or -1|0|0|0|None|
  10008. |`Variant`|8016|0|0|0|None|
  10009. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  10010. ]]></format>
  10011. </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>
  10012. </member>
  10013. <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)">
  10014. <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>
  10015. <format type="text/markdown"><![CDATA[
  10016. ## Remarks
  10017. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10018. ]]></format>
  10019. </remarks>
  10020. </member>
  10021. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Int64,System.Data.SqlTypes.SqlCompareOptions)">
  10022. <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>
  10023. <format type="text/markdown"><![CDATA[
  10024. ## Remarks
  10025. Only the following are allowed to be passed to the constructor as `dbType`: `Char`, `NChar`, `Ntext`, `NVarChar`, `Text`, `VarChar`.
  10026. Only a `maxLength` specification of <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Max%2A>, or -1, is allowed for a `dbType` of `Text` or `NText`.
  10027. 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.
  10028. 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`):
  10029. |SqlDbType|Precision|Scale|
  10030. |---------------|---------------|-----------|
  10031. |`Char`|0|0|
  10032. |`NChar`|0|0|
  10033. |`NText`|0|0|
  10034. |`NVarChar`|0|0|
  10035. |`Text`|0|0|
  10036. |`VarChar`|0|0|
  10037. ]]></format>
  10038. </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>
  10039. </member>
  10040. <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)">
  10041. <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>
  10042. <format type="text/markdown"><![CDATA[
  10043. ## Remarks
  10044. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10045. ]]></format>
  10046. </remarks>
  10047. </member>
  10048. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.String,System.String,System.String)">
  10049. <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>
  10050. <format type="text/markdown"><![CDATA[
  10051. ## Remarks
  10052. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `Xml`.
  10053. The following are the default values assigned to `dbType`, depending on the `SqlDbType`:
  10054. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  10055. |---------------|--------------------|---------------|-----------|------------|---------------------|
  10056. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  10057. ]]></format>
  10058. </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>
  10059. </member>
  10060. <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)">
  10061. <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>
  10062. <format type="text/markdown"><![CDATA[
  10063. ## Remarks
  10064. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10065. ]]></format>
  10066. </remarks>
  10067. </member>
  10068. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type)">
  10069. <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>
  10070. <format type="text/markdown"><![CDATA[
  10071. ## Remarks
  10072. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `UDT`.
  10073. 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`):
  10074. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  10075. |---------------|--------------------|---------------|-----------|------------|---------------------|
  10076. |UDT|\<Max length of the type> or -1|0|0|0|None|
  10077. ]]></format>
  10078. </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>
  10079. </member>
  10080. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type,System.String)">
  10081. <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>
  10082. </member>
  10083. <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)">
  10084. <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>
  10085. <format type="text/markdown"><![CDATA[
  10086. ## Remarks
  10087. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10088. ]]></format>
  10089. </remarks>
  10090. </member>
  10091. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.CompareOptions">
  10092. <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>
  10093. </member>
  10094. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.DbType">
  10095. <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>
  10096. <format type="text/markdown"><![CDATA[
  10097. ## Remarks
  10098. The default type is <xref:System.Data.DbType>.`String`.
  10099. ]]></format>
  10100. </remarks>
  10101. </member>
  10102. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.IsUniqueKey">
  10103. <summary>Indicates if the column in the table-valued parameter is unique.</summary><value>A <see langword="Boolean" /> value.</value><remarks>
  10104. <format type="text/markdown"><![CDATA[
  10105. ## Remarks
  10106. The default is `FALSE`.
  10107. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  10108. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10109. ]]></format>
  10110. </remarks>
  10111. </member>
  10112. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.LocaleId">
  10113. <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>
  10114. <format type="text/markdown"><![CDATA[
  10115. ## Remarks
  10116. The default value is the current locale of the current thread for string-valued SqlDbTypes, and 0 for SqlDbTypes that do not support collation.
  10117. Returns 0 if the collation of the underlying column type is not defined.
  10118. ]]></format>
  10119. </remarks>
  10120. </member>
  10121. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Max">
  10122. <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>
  10123. <format type="text/markdown"><![CDATA[
  10124. ## Remarks
  10125. The default value is -1.
  10126. ]]></format>
  10127. </remarks>
  10128. </member>
  10129. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.MaxLength">
  10130. <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>
  10131. <format type="text/markdown"><![CDATA[
  10132. ## Remarks
  10133. 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.
  10134. For <xref:System.Data.DbType>.`Row` this returns the number of columns in the row metadata instance.
  10135. The default value is 0.
  10136. ]]></format>
  10137. </remarks>
  10138. </member>
  10139. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Name">
  10140. <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>
  10141. </member>
  10142. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Precision">
  10143. <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>
  10144. <format type="text/markdown"><![CDATA[
  10145. ## Remarks
  10146. Returns 0 if the precision of the underlying column type is not defined.
  10147. ]]></format>
  10148. </remarks>
  10149. </member>
  10150. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Scale">
  10151. <summary>Gets the scale of the column or parameter.</summary><value>The scale of the column or parameter.</value><remarks>
  10152. <format type="text/markdown"><![CDATA[
  10153. ## Remarks
  10154. Returns 0 if the scale of the underlying column type is not defined.
  10155. ]]></format>
  10156. </remarks>
  10157. </member>
  10158. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SortOrder">
  10159. <summary>Returns the sort order for a column.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SortOrder" /> object.</value><remarks>
  10160. <format type="text/markdown"><![CDATA[
  10161. ## Remarks
  10162. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  10163. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10164. ]]></format>
  10165. </remarks>
  10166. </member>
  10167. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SortOrdinal">
  10168. <summary>Returns the ordinal of the sort column.</summary><value>The ordinal of the sort column.</value><remarks>
  10169. <format type="text/markdown"><![CDATA[
  10170. ## Remarks
  10171. The default is 1.
  10172. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  10173. For more information, see [Table-Valued Parameters](/sql/connect/ado-net/sql/table-valued-parameters).
  10174. ]]></format>
  10175. </remarks>
  10176. </member>
  10177. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SqlDbType">
  10178. <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>
  10179. <format type="text/markdown"><![CDATA[
  10180. ## Remarks
  10181. The default value is `NVarChar`.
  10182. ]]></format>
  10183. </remarks>
  10184. </member>
  10185. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Type">
  10186. <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>
  10187. <format type="text/markdown"><![CDATA[
  10188. ## Remarks
  10189. The default value is `null`.
  10190. 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.
  10191. ]]></format>
  10192. </remarks>
  10193. </member>
  10194. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.TypeName">
  10195. <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>
  10196. <format type="text/markdown"><![CDATA[
  10197. ## Remarks
  10198. The default value is `null`.
  10199. ]]></format>
  10200. </remarks>
  10201. </member>
  10202. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.UseServerDefault">
  10203. <summary>Reports whether this column should use the default server value.</summary><value>A <see langword="Boolean" /> value.</value><remarks>
  10204. <format type="text/markdown"><![CDATA[
  10205. ## Remarks
  10206. The default is `FALSE`.
  10207. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  10208. ]]></format>
  10209. </remarks>
  10210. </member>
  10211. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase">
  10212. <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>
  10213. <format type="text/markdown"><![CDATA[
  10214. ## Remarks
  10215. The default value is `null`.
  10216. 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.
  10217. ]]></format>
  10218. </remarks>
  10219. </member>
  10220. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName">
  10221. <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>
  10222. <format type="text/markdown"><![CDATA[
  10223. ## Remarks
  10224. The default value is `null`.
  10225. 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`.
  10226. ]]></format>
  10227. </remarks>
  10228. </member>
  10229. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema">
  10230. <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>
  10231. <format type="text/markdown"><![CDATA[
  10232. ## Remarks
  10233. The default value is `null`.
  10234. 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`.
  10235. ]]></format>
  10236. </remarks>
  10237. </member>
  10238. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Boolean)">
  10239. <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">
  10240. <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>
  10241. </member>
  10242. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Byte)">
  10243. <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">
  10244. <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>
  10245. </member>
  10246. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Byte[])">
  10247. <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">
  10248. <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>
  10249. </member>
  10250. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Char)">
  10251. <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">
  10252. <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>
  10253. </member>
  10254. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Char[])">
  10255. <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">
  10256. <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>
  10257. </member>
  10258. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBinary)">
  10259. <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">
  10260. <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>
  10261. </member>
  10262. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBoolean)">
  10263. <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">
  10264. <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>
  10265. </member>
  10266. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlByte)">
  10267. <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">
  10268. <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>
  10269. </member>
  10270. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBytes)">
  10271. <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">
  10272. <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>
  10273. </member>
  10274. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlChars)">
  10275. <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">
  10276. <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>
  10277. </member>
  10278. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDateTime)">
  10279. <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">
  10280. <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>
  10281. </member>
  10282. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDecimal)">
  10283. <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">
  10284. <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>
  10285. </member>
  10286. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDouble)">
  10287. <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">
  10288. <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>
  10289. </member>
  10290. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlGuid)">
  10291. <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">
  10292. <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>
  10293. </member>
  10294. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt16)">
  10295. <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">
  10296. <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>
  10297. </member>
  10298. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt32)">
  10299. <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">
  10300. <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>
  10301. </member>
  10302. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt64)">
  10303. <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">
  10304. <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>
  10305. </member>
  10306. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlMoney)">
  10307. <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">
  10308. <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>
  10309. </member>
  10310. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlSingle)">
  10311. <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">
  10312. <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>
  10313. </member>
  10314. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlString)">
  10315. <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">
  10316. <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>
  10317. </member>
  10318. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlXml)">
  10319. <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">
  10320. <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>
  10321. </member>
  10322. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.DateTime)">
  10323. <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">
  10324. <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>
  10325. </member>
  10326. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.DateTimeOffset)">
  10327. <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">
  10328. <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>
  10329. </member>
  10330. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Decimal)">
  10331. <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">
  10332. <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>
  10333. </member>
  10334. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Double)">
  10335. <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">
  10336. <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>
  10337. </member>
  10338. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Guid)">
  10339. <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">
  10340. <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>
  10341. </member>
  10342. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int16)">
  10343. <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">
  10344. <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>
  10345. </member>
  10346. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int32)">
  10347. <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">
  10348. <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>
  10349. </member>
  10350. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int64)">
  10351. <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">
  10352. <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>
  10353. </member>
  10354. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Object)">
  10355. <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">
  10356. <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>
  10357. </member>
  10358. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Single)">
  10359. <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">
  10360. <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>
  10361. </member>
  10362. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.String)">
  10363. <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">
  10364. <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>
  10365. </member>
  10366. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.TimeSpan)">
  10367. <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">
  10368. <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>
  10369. </member>
  10370. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.InferFromValue(System.Object,System.String)">
  10371. <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>
  10372. </member>
  10373. <member name="T:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity">
  10374. <summary>Represents the Data Classification Sensitivity Information for columns as configured in Database.</summary>
  10375. </member>
  10376. <member name="M:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity.#ctor(System.Collections.Generic.IList{Microsoft.Data.SqlClient.DataClassification.SensitivityProperty})">
  10377. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity" /> class.</summary><param name="sensitivityProperties">List of sensitivity properties.</param>
  10378. </member>
  10379. <member name="P:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity.SensitivityProperties">
  10380. <summary>Returns the list of sensitivity properties as received from Server for this 'ColumnSensitivity' information</summary><value>List of sensitivity properties.</value>
  10381. </member>
  10382. <member name="T:Microsoft.Data.SqlClient.DataClassification.InformationType">
  10383. <summary>Represents the Data Classification Information Types as received from SQL Server for the active 'SqlDataReader'</summary>
  10384. </member>
  10385. <member name="M:Microsoft.Data.SqlClient.DataClassification.InformationType.#ctor(System.String,System.String)">
  10386. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.InformationType" /> class.</summary><param name="name">Name of Information Type.</param><param name="id">ID of Information Type.</param>
  10387. </member>
  10388. <member name="P:Microsoft.Data.SqlClient.DataClassification.InformationType.Id">
  10389. <summary>Gets the ID for this 'InformationType' object</summary><value>ID of Information Type.</value>
  10390. </member>
  10391. <member name="P:Microsoft.Data.SqlClient.DataClassification.InformationType.Name">
  10392. <summary>Gets the name for this 'InformationType' object</summary><value>Name of Information Type.</value>
  10393. </member>
  10394. <member name="T:Microsoft.Data.SqlClient.DataClassification.Label">
  10395. <summary>Represents the Data Classification Labels as received from SQL Server for the active 'SqlDataReader'</summary>
  10396. </member>
  10397. <member name="M:Microsoft.Data.SqlClient.DataClassification.Label.#ctor(System.String,System.String)">
  10398. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.Label" /> class.</summary><param name="name">Name of label.</param><param name="id">ID of label.</param>
  10399. </member>
  10400. <member name="P:Microsoft.Data.SqlClient.DataClassification.Label.Id">
  10401. <summary>Gets the ID for this 'Label' object</summary><value>ID of label.</value>
  10402. </member>
  10403. <member name="P:Microsoft.Data.SqlClient.DataClassification.Label.Name">
  10404. <summary>Gets the name for this 'Label' object</summary><value>Name of label.</value>
  10405. </member>
  10406. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityRank">
  10407. <summary>
  10408. A relative ranking of the sensitivity of a query or of a column that is part of percolumn data.
  10409. It is an identifier based on a predefined set of values which define sensitivity rank. Used by other services like Advanced Threat Protection to detect anomalies based on their rank.
  10410. </summary>
  10411. </member>
  10412. <member name="F:Microsoft.Data.SqlClient.DataClassification.SensitivityRank.NOT_DEFINED">
  10413. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml" path="docs/members[@name=&quot;SensitivityRank&quot;]/NotDefined/*" />
  10414. </member>
  10415. <member name="F:Microsoft.Data.SqlClient.DataClassification.SensitivityRank.NONE">
  10416. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml" path="docs/members[@name=&quot;SensitivityRank&quot;]/None/*" />
  10417. </member>
  10418. <member name="F:Microsoft.Data.SqlClient.DataClassification.SensitivityRank.LOW">
  10419. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml" path="docs/members[@name=&quot;SensitivityRank&quot;]/Low/*" />
  10420. </member>
  10421. <member name="F:Microsoft.Data.SqlClient.DataClassification.SensitivityRank.MEDIUM">
  10422. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml" path="docs/members[@name=&quot;SensitivityRank&quot;]/Medium/*" />
  10423. </member>
  10424. <member name="F:Microsoft.Data.SqlClient.DataClassification.SensitivityRank.HIGH">
  10425. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml" path="docs/members[@name=&quot;SensitivityRank&quot;]/High/*" />
  10426. </member>
  10427. <member name="F:Microsoft.Data.SqlClient.DataClassification.SensitivityRank.CRITICAL">
  10428. <!-- No matching elements were found for the following include tag --><include file="../../../../doc/snippets/Microsoft.Data.SqlClient.DataClassification/SensitivityRank.xml" path="docs/members[@name=&quot;SensitivityRank&quot;]/Critical/*" />
  10429. </member>
  10430. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification">
  10431. <summary>Provides the functionlity to retrieve Sensitivity Classification data as received from SQL Server for the active 'SqlDataReader'</summary>
  10432. </member>
  10433. <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},Microsoft.Data.SqlClient.DataClassification.SensitivityRank)">
  10434. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification" /> class.</summary><param name="labels">List of labels.</param><param name="informationTypes">List of information types.</param><param name="columnSensitivity">List of column sensitivities.</param><param name="sensitivityRank">Relative sensitivity rank for the query associated with the active 'SqlDataReader'.</param>
  10435. </member>
  10436. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.ColumnSensitivities">
  10437. <summary>Returns the column sensitivity for this 'SensitivityClassification' Object</summary><value>List of column sensitivities.</value>
  10438. </member>
  10439. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.InformationTypes">
  10440. <summary>Returns the information types collection for this 'SensitivityClassification' Object</summary><value>List of information types.</value>
  10441. </member>
  10442. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.Labels">
  10443. <summary>Returns the labels collection for this 'SensitivityClassification' Object</summary><value>List of labels.</value>
  10444. </member>
  10445. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.SensitivityRank">
  10446. <summary>Returns the relative sensitivity rank for the query associated with the active 'SqlDataReader'.</summary><value>Relative sensitivity ranking for this query.</value><remarks>
  10447. <format type="text/markdown">
  10448. <![CDATA[
  10449. ## Remarks
  10450. A relative sensitivity ranking of the query. Available values are as below:
  10451. | Sensitivity Rank | Description |
  10452. | --- | --- |
  10453. | -1 | Not Defined (default) |
  10454. | 0 | None |
  10455. | 10 | Low |
  10456. | 20 | Medium |
  10457. | 30 | High |
  10458. | 40 | Critical |
  10459. ]]>
  10460. </format>
  10461. </remarks>
  10462. </member>
  10463. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty">
  10464. <summary>Represents the Data Classification Sensitivity Information for columns as configured in Database.</summary>
  10465. </member>
  10466. <member name="M:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.#ctor(Microsoft.Data.SqlClient.DataClassification.Label,Microsoft.Data.SqlClient.DataClassification.InformationType,Microsoft.Data.SqlClient.DataClassification.SensitivityRank)">
  10467. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty" /> class.</summary><param name="label">Label for this SensitivityProperty.</param><param name="informationType">Information type for this SensitivityProperty.</param><param name="sensitivityRank">Sensitivity rank for this SensitivityProperty.</param>
  10468. </member>
  10469. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.InformationType">
  10470. <summary>Returns the information type for this 'SensitivityProperty' Object</summary><value>Information type for this SensitivityProperty.</value>
  10471. </member>
  10472. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.Label">
  10473. <summary>Returns the label for this 'SensitivityProperty' Object</summary><value>Label for this SensitivityProperty.</value>
  10474. </member>
  10475. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.SensitivityRank">
  10476. <summary>Returns the sensitivity rank for this 'SensitivityProperty' Object</summary><value>Sensitivity rank for this SensitivityProperty.</value><remarks>
  10477. <format type="text/markdown">
  10478. <![CDATA[
  10479. ## Remarks
  10480. A relative sensitivity ranking of a column that is part of percolumn data. Available values are as below:
  10481. | Sensitivity Rank | Description |
  10482. | --- | --- |
  10483. | -1 | Not Defined (default) |
  10484. | 0 | None |
  10485. | 10 | Low |
  10486. | 20 | Medium |
  10487. | 30 | High |
  10488. | 40 | Critical |
  10489. ]]>
  10490. </format>
  10491. </remarks>
  10492. </member>
  10493. <member name="T:Microsoft.Data.SqlTypes.SqlFileStream">
  10494. <summary>Exposes SQL Server data that is stored with the FILESTREAM column attribute as a sequence of bytes.</summary><remarks>
  10495. <format type="text/markdown"><![CDATA[
  10496. ## Remarks
  10497. 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.
  10498. 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.
  10499. > [!NOTE]
  10500. > 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.
  10501. 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.
  10502. For conceptual documentation and code examples, see [FILESTREAM Data](/sql/connect/ado-net/sql/filestream-data).
  10503. 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.
  10504. ]]></format>
  10505. </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>
  10506. </member>
  10507. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.#ctor(System.String,System.Byte[],System.IO.FileAccess)">
  10508. <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" />.
  10509. When using <see langword="FileAccess.Read" />, the <see langword="SqlFileStream" /> object can be used to read all of the existing data.
  10510. 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.
  10511. 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>
  10512. <format type="text/markdown"><![CDATA[
  10513. ## Remarks
  10514. The following table lists the code access security (CAS) permissions that all callers in the stack must have to use the `SqlFileStream` constructors.
  10515. |File access|Permission|
  10516. |-----------------|----------------|
  10517. |Read|<xref:System.Security.Permissions.FileIOPermissionAccess.Read>|
  10518. |Write|<xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  10519. |ReadWrite|<xref:System.Security.Permissions.FileIOPermissionAccess.Read> and <xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  10520. For more information about CAS, see [Code Access Security and ADO.NET](/dotnet/framework/data/adonet/code-access-security).
  10521. If an exception is thrown, any open transactions should be rolled back. Otherwise, data loss can occur.
  10522. ]]></format>
  10523. </remarks><exception cref="T:System.ArgumentNullException">
  10524. <paramref name="path" /> is a null reference, or <paramref name="transactionContext" /> is null.</exception><exception cref="T:System.ArgumentOutOfRangeException">
  10525. <paramref name="path" /> is an empty string (""), contains only white space, or contains one or more invalid characters.
  10526. <paramref name="path" /> begins with "\\\\.\\", for example "\\\\.\PHYSICALDRIVE0 ".
  10527. The handle returned by the call to NTCreateFile is not of type FILE_TYPE_DISK.
  10528. <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>
  10529. </member>
  10530. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.#ctor(System.String,System.Byte[],System.IO.FileAccess,System.IO.FileOptions,System.Int64)">
  10531. <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" />.
  10532. When using <see langword="FileAccess.Read" />, the <see langword="SqlFileStream" /> object can be used to read all of the existing data.
  10533. 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.
  10534. 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>
  10535. <format type="text/markdown"><![CDATA[
  10536. ## Remarks
  10537. The following table lists the code access security (CAS) permissions that all callers in the stack must have to use the `SqlFileStream` constructors.
  10538. |File access|Permission|
  10539. |-----------------|----------------|
  10540. |Read|<xref:System.Security.Permissions.FileIOPermissionAccess.Read>|
  10541. |Write|<xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  10542. |ReadWrite|<xref:System.Security.Permissions.FileIOPermissionAccess.Read> and <xref:System.Security.Permissions.FileIOPermissionAccess.Write>|
  10543. For more information about CAS, see [Code Access Security and ADO.NET](/dotnet/framework/data/adonet/code-access-security).
  10544. If an exception is thrown, any open transactions should be rolled back. Otherwise, data loss can occur.
  10545. ]]></format>
  10546. </remarks><exception cref="T:System.ArgumentNullException">
  10547. <paramref name="path" /> is a null reference, or <paramref name="transactionContext" /> is null.</exception><exception cref="T:System.ArgumentOutOfRangeException">
  10548. <paramref name="path" /> is an empty string (""), contains only white space, or contains one or more invalid characters.
  10549. <paramref name="path" /> begins with "\\\\.\\", for example "\\\\.\PHYSICALDRIVE0 "
  10550. The handle returned by call to NTCreateFile is not of type FILE_TYPE_DISK.
  10551. <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>
  10552. </member>
  10553. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.Name">
  10554. <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>
  10555. </member>
  10556. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.TransactionContext">
  10557. <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>
  10558. </member>
  10559. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanRead">
  10560. <summary>Gets a value indicating whether the current stream supports reading.</summary><value>
  10561. <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>
  10562. </member>
  10563. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanSeek">
  10564. <summary>Gets a value indicating whether the current stream supports seeking.</summary><value>
  10565. <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>
  10566. </member>
  10567. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanTimeout">
  10568. <summary>Gets a value indicating whether the current stream can time out.</summary><value>
  10569. <see langword="true" /> if the current stream can time out; otherwise, <see langword="false" />.</value><remarks>To be added.</remarks>
  10570. </member>
  10571. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite">
  10572. <summary>Gets a value indicating whether the current stream supports writing.</summary><value>
  10573. <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>
  10574. </member>
  10575. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.Length">
  10576. <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>
  10577. </member>
  10578. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.Position">
  10579. <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>
  10580. </member>
  10581. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.ReadTimeout">
  10582. <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>
  10583. </member>
  10584. <member name="P:Microsoft.Data.SqlTypes.SqlFileStream.WriteTimeout">
  10585. <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>
  10586. </member>
  10587. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Flush">
  10588. <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>
  10589. </member>
  10590. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)">
  10591. <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>
  10592. <format type="text/markdown"><![CDATA[
  10593. ## Remarks
  10594. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports reading.
  10595. ]]></format>
  10596. </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>
  10597. </member>
  10598. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.EndRead(System.IAsyncResult)">
  10599. <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>
  10600. </member>
  10601. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)">
  10602. <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>
  10603. <format type="text/markdown"><![CDATA[
  10604. ## Remarks
  10605. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite%2A> property to determine whether the current instance supports writing.
  10606. ]]></format>
  10607. </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>
  10608. </member>
  10609. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.EndWrite(System.IAsyncResult)">
  10610. <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>
  10611. </member>
  10612. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Seek(System.Int64,System.IO.SeekOrigin)">
  10613. <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>
  10614. </member>
  10615. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.SetLength(System.Int64)">
  10616. <param name="value">The desired length of the current stream in bytes.</param><summary>Sets the length of the current stream.</summary><remarks>
  10617. <format type="text/markdown"><![CDATA[
  10618. ## Remarks
  10619. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports reading.
  10620. ]]></format>
  10621. </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>
  10622. </member>
  10623. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Read(System.Byte[],System.Int32,System.Int32)">
  10624. <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>
  10625. <format type="text/markdown"><![CDATA[
  10626. ## Remarks
  10627. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports writing.
  10628. ]]></format>
  10629. </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>
  10630. </member>
  10631. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.ReadByte">
  10632. <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>
  10633. <format type="text/markdown"><![CDATA[
  10634. ## Remarks
  10635. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanRead%2A> property to determine whether the current instance supports reading.
  10636. ]]></format>
  10637. </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>
  10638. </member>
  10639. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.Write(System.Byte[],System.Int32,System.Int32)">
  10640. <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>
  10641. <format type="text/markdown"><![CDATA[
  10642. ## Remarks
  10643. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite%2A> property to determine whether the current instance supports writing.
  10644. ]]></format>
  10645. </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>
  10646. </member>
  10647. <member name="M:Microsoft.Data.SqlTypes.SqlFileStream.WriteByte(System.Byte)">
  10648. <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>
  10649. <format type="text/markdown"><![CDATA[
  10650. ## Remarks
  10651. Use the <xref:Microsoft.Data.SqlTypes.SqlFileStream.CanWrite%2A> property to determine whether the current instance supports writing.
  10652. ]]></format>
  10653. </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>
  10654. </member>
  10655. </members>
  10656. </doc>