Microsoft.Data.SqlClient.xml 912 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>Microsoft.Data.SqlClient</name>
  5. </assembly>
  6. <members>
  7. <member name="T:Microsoft.Data.OperationAbortedException">
  8. <summary>This exception is thrown when an ongoing operation is aborted by the user.</summary><remarks>
  9. <format type="text/markdown"><![CDATA[
  10. ## Remarks
  11. This exception indicates that an operation has been aborted by the consumer of an API.
  12. For example, if the event handler of the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event sets the **Abort** property to `true` in the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs> object passed to the handler, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method stops sending rows to the server and throws an <xref:Microsoft.Data.OperationAbortedException>.
  13. ]]></format>
  14. </remarks>
  15. </member>
  16. <member name="T:Microsoft.Data.Sql.SqlNotificationRequest">
  17. <summary>Represents a request for notification for a given command.</summary><remarks>
  18. <format type="text/markdown"><![CDATA[
  19. ## Remarks
  20. This class provides low-level access to the query notification services exposed by SQL Server 2005. For most applications the <xref:Microsoft.Data.SqlClient.SqlDependency> class provides a simpler way of using query notifications. However, if you need fine control over when notifications occur, or you need to customize the message data returned as part of a notification, the <xref:Microsoft.Data.Sql.SqlNotificationRequest> class is the one to use.
  21. ]]></format>
  22. </remarks><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  23. </member>
  24. <member name="M:Microsoft.Data.Sql.SqlNotificationRequest.#ctor">
  25. <summary>Creates a new instance of the <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> class with default values.</summary><remarks>
  26. <format type="text/markdown"><![CDATA[
  27. ## Remarks
  28. If the parameterless constructor is used to create a <xref:Microsoft.Data.Sql.SqlNotificationRequest> object, that instance must have its <xref:Microsoft.Data.Sql.SqlNotificationRequest.UserData%2A> and <xref:Microsoft.Data.Sql.SqlNotificationRequest.Options%2A> properties initialized before assigning the object to a <xref:Microsoft.Data.SqlClient.SqlCommand> object's <xref:Microsoft.Data.SqlClient.SqlCommand.Notification%2A> property. The default values used by the constructor are NULL (`Nothing` in Visual Basic) for the <xref:Microsoft.Data.Sql.SqlNotificationRequest.UserData%2A>, an empty string for the <xref:Microsoft.Data.Sql.SqlNotificationRequest.Options%2A>, and zero for the <xref:Microsoft.Data.Sql.SqlNotificationRequest.Timeout%2A>.
  29. ]]></format>
  30. </remarks><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  31. </member>
  32. <member name="M:Microsoft.Data.Sql.SqlNotificationRequest.#ctor(System.String,System.String,System.Int32)">
  33. <param name="userData">A string that contains an application-specific identifier for this notification. It is not used by the notifications infrastructure, but it allows you to associate notifications with the application state. The value indicated in this parameter is included in the Service Broker queue message.</param><param name="options">A string that contains the Service Broker service name where notification messages are posted, and it must include a database name or a Service Broker instance GUID that restricts the scope of the service name lookup to a particular database. For more information about the format of the <paramref name="options" /> parameter, see <see cref="P:Microsoft.Data.Sql.SqlNotificationRequest.Options" />.</param><param name="timeout">The time, in seconds, to wait for a notification message.</param><summary>Creates a new instance of the <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" /> class with a user-defined string that identifies a particular notification request, the name of a predefined SQL Server 2005 Service Broker service name, and the time-out period, measured in seconds.</summary><remarks>
  34. <format type="text/markdown"><![CDATA[
  35. ## Remarks
  36. This constructor allows you to initialize a new <xref:Microsoft.Data.Sql.SqlNotificationRequest> instance, providing your own identifier, the SQL Server 2005 Service Broker service name, and a time-out value.
  37. ]]></format>
  38. </remarks><exception cref="T:System.ArgumentNullException">The value of the <paramref name="options" /> parameter is NULL.</exception><exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="options" /> or <paramref name="userData" /> parameter is longer than <see langword="uint16.MaxValue" /> or the value in the <paramref name="timeout" /> parameter is less than zero.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  39. </member>
  40. <member name="P:Microsoft.Data.Sql.SqlNotificationRequest.Options">
  41. <summary>Gets or sets the SQL Server Service Broker service name where notification messages are posted.</summary><value>
  42. <see langword="string" /> that contains the SQL Server 2005 Service Broker service name where notification messages are posted and the database or service broker instance GUID to scope the server name lookup.</value><remarks>
  43. <format type="text/markdown"><![CDATA[
  44. ## Remarks
  45. The value of the <xref:Microsoft.Data.Sql.SqlNotificationRequest.Options%2A> property has the following format:
  46. `service=<service-name>{;(local database=<database>|broker instance=<broker instance>)}`
  47. For example, if you use the service "myservice" in the database "AdventureWorks" the format is:
  48. `service=myservice;local database=AdventureWorks`
  49. The SQL Server Service Broker service must be previously configured on the server. In addition, a Service Broker service and queue must be defined and security access granted as needed. See the SQL Server 2005 documentation for more information.
  50. ]]></format>
  51. </remarks><exception cref="T:System.ArgumentNullException">The value is NULL.</exception><exception cref="T:System.ArgumentException">The value is longer than <see langword="uint16.MaxValue" />.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  52. </member>
  53. <member name="P:Microsoft.Data.Sql.SqlNotificationRequest.Timeout">
  54. <summary>Gets or sets a value that specifies how long SQL Server waits for a change to occur before the operation times out.</summary><value>A signed integer value that specifies, in seconds, how long SQL Server waits for a change to occur before the operation times out.</value><remarks>
  55. <format type="text/markdown"><![CDATA[
  56. ## Remarks
  57. After the time-out period expires, the notification is sent even if no change takes place. The <xref:Microsoft.Data.Sql.SqlNotificationRequest.Timeout%2A> property defaults to the value set on the server.
  58. ]]></format>
  59. </remarks><exception cref="T:System.ArgumentOutOfRangeException">The value is less than zero.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  60. </member>
  61. <member name="P:Microsoft.Data.Sql.SqlNotificationRequest.UserData">
  62. <summary>Gets or sets an application-specific identifier for this notification.</summary><value>A <see langword="string" /> value of the application-specific identifier for this notification.</value><remarks>
  63. <format type="text/markdown"><![CDATA[
  64. ## Remarks
  65. This value is not used by the notifications infrastructure. Instead, it is a mechanism that allows an application to associate notifications with application state. The value specified in the <xref:Microsoft.Data.Sql.SqlNotificationRequest.UserData%2A> property is included in the SQL Server 2005 queue message.
  66. ]]></format>
  67. </remarks><exception cref="T:System.ArgumentException">The value is longer than <see langword="uint16.MaxValue" />.</exception><related type="Article" href="~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md">Using Query Notifications</related>
  68. </member>
  69. <member name="T:Microsoft.Data.SqlClient.ApplicationIntent">
  70. <summary>
  71. Specifies a value for <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationIntent" />. Possible values are <see langword="ReadWrite" /> and <see langword="ReadOnly" />.
  72. </summary><remarks>To be added.</remarks>
  73. </member>
  74. <member name="F:Microsoft.Data.SqlClient.ApplicationIntent.ReadOnly">
  75. <summary>The application workload type when connecting to a server is read only.</summary><returns>1</returns><value>1</value>
  76. </member>
  77. <member name="F:Microsoft.Data.SqlClient.ApplicationIntent.ReadWrite">
  78. <summary>The application workload type when connecting to a server is read write.</summary><returns>0</returns><value>0</value>
  79. </member>
  80. <member name="T:Microsoft.Data.SqlClient.OnChangeEventHandler">
  81. <OnChangeEventHandler>
  82. <param name="sender">The source of the event.</param>
  83. <param name="e">A <see cref="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs" /> object that contains the event data.</param>
  84. <summary>Handles the <see cref="E:Microsoft.Data.SqlClient.SqlDependency.OnChange" /> event that is fired when a notification is received for any of the commands associated with a <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> object.</summary>
  85. <remarks>
  86. <format type="text/markdown"><![CDATA[
  87. ## Remarks
  88. The <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange>.
  89. ]]></format>
  90. </remarks>
  91. </OnChangeEventHandler>
  92. </member>
  93. <member name="T:Microsoft.Data.SqlClient.SortOrder">
  94. <summary>
  95. Specifies how rows of data are sorted.
  96. </summary><remarks>To be added.</remarks>
  97. </member>
  98. <member name="F:Microsoft.Data.SqlClient.SortOrder.Unspecified">
  99. <summary>The default. No sort order is specified.</summary><value>-1</value><returns>-1</returns>
  100. </member>
  101. <member name="F:Microsoft.Data.SqlClient.SortOrder.Ascending">
  102. <summary>Rows are sorted in ascending order.</summary><value>0</value><returns>0</returns>
  103. </member>
  104. <member name="F:Microsoft.Data.SqlClient.SortOrder.Descending">
  105. <summary>Rows are sorted in descending order.</summary><value>1</value><returns>1</returns>
  106. </member>
  107. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer">
  108. <summary>Called from constructors in derived classes to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer" /> class.</summary><remarks>To be added.</remarks>
  109. </member>
  110. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.#ctor">
  111. <summary>Default Constructor to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationInitializer" /> class.</summary>
  112. </member>
  113. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationInitializer.Initialize">
  114. <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>
  115. </member>
  116. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationMethod">
  117. <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>.
  118. </summary><remarks>To be added.</remarks>
  119. </member>
  120. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryIntegrated">
  121. <summary>The authentication method uses Active Directory Integrated. Use Active Directory Integrated to connect to a SQL Database using integrated Windows authentication. Available for .NET Framework applications only.</summary><value>3</value>
  122. </member>
  123. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryInteractive">
  124. <summary>The authentication method uses Active Directory Interactive. Available since the .NET Framework 4.7.2 and for .NET Framework applications only.</summary><value>4</value>
  125. </member>
  126. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.ActiveDirectoryPassword">
  127. <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>
  128. </member>
  129. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.NotSpecified">
  130. <summary>The authentication method is not specified.</summary><value>0</value>
  131. </member>
  132. <member name="F:Microsoft.Data.SqlClient.SqlAuthenticationMethod.SqlPassword">
  133. <summary>The authentication method is Sql Password.</summary><value>1</value>
  134. </member>
  135. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationParameters">
  136. <summary>Represents AD authentication parameters passed by a driver to authentication providers.</summary>
  137. </member>
  138. <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)">
  139. <param name="authenticationMethod">One of the enumeration values that specifies the authentication method.</param><param name="serverName">The server name.</param><param name="databaseName">The database name.</param><param name="resource">The resource URI.</param><param name="authority">The authority URI.</param><param name="userId">The user login name/ID.</param><param name="password">The user password.</param><param name="connectionId">The connection ID.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationParameters" />
  140. class using the specified authentication method, server name, database name, resource URI, authority URI, user login name/ID, user password and connection ID.</summary>
  141. </member>
  142. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.AuthenticationMethod">
  143. <summary>Gets the authentication method.</summary><value>The authentication method.</value>
  144. </member>
  145. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Authority">
  146. <summary>Gets the authority URI.</summary><value>The authority URI.</value>
  147. </member>
  148. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ConnectionId">
  149. <summary>Gets the connection ID.</summary><value>The connection ID.</value>
  150. </member>
  151. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.DatabaseName">
  152. <summary>Gets the database name.</summary><value>The database name.</value>
  153. </member>
  154. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Password">
  155. <summary>Gets the user password.</summary><value>The user password.</value>
  156. </member>
  157. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.Resource">
  158. <summary>The resource URIs.</summary><value>The resource URI.</value>
  159. </member>
  160. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.ServerName">
  161. <summary>Gets the server name.</summary><value>The server name.</value>
  162. </member>
  163. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationParameters.UserId">
  164. <summary>Gets the user login name/ID.</summary><value>The user login name/ID.</value>
  165. </member>
  166. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider">
  167. <summary>Defines the core behavior of authentication providers and provides a base class for derived classes. </summary><remarks>Derived classes must provide a parameterless constructor if they can be instantiated from the app.config file.</remarks>
  168. </member>
  169. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.#ctor">
  170. <summary>Called from constructors in derived classes to initialize the <see cref="T:Microsoft.Data.SqlClient.SqlAuthenticationProvider" /> class.</summary>
  171. </member>
  172. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.AcquireTokenAsync(Microsoft.Data.SqlClient.SqlAuthenticationParameters)">
  173. <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>
  174. </member>
  175. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.BeforeLoad(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  176. <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>
  177. </member>
  178. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.BeforeUnload(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  179. <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>
  180. </member>
  181. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.GetProvider(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  182. <param name="authenticationMethod">The authentication method.</param><summary>Gets an authentication provider by method.</summary><returns>The authentication provider or <see langword="null" /> if not found.</returns><remarks>To be added.</remarks>
  183. </member>
  184. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.IsSupported(Microsoft.Data.SqlClient.SqlAuthenticationMethod)">
  185. <param name="authenticationMethod">The authentication method.</param><summary>Indicates whether the specified authentication method is supported.</summary><returns>
  186. <see langword="true" /> if the specified authentication method is supported; otherwise, <see langword="false" />.</returns><remarks>To be added.</remarks>
  187. </member>
  188. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationProvider.SetProvider(Microsoft.Data.SqlClient.SqlAuthenticationMethod,Microsoft.Data.SqlClient.SqlAuthenticationProvider)">
  189. <param name="authenticationMethod">The authentication method.</param><param name="provider">The authentication provider.</param><summary>Sets an authentication provider by method.</summary><returns>
  190. <see langword="true" /> if the operation succeeded; otherwise, <see langword="false" /> (for example, the existing provider disallows overriding).
  191. </returns><remarks>To be added.</remarks>
  192. </member>
  193. <member name="T:Microsoft.Data.SqlClient.SqlAuthenticationToken">
  194. <summary>Represents an AD authentication token.</summary>
  195. </member>
  196. <member name="M:Microsoft.Data.SqlClient.SqlAuthenticationToken.#ctor(System.String,System.DateTimeOffset)">
  197. <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>
  198. </member>
  199. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationToken.AccessToken">
  200. <summary>Gets the token string.</summary><value>The token string.</value>
  201. </member>
  202. <member name="P:Microsoft.Data.SqlClient.SqlAuthenticationToken.ExpiresOn">
  203. <summary>Gets the token expiration time.</summary><value>The token expiration time.</value>
  204. </member>
  205. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopy">
  206. <summary>
  207. Lets you efficiently bulk load a SQL Server table with data from another source.
  208. </summary><remarks>
  209. <format ttype="text/markdown"><![CDATA[
  210. ## Remarks
  211. Microsoft SQL Server includes a popular command-prompt utility named **bcp** for moving data from one table to another, whether on a single server or between servers. The <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> class lets you write managed code solutions that provide similar functionality. There are other ways to load data into a SQL Server table (INSERT statements, for example), but <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> offers a significant performance advantage over them. The <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> class can be used to write data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a <see cref="System.Data.DataTable"/> instance or read with a <see cref="System.Data.IDataReader"/> instance. <see cref="Microsoft.Data.SqlClient.SqlBulkCopy"/> will fail when bulk loading a <see cref="System.Data.DataTable"/> column of type <see cref="System.Data.SqlTypes.SqlDateTime"/> into a SQL Server column whose type is one of the date/time types added in SQL Server 2008.
  212. ## Examples
  213. The following console application demonstrates how to load data using the <xref=Microsoft.Data.SqlClient.SqlBulkCopy> class.
  214. 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.
  215. > [!IMPORTANT]
  216. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  217. 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,
  218. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  219. [!code-csharp[BulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  220. ]]></format>
  221. </remarks>
  222. </member>
  223. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)">
  224. <param name="connection">
  225. The already open
  226. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  227. instance that will be used to perform the bulk copy operation. If your connection string does not use
  228. <see langword="Integrated Security = true" />
  229. , you can use
  230. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  231. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  232. </param><summary>
  233. Initializes a new instance of the
  234. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  235. class using the specified open instance of
  236. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  237. .
  238. </summary><remarks>
  239. <format type="text/markdown"><![CDATA[
  240. ## Remarks
  241. 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.
  242. If the `connection` argument is null, an <xref:System.ArgumentNullException> is thrown.
  243. ## Examples
  244. 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>
  245. 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
  246. purposes only. You would not use `SqlBulkCopy` to move data from one table to another in the same database in a production application.
  247. 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
  248. <xref:System.Data.DataTable>.
  249. > [!IMPORTANT]
  250. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  251. 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
  252. Transact-SQL `INSERT … SELECT` statement to copy the data.
  253. [!code-csharp[BulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  254. ]]></format>
  255. </remarks>
  256. </member>
  257. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)">
  258. <param name="connection">
  259. The already open
  260. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  261. instance that will be used to perform the bulk copy. If your connection string does not use
  262. <see langword="Integrated Security = true" />
  263. , you can use
  264. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  265. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  266. </param><param name="copyOptions">
  267. A combination of values from the
  268. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions" />
  269. enumeration that determines which data source rows are copied to the destination table.
  270. </param><param name="externalTransaction">
  271. An existing
  272. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  273. instance under which the bulk copy will occur.
  274. </param><summary>
  275. Initializes a new instance of the
  276. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  277. class using the supplied existing open instance of
  278. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  279. . The
  280. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  281. instance behaves according to options supplied in the
  282. <paramref name="copyOptions" />
  283. parameter. If a non-null
  284. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  285. is supplied, the copy operations will be performed within that transaction.
  286. </summary><remarks>
  287. <format type="text/markdown"><![CDATA[
  288. ## Remarks
  289. If options include `UseInternalTransaction` and the `externalTransaction` argument is not null, an **InvalidArgumentException** is thrown.
  290. For examples demonstrating how to use `SqlBulkCopy` in a transaction, see [Transaction and Bulk Copy Operations](~/docs/framework/data/adonet/sql/transaction-and-bulk-copy-operations.md).
  291. ]]></format>
  292. </remarks><related type="Article" href="https://msdn.microsoft.com/library/83a7a0d2-8018-4354-97b9-0b1d99f8342b">
  293. Performing Bulk Copy Operations
  294. </related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">
  295. ADO.NET Overview
  296. </related>
  297. </member>
  298. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(System.String)">
  299. <param name="connectionString">
  300. The string defining the connection that will be opened for use by the
  301. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  302. instance.
  303. If your connection string does not use
  304. <see langword="Integrated Security = true" />
  305. , you can use
  306. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)" />
  307. or
  308. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)" />
  309. and
  310. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  311. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  312. </param><summary>
  313. Initializes and opens a new instance of
  314. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  315. based on the supplied
  316. <paramref name="connectionString" />
  317. . The constructor uses the
  318. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  319. to initialize a new instance of the
  320. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  321. class.
  322. </summary><remarks>
  323. <format type="text/markdown"><![CDATA[
  324. ## Remarks
  325. The connection is automatically closed at the end of the bulk copy operation.
  326. If `connectionString` is null, an <xref:System.ArgumentNullException> is thrown. If `connectionString` is an empty string, an <xref:System.ArgumentException> is thrown.
  327. ## Examples
  328. The following console application demonstrates how to bulk load data by using a connection specified as a string. The connection is automatically
  329. closed when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance is closed.
  330. In this example, the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  331. 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>.
  332. > [!IMPORTANT]
  333. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  334. 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,
  335. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  336. [!code-csharp[SqlBulkCopy.ConnectionString#1](~/../sqlclient/doc/samples/SqlBulkCopy_ConnectionString.cs#1)]
  337. ]]></format>
  338. </remarks><exception cref="T:System.ArgumentException">
  339. If `connectionString` is an empty string, an
  340. <see cref="T:System.ArgumentException" />
  341. is thrown.
  342. </exception>
  343. </member>
  344. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(System.String,Microsoft.Data.SqlClient.SqlBulkCopyOptions)">
  345. <param name="connectionString">
  346. The string defining the connection that will be opened for use by the
  347. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  348. instance. If your connection string does not use
  349. <see langword="Integrated Security = true" />
  350. , you can use
  351. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection)" />
  352. or
  353. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.#ctor(Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlBulkCopyOptions,Microsoft.Data.SqlClient.SqlTransaction)" />
  354. and
  355. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" />
  356. to pass the user ID and password more securely than by specifying the user ID and password as text in the connection string.
  357. </param><param name="copyOptions">
  358. A combination of values from the
  359. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions" />
  360. enumeration that determines which data source rows are copied to the destination table.
  361. </param><summary>
  362. Initializes and opens a new instance of
  363. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  364. based on the supplied
  365. <paramref name="connectionString" />
  366. . The constructor uses that
  367. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  368. to initialize a new instance of the
  369. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  370. class. The
  371. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  372. instance behaves according to options supplied in the
  373. <paramref name="copyOptions" />
  374. parameter.
  375. </summary><remarks>
  376. <format type="text/markdown"><![CDATA[
  377. ## remarks
  378. You can obtain detailed information about all the bulk copy options in the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions> topic.
  379. ## Examples
  380. The following console application demonstrates how to perform a bulk load by using a connection specified as a string.
  381. 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,
  382. the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  383. 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.
  384. 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.
  385. 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.
  386. 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
  387. added because of primary key constraint violations.
  388. > [!IMPORTANT]
  389. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to
  390. 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
  391. to copy the data.
  392. [!code-csharp[SqlBulkCopy.KeepIdentity#1](~/../sqlclient/doc/samples/SqlBulkCopy_KeepIdentity.cs#1)]
  393. ]]></format>
  394. </remarks>
  395. </member>
  396. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize">
  397. <summary>
  398. Number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server.
  399. </summary><value>
  400. The integer value of the
  401. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize" />
  402. property, or zero if no value has been set.
  403. </value><remarks>
  404. <format type="text/markdown"><![CDATA[
  405. ## Remarks
  406. 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.
  407. Zero (the default) indicates that each <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is a single batch.
  408. If the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance has been declared without the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction> option in effect,
  409. rows are sent to the server <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> rows at a time, but no transaction-related action is taken.
  410. If <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction> is in effect, each batch of rows is inserted as a separate transaction.
  411. 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.
  412. 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>
  413. operation is already in progress, that operation loads the data as a single batch. Any subsequent <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A>
  414. operations on the same <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance use the new <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize>.
  415. ## Examples
  416. 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>
  417. works with a transaction, see [Transaction and Bulk Copy Operations](~/docs/framework/data/adonet/sql/transaction-and-bulk-copy-operations.md).
  418. > [!IMPORTANT]
  419. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  420. 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,
  421. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  422. [!code-csharp[SqlBulkCopy.BatchSize#1](~/../sqlclient/doc/samples/SqlBulkCopy_BatchSize.cs#1)]
  423. ]]></format>
  424. </remarks>
  425. </member>
  426. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.BulkCopyTimeout">
  427. <summary>
  428. Number of seconds for the operation to complete before it times out.
  429. </summary><value>
  430. The integer value of the
  431. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.BulkCopyTimeout" />
  432. property. The default is 30 seconds. A value of 0 indicates no limit; the bulk copy will wait indefinitely.
  433. </value><remarks>
  434. <format type="text/markdown"><![CDATA[
  435. ## Remarks
  436. If the operation does time out, the transaction is not committed and all copied rows are removed from the destination table.
  437. ## Examples
  438. The following console application demonstrates how to modify the time-out to 60 seconds when bulk loading data.
  439. In this example, the source data is first read from a SQL Server table to a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance.
  440. 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
  441. <xref:System.Data.DataTable>.
  442. > [!IMPORTANT]
  443. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  444. 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
  445. Transact-SQL `INSERT … SELECT` statement to copy the data.
  446. [!code-csharp[SqlBulkCopy.Timeout#1](~/../sqlclient/doc/samples/SqlBulkCopy_Timeout.cs#1)]
  447. ]]></format>
  448. </remarks>
  449. </member>
  450. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.EnableStreaming">
  451. <summary>
  452. Enables or disables a
  453. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  454. object to stream data from an
  455. <see cref="T:System.Data.IDataReader" />
  456. object
  457. </summary><value>
  458. <see langword="true" />
  459. if a
  460. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  461. object can stream data from an
  462. <see cref="T:System.Data.IDataReader" />
  463. object; otherwise, false. The default is
  464. <see langword="false" />
  465. .
  466. </value><remarks>
  467. <format type="text/markdown"><![CDATA[
  468. 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>,
  469. 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
  470. <xref:System.Data.IDataReader> object into memory before sending it to SQL Server or SQL Azure.
  471. ]]></format>
  472. </remarks>
  473. </member>
  474. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings">
  475. <summary>
  476. Returns a collection of
  477. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  478. items. Column mappings define the relationships between columns in the data source and columns in the destination.
  479. </summary><value>
  480. A collection of column mappings. By default, it is an empty collection.
  481. </value><remarks>
  482. <format type="text/markdown"><![CDATA[
  483. 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
  484. the corresponding destination column, the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection is unnecessary. However, if the column counts differ,
  485. 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.
  486. 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>.
  487. ]]></format>
  488. </remarks>
  489. </member>
  490. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName">
  491. <summary>
  492. Name of the destination table on the server.
  493. </summary><value>
  494. The string value of the
  495. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  496. property, or null if none as been supplied.
  497. </value><remarks>
  498. <format type="text/markdown"><![CDATA[
  499. ## Remarks
  500. 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>
  501. is thrown. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName> is modified while a <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is running,
  502. 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.
  503. <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.
  504. 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>]`).
  505. 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.
  506. ## Examples
  507. 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.
  508. 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
  509. 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>.
  510. > [!IMPORTANT]
  511. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  512. 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,
  513. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  514. [!code-csharp[SqlBulkCopy.Single#1](~/../sqlclient/doc/samples/SqlBulkCopy_Single.cs#1)]
  515. ]]></format>
  516. </remarks>
  517. </member>
  518. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter">
  519. <summary>
  520. Defines the number of rows to be processed before generating a notification event.
  521. </summary><value>
  522. The integer value of the
  523. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter" />
  524. property, or zero if the property has not been set.
  525. </value><remarks>
  526. <format type="text/markdown"><![CDATA[
  527. ## Remarks
  528. 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.
  529. 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
  530. the next notification. The new setting applies to all subsequent operations on the same instance.
  531. If <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> is set to a number less than zero, an <xref:System.ArgumentOutOfRangeException> is thrown.
  532. ## Examples
  533. 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
  534. the event handler is called after every 50 rows copied to the table.
  535. 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.
  536. 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>.
  537. > [!IMPORTANT]
  538. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to
  539. 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`
  540. statement to copy the data.
  541. [!code-csharp[SqlBulkCopy.NotifyAfter#1](~/../sqlclient/doc/samples/SqlBulkCopy_NotifyAfter.cs#1)]
  542. ]]></format>
  543. </remarks>
  544. </member>
  545. <member name="E:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied">
  546. <summary>
  547. Occurs every time that the number of rows specified by the
  548. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter" />
  549. property have been processed.
  550. </summary><remarks>
  551. <format type="text/markdown"><![CDATA[
  552. ## Remarks
  553. Note that the settings of <xref:Microsoft.Data.SqlClient.SqlBulkCopy.NotifyAfter> and <xref:Microsoft.Data.SqlClient.SqlBulkCopy.BatchSize> are independent. Receipt of a
  554. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event does not imply that any rows have been sent to the server or committed.
  555. You cannot call SqlBulkCopy.Close (<xref:Microsoft.Data.SqlClient.SqlBulkCopy.Close>) or SqlConnection.Close (<xref:Microsoft.Data.SqlClient.SqlConnection.Close>) from this event.
  556. 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
  557. operation from the event, the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort> property of the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs> can be used.
  558. (See [Transaction and Bulk Copy Operations](~/docs/framework/data/adonet/sql/transaction-and-bulk-copy-operations.md) for examples that use the
  559. <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort> property.)
  560. 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
  561. during the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.SqlRowsCopied> event. However, you can open a different connection.
  562. ## Examples
  563. 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
  564. the event handler is called after every 50 rows copied to the table.
  565. 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
  566. 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>.
  567. > [!IMPORTANT]
  568. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  569. 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
  570. and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  571. [!code-csharp[SqlBulkCopy.NotifyAfter#1](~/../sqlclient/doc/samples/SqlBulkCopy_NotifyAfter.cs#1)]
  572. ]]></format>
  573. </remarks>
  574. </member>
  575. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.Close">
  576. <summary>
  577. Closes the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" /> instance.
  578. </summary><remarks>
  579. <format type="text/markdown"><![CDATA[
  580. ## Remarks
  581. 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>.
  582. 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.
  583. Note that open <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instances are closed implicitly at the end of a `using` block.
  584. ## Examples
  585. 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.
  586. > [!IMPORTANT]
  587. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  588. [!code-csharp[SqlBulkCopy.OrdersDetails#1](~/../sqlclient/doc/samples/SqlBulkCopy_OrdersDetails.cs#1)]
  589. ]]></format>
  590. </remarks>
  591. </member>
  592. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.System#IDisposable#Dispose">
  593. <summary>
  594. Releases all resources used by the current instance of the
  595. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  596. class.
  597. </summary><remarks>
  598. <format type="text/markdown"><![CDATA[
  599. 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.
  600. 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
  601. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> was occupying.
  602. For more information, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and
  603. [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
  604. > [!NOTE]
  605. > 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
  606. the <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object's `Finalize` method.
  607. ]]></format>
  608. </remarks>
  609. </member>
  610. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.Common.DbDataReader)">
  611. <param name="reader">
  612. A
  613. <see cref="T:System.Data.Common.DbDataReader" />
  614. whose rows will be copied to the destination table.
  615. </param><summary>
  616. Copies all rows from the supplied
  617. <see cref="T:System.Data.Common.DbDataReader" />
  618. array to a destination table specified by the
  619. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  620. property of the
  621. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  622. object.
  623. </summary><remarks>
  624. To be added.
  625. </remarks>
  626. </member>
  627. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)">
  628. <param name="table">
  629. A
  630. <see cref="T:System.Data.DataTable" />
  631. whose rows will be copied to the destination table.
  632. </param><summary>
  633. Copies all rows in the supplied
  634. <see cref="T:System.Data.DataTable" />
  635. to a destination table specified by the
  636. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  637. property of the
  638. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  639. object.
  640. </summary><remarks>
  641. <format type="text/markdown"><![CDATA[
  642. ## Remarks
  643. All rows in the <xref:System.Data.DataTable> are copied to the destination table except those that have been deleted.
  644. 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.
  645. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataTable> columns to the destination database table.
  646. ## Examples
  647. 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.
  648. In this example, a <xref:System.Data.DataTable> is created at run time and is the source of the `SqlBulkCopy` operation.
  649. > [!IMPORTANT]
  650. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  651. 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.
  652. [!code-csharp[SqlBulkCopy.DataTable#1](~/../sqlclient/doc/samples/SqlBulkCopy_DataTable.cs#1)]
  653. ]]></format>
  654. </remarks><related type="Article" href="https://msdn.microsoft.com/library/83a7a0d2-8018-4354-97b9-0b1d99f8342b">
  655. Performing Bulk Copy Operations
  656. </related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">
  657. ADO.NET Overview
  658. </related>
  659. </member>
  660. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)">
  661. <param name="table">
  662. A
  663. <see cref="T:System.Data.DataTable" />
  664. whose rows will be copied to the destination table.
  665. </param><param name="rowState">
  666. A value from the
  667. <see cref="T:System.Data.DataRowState" />
  668. enumeration. Only rows matching the row state are copied to the destination.
  669. </param><summary>
  670. Copies only rows that match the supplied row state in the supplied
  671. <see cref="T:System.Data.DataTable" />
  672. to a destination table specified by the
  673. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  674. property of the
  675. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  676. object.
  677. </summary><remarks>
  678. <format type="text/markdown"><![CDATA[
  679. ## Remarks
  680. 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.
  681. > [!NOTE]
  682. > 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>
  683. rows will also be copied to the server. No exception will be raised.
  684. 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.
  685. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataTable> columns to the destination database table.
  686. ## Examples
  687. 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.
  688. 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.
  689. 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.
  690. > [!IMPORTANT]
  691. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  692. [!code-csharp[SqlBulkCopy.DataRowState#1](~/../sqlclient/doc/samples/SqlBulkCopy_DataRowState.cs#1)]
  693. ]]></format>
  694. </remarks>
  695. </member>
  696. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])">
  697. <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>
  698. <format type="text/markdown"><![CDATA[
  699. ## Remarks
  700. 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.
  701. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the <xref:System.Data.DataRow> columns to the destination database table.
  702. ## Examples
  703. 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.
  704. 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.
  705. > [!IMPORTANT]
  706. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided to demonstrate the syntax for using **SqlBulkCopy** only. If the source and destination tables are in the same SQL Server instance, it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  707. [!code-csharp[SqlBulkCopy.RowArray#1](~/../sqlclient/doc/samples/SqlBulkCopy_RowArray.cs#1)]
  708. ]]></format>
  709. </remarks>
  710. </member>
  711. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)">
  712. <param name="reader">
  713. A
  714. <see cref="T:System.Data.IDataReader" />
  715. whose rows will be copied to the destination table.
  716. </param><summary>
  717. Copies all rows in the supplied
  718. <see cref="T:System.Data.IDataReader" />
  719. to a destination table specified by the
  720. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  721. property of the
  722. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  723. object.
  724. </summary><remarks>
  725. <format type="text/markdown"><![CDATA[
  726. ## Remarks
  727. 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,
  728. 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
  729. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> again.
  730. 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>
  731. 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,
  732. when the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> operation is complete.
  733. 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.
  734. The <xref:Microsoft.Data.SqlClient.SqlBulkCopy.ColumnMappings> collection maps from the data reader columns to the destination database table.
  735. ## Examples
  736. 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.
  737. > [!IMPORTANT]
  738. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is provided
  739. 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
  740. Transact-SQL `INSERT … SELECT` statement to copy the data.
  741. [!code-csharp[SqlBulkCopy.ConnectionString#1](~/../sqlclient/doc/samples/SqlBulkCopy_ConnectionString.cs#1)]
  742. ]]></format>
  743. </remarks>
  744. </member>
  745. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader)">
  746. <param name="reader">
  747. A
  748. <see cref="T:System.Data.IDataReader" />
  749. whose rows will be copied to the destination table.
  750. </param><summary>
  751. The asynchronous version of
  752. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  753. , which copies all rows in the supplied
  754. <see cref="T:System.Data.IDataReader" />
  755. to a destination table specified by the
  756. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  757. property of the
  758. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  759. object.
  760. </summary><returns>
  761. A task representing the asynchronous operation.
  762. </returns><remarks>
  763. <format type="text/markdown"><![CDATA[
  764. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  765. ]]></format>
  766. </remarks><exception cref="T:System.InvalidOperationException">
  767. Calling
  768. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  769. multiple times for the same instance before task completion. Calling
  770. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  771. and
  772. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  773. for the same instance before task completion.
  774. The connection drops or is closed during
  775. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  776. execution.
  777. Returned in the task object, the
  778. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  779. object was closed during the method execution.
  780. Returned in the task object, there was a connection pool timeout.
  781. Returned in the task object, the
  782. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  783. object is closed before method execution.
  784. The
  785. <see cref="T:System.Data.IDataReader" />
  786. was closed before the completed
  787. <see cref="T:System.Threading.Tasks.Task" />
  788. returned.
  789. The
  790. <see cref="T:System.Data.IDataReader" />
  791. 's associated connection was closed before the completed
  792. <see cref="T:System.Threading.Tasks.Task" />
  793. returned.
  794. <see langword="Context Connection=true" />
  795. is specified in the connection string.
  796. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  797. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  798. </exception>
  799. </member>
  800. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader,System.Threading.CancellationToken)">
  801. <param name="reader">
  802. A
  803. <see cref="T:System.Data.Common.DbDataReader" />
  804. whose rows will be copied to the destination table.
  805. </param><param name="cancellationToken">
  806. The cancellation instruction. A
  807. <see cref="P:System.Threading.CancellationToken.None" />
  808. value in this parameter makes this method equivalent to
  809. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.Common.DbDataReader)" />
  810. .
  811. </param><summary>
  812. The asynchronous version of
  813. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.Common.DbDataReader)" />
  814. , which copies all rows from the supplied
  815. <see cref="T:System.Data.Common.DbDataReader" />
  816. array to a destination table specified by the
  817. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  818. property of the
  819. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  820. object.
  821. </summary><returns>
  822. Returns
  823. <see cref="T:System.Threading.Tasks.Task" />
  824. .
  825. </returns><remarks>
  826. To be added.
  827. </remarks>
  828. </member>
  829. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])">
  830. <param name="rows">
  831. An array of
  832. <see cref="T:System.Data.DataRow" />
  833. objects that will be copied to the destination table.
  834. </param><summary>
  835. The asynchronous version of
  836. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  837. ,
  838. which copies all rows from the supplied
  839. <see cref="T:System.Data.DataRow" />
  840. array to a destination table specified by the
  841. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  842. property of the
  843. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  844. object.
  845. </summary><returns>
  846. A task representing the asynchronous operation.
  847. </returns><remarks>
  848. <format type="text/markdown"><![CDATA[
  849. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  850. ]]></format>
  851. </remarks><exception cref="T:System.InvalidOperationException">
  852. Calling
  853. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  854. multiple times for the same instance before task completion. Calling
  855. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  856. and
  857. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  858. for the same instance before task completion.
  859. The connection drops or is closed during
  860. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  861. execution.
  862. Returned in the task object, the
  863. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  864. object was closed during the method execution.
  865. Returned in the task object, there was a connection pool timeout.
  866. Returned in the task object, the
  867. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  868. object is closed before method execution.
  869. <see langword="Context Connection=true" />
  870. is specified in the connection string.
  871. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  872. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  873. </exception>
  874. </member>
  875. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[],System.Threading.CancellationToken)">
  876. <param name="rows">
  877. An array of
  878. <see cref="T:System.Data.DataRow" />
  879. objects that will be copied to the destination table.
  880. </param><param name="cancellationToken">
  881. The cancellation instruction. A
  882. <see cref="P:System.Threading.CancellationToken.None" />
  883. value in this parameter makes this method equivalent to
  884. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  885. .
  886. </param><summary>
  887. The asynchronous version of
  888. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  889. , which copies all rows from the supplied
  890. <see cref="T:System.Data.DataRow" />
  891. array to a destination table specified by the
  892. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  893. property of the
  894. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  895. object.
  896. 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.
  897. </summary><returns>
  898. A task representing the asynchronous operation.
  899. </returns><remarks>
  900. <format type="text/markdown"><![CDATA[
  901. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  902. ]]></format>
  903. </remarks><exception cref="T:System.InvalidOperationException">
  904. Calling
  905. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  906. multiple times for the same instance before
  907. task completion. Calling
  908. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  909. and
  910. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataRow[])" />
  911. for the same instance before task completion. The connection drops or is closed during
  912. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataRow[])" />
  913. execution. Returned in the task object, the
  914. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  915. object was closed during the method execution. Returned in the task object, there was a connection pool timeout. Returned in the task object, the
  916. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  917. object is closed before method execution.
  918. <see langword="Context Connection=true" />
  919. is specified in the connection string.
  920. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  921. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  922. </exception>
  923. </member>
  924. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)">
  925. <param name="table">
  926. A
  927. <see cref="T:System.Data.DataTable" />
  928. whose rows will be copied to the destination table.
  929. </param><summary>
  930. The asynchronous version of
  931. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  932. , which copies all rows in the supplied
  933. <see cref="T:System.Data.DataTable" />
  934. to a destination table specified by the
  935. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  936. property of the
  937. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  938. object.
  939. </summary><returns>
  940. A task representing the asynchronous operation.
  941. </returns><remarks>
  942. <format type="text/markdown"><![CDATA[
  943. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  944. ]]></format>
  945. </remarks><exception cref="T:System.InvalidOperationException">
  946. Calling
  947. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  948. multiple times for the same instance before task completion.
  949. Calling
  950. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  951. and
  952. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  953. for the same instance before task completion.
  954. The connection drops or is closed during
  955. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  956. execution.
  957. Returned in the task object, the
  958. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  959. object was closed during the method execution.
  960. Returned in the task object, there was a connection pool timeout.
  961. Returned in the task object, the
  962. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  963. object is closed before method execution.
  964. <see langword="Context Connection=true" />
  965. is specified in the connection string.
  966. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  967. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  968. </exception>
  969. </member>
  970. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)">
  971. <param name="table">
  972. A
  973. <see cref="T:System.Data.DataTable" />
  974. whose rows will be copied to the destination table.
  975. </param><param name="rowState">
  976. A value from the
  977. <see cref="T:System.Data.DataRowState" />
  978. enumeration. Only rows matching the row state are copied to the destination.
  979. </param><summary>
  980. The asynchronous version of
  981. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  982. ,
  983. which copies only rows that match the supplied row state in the supplied
  984. <see cref="T:System.Data.DataTable" /> to a destination table specified by the <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  985. property of the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" /> object.
  986. </summary><returns>
  987. A task representing the asynchronous operation.
  988. </returns><remarks>
  989. <format type="text/markdown"><![CDATA[
  990. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  991. ]]></format>
  992. </remarks><exception cref="T:System.InvalidOperationException">
  993. Calling
  994. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  995. multiple times for the same instance before task completion.
  996. Calling
  997. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  998. and
  999. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1000. for the same instance before task completion.
  1001. The connection drops or is closed during
  1002. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1003. execution.
  1004. Returned in the task object, the
  1005. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1006. object was closed during the method execution.
  1007. Returned in the task object, there was a connection pool timeout.
  1008. Returned in the task object, the
  1009. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1010. object is closed before method execution.
  1011. <see langword="Context Connection=true" />
  1012. is specified in the connection string.
  1013. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1014. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1015. </exception>
  1016. </member>
  1017. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState,System.Threading.CancellationToken)">
  1018. <param name="table">
  1019. A
  1020. <see cref="T:System.Data.DataTable" />
  1021. whose rows will be copied to the destination table.
  1022. </param><param name="rowState">
  1023. A value from the
  1024. <see cref="T:System.Data.DataRowState" />
  1025. enumeration. Only rows matching the row state are copied to the destination.
  1026. </param><param name="cancellationToken">
  1027. The cancellation instruction. A
  1028. <see cref="P:System.Threading.CancellationToken.None" />
  1029. value in this parameter makes this method equivalent to
  1030. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1031. .
  1032. </param><summary>
  1033. The asynchronous version of
  1034. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1035. ,
  1036. which copies only rows that match the supplied row state in the supplied
  1037. <see cref="T:System.Data.DataTable" />
  1038. to a destination table specified by the
  1039. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1040. property of the
  1041. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1042. object.
  1043. 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.\
  1044. </summary><returns>
  1045. A task representing the asynchronous operation.
  1046. </returns><remarks>
  1047. <format type="text/markdown"><![CDATA[
  1048. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1049. ]]></format>
  1050. </remarks><exception cref="T:System.InvalidOperationException">
  1051. Calling
  1052. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1053. multiple times for the same instance before task completion.
  1054. Calling
  1055. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1056. and
  1057. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable,System.Data.DataRowState)" />
  1058. for the same instance before task completion.
  1059. The connection drops or is closed during
  1060. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Data.DataRowState)" />
  1061. execution.
  1062. Returned in the task object, the
  1063. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1064. object was closed during the method execution.
  1065. Returned in the task object, there was a connection pool timeout.
  1066. Returned in the task object, the
  1067. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1068. object is closed before method execution.
  1069. <see langword="Context Connection=true" />
  1070. is specified in the connection string.
  1071. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1072. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1073. </exception>
  1074. </member>
  1075. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable,System.Threading.CancellationToken)">
  1076. <param name="table">
  1077. A
  1078. <see cref="T:System.Data.DataTable" />
  1079. whose rows will be copied to the destination table.
  1080. </param><param name="cancellationToken">
  1081. The cancellation instruction. A
  1082. <see cref="P:System.Threading.CancellationToken.None" />
  1083. value in this parameter makes this method equivalent to
  1084. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1085. .
  1086. </param><summary>
  1087. The asynchronous version of
  1088. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  1089. , which copies all rows in the supplied
  1090. <see cref="T:System.Data.DataTable" />
  1091. to a destination table specified by the
  1092. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1093. property of the
  1094. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1095. object.
  1096. 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.
  1097. </summary><returns>
  1098. A task representing the asynchronous operation.
  1099. </returns><remarks>
  1100. <format type="text/markdown"><![CDATA[
  1101. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1102. ]]></format>
  1103. </remarks><exception cref="T:System.InvalidOperationException">
  1104. Calling
  1105. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1106. multiple times for the same instance before task completion.
  1107. Calling
  1108. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1109. and
  1110. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.DataTable)" />
  1111. for the same instance before task completion.
  1112. The connection drops or is closed during
  1113. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1114. execution.
  1115. Returned in the task object, the
  1116. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1117. object was closed during the method execution.
  1118. Returned in the task object, there was a connection pool timeout.
  1119. Returned in the task object, the
  1120. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1121. object is closed before method execution.
  1122. <see langword="Context Connection=true" />
  1123. is specified in the connection string.
  1124. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1125. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1126. </exception>
  1127. </member>
  1128. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)">
  1129. <param name="reader">
  1130. A
  1131. <see cref="T:System.Data.IDataReader" />
  1132. whose rows will be copied to the destination table.
  1133. </param><summary>
  1134. The asynchronous version of
  1135. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1136. , which copies all rows in the supplied
  1137. <see cref="T:System.Data.IDataReader" />
  1138. to a destination table specified by the
  1139. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1140. property of the
  1141. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1142. object.
  1143. </summary><returns>
  1144. A task representing the asynchronous operation.
  1145. </returns><remarks>
  1146. <format type="text/markdown"><![CDATA[
  1147. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1148. ]]></format>
  1149. </remarks><exception cref="T:System.InvalidOperationException">
  1150. Calling
  1151. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1152. multiple times for the same
  1153. instance before task completion.
  1154. Calling
  1155. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1156. and
  1157. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1158. for the same instance before task completion.
  1159. The connection drops or is closed during
  1160. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1161. execution.
  1162. Returned in the task object, the
  1163. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1164. object was closed during the method execution.
  1165. Returned in the task object, there was a connection pool timeout.
  1166. Returned in the task object, the
  1167. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1168. object is closed before method execution.
  1169. The
  1170. <see cref="T:System.Data.IDataReader" />
  1171. was closed before the completed
  1172. <see cref="T:System.Threading.Tasks.Task" />
  1173. returned.
  1174. The
  1175. <see cref="T:System.Data.IDataReader" />
  1176. 's associated connection was closed before the completed
  1177. <see cref="T:System.Threading.Tasks.Task" />
  1178. returned.
  1179. <see langword="Context Connection=true" />
  1180. is specified in the connection string.
  1181. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1182. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1183. </exception>
  1184. </member>
  1185. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader,System.Threading.CancellationToken)">
  1186. <param name="reader">
  1187. A
  1188. <see cref="T:System.Data.IDataReader" />
  1189. whose rows will be copied to the destination table.
  1190. </param><param name="cancellationToken">
  1191. The cancellation instruction. A
  1192. <see cref="P:System.Threading.CancellationToken.None" />
  1193. value in this parameter makes this method equivalent to
  1194. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.DataTable)" />
  1195. .
  1196. </param><summary>
  1197. The asynchronous version of
  1198. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1199. , which copies all rows in the supplied
  1200. <see cref="T:System.Data.IDataReader" />
  1201. to a destination table specified by the
  1202. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopy.DestinationTableName" />
  1203. property of the
  1204. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1205. object.
  1206. 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.
  1207. </summary><returns>
  1208. A task representing the asynchronous operation.
  1209. </returns><remarks>
  1210. <format type="text/markdown"><![CDATA[
  1211. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  1212. ]]></format>
  1213. </remarks><exception cref="T:System.InvalidOperationException">
  1214. Calling
  1215. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1216. multiple times for the same instance before task completion.
  1217. Calling
  1218. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1219. and
  1220. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(System.Data.IDataReader)" />
  1221. for the same instance before task completion.
  1222. The connection drops or is closed during
  1223. <see cref="M:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerAsync(System.Data.IDataReader)" />
  1224. execution.
  1225. Returned in the task object, the
  1226. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1227. object was closed during the method execution.
  1228. Returned in the task object, there was a connection pool timeout.
  1229. Returned in the task object, the
  1230. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  1231. object is closed before method execution.
  1232. The
  1233. <see cref="T:System.Data.IDataReader" />
  1234. was closed before the completed
  1235. <see cref="T:System.Threading.Tasks.Task" />
  1236. returned.
  1237. The
  1238. <see cref="T:System.Data.IDataReader" />
  1239. 's associated connection was closed before the completed
  1240. <see cref="T:System.Threading.Tasks.Task" />
  1241. returned.
  1242. <see langword="Context Connection=true" />
  1243. is specified in the connection string.
  1244. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  1245. Returned in the task object, any error returned by SQL Server that occurred while opening the connection.
  1246. </exception>
  1247. </member>
  1248. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping">
  1249. <summary>
  1250. Defines the mapping between a column in a
  1251. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />
  1252. instance's data source and a column in the instance's destination table.
  1253. </summary><remarks>
  1254. <format type="text/markdown"><![CDATA[
  1255. ## Remarks
  1256. Column mappings define the mapping between data source and the target table.
  1257. 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.
  1258. For this to work, source and target schemas must match. If they do not, an <xref:System.InvalidOperationException> will be thrown.
  1259. 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
  1260. are ignored.
  1261. 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.
  1262. ## Examples
  1263. 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
  1264. 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.
  1265. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1266. > [!IMPORTANT]
  1267. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1268. 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
  1269. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1270. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1271. ]]></format>
  1272. </remarks>
  1273. </member>
  1274. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor">
  1275. <summary>
  1276. Parameterless constructor that initializes a new
  1277. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />
  1278. object.
  1279. </summary><remarks>
  1280. <format type="text/markdown"><![CDATA[
  1281. ## Remarks
  1282. If you use this constructor, you must then define the source for the mapping using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn>
  1283. property or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> property, and define the destination for the mapping using the
  1284. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> property or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> property.
  1285. ## Examples
  1286. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1287. 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.
  1288. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1289. > [!IMPORTANT]
  1290. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1291. 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,
  1292. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1293. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1294. ]]></format>
  1295. </remarks>
  1296. </member>
  1297. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.Int32,System.Int32)">
  1298. <param name="sourceColumnOrdinal">
  1299. The ordinal position of the source column within the data source.
  1300. </param><param name="destinationOrdinal">
  1301. The ordinal position of the destination column within the destination table.
  1302. </param><summary>
  1303. Creates a new column mapping, using column ordinals to refer to source and destination columns.
  1304. </summary><remarks>
  1305. <format type="text/markdown"><![CDATA[
  1306. ## Examples
  1307. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1308. 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.
  1309. <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.
  1310. > [!IMPORTANT]
  1311. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1312. 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
  1313. and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1314. [!code-csharp[SqlBulkCopy.ColumnMappingOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdinal.cs#1)]
  1315. ]]></format>
  1316. </remarks>
  1317. </member>
  1318. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.Int32,System.String)">
  1319. <param name="sourceColumnOrdinal">
  1320. The ordinal position of the source column within the data source.
  1321. </param><param name="destinationColumn">
  1322. The name of the destination column within the destination table.
  1323. </param><summary>
  1324. Creates a new column mapping, using a column ordinal to refer to the source column and a column name for the target column.
  1325. </summary><remarks>
  1326. <format type="text/markdown"><![CDATA[
  1327. ## Examples
  1328. 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
  1329. 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
  1330. column map for the bulk copy.
  1331. > [!IMPORTANT]
  1332. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1333. 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
  1334. faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1335. [!code-csharp[SqlBulkCopy.ColumnMappingOrdinalName#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdinalName.cs#1)]
  1336. ]]></format>
  1337. </remarks>
  1338. </member>
  1339. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.String,System.Int32)">
  1340. <param name="sourceColumn">
  1341. The name of the source column within the data source.
  1342. </param><param name="destinationOrdinal">
  1343. The ordinal position of the destination column within the destination table.
  1344. </param><summary>
  1345. Creates a new column mapping, using a column name to refer to the source column and a column ordinal for the target column.
  1346. </summary><remarks>
  1347. <format type="text/markdown"><![CDATA[
  1348. ## Examples
  1349. 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
  1350. 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
  1351. a column map for the bulk copy.
  1352. > [!IMPORTANT]
  1353. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md). This code is
  1354. 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
  1355. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1356. [!code-csharp[SqlBulkCopy.ColumnMappingNameOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingNameOrdinal.cs#1)]
  1357. ]]></format>
  1358. </remarks>
  1359. </member>
  1360. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.#ctor(System.String,System.String)">
  1361. <param name="sourceColumn">
  1362. The name of the source column within the data source.
  1363. </param><param name="destinationColumn">
  1364. The name of the destination column within the destination table.
  1365. </param><summary>
  1366. Creates a new column mapping, using column names to refer to source and destination columns.
  1367. </summary><remarks>
  1368. <format type="text/markdown"><![CDATA[
  1369. ## Examples
  1370. 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
  1371. 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
  1372. column map for the bulk copy.
  1373. > [!IMPORTANT]
  1374. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1375. 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
  1376. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1377. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs#1)]
  1378. ]]></format>
  1379. </remarks>
  1380. </member>
  1381. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn">
  1382. <summary>
  1383. Name of the column being mapped in the destination database table.
  1384. </summary><value>
  1385. The string value of the
  1386. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn" />
  1387. property.
  1388. </value><remarks>
  1389. <format type="text/markdown"><![CDATA[
  1390. ## Remarks
  1391. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> properties are mutually exclusive.
  1392. The last value set takes precedence.
  1393. ## Examples
  1394. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1395. 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.
  1396. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1397. > [!IMPORTANT]
  1398. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1399. 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
  1400. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1401. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationColumn.cs#1)]
  1402. ]]></format>
  1403. </remarks>
  1404. </member>
  1405. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal">
  1406. <summary>
  1407. Ordinal value of the destination column within the destination table.
  1408. </summary><value>
  1409. The integer value of the
  1410. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal" />
  1411. property, or -1 if the property has not been set.
  1412. </value><remarks>
  1413. <format type="text/markdown"><![CDATA[
  1414. ## Remarks
  1415. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.DestinationOrdinal%2A> properties are mutually exclusive.
  1416. The last value set takes precedence.
  1417. ## Examples
  1418. 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
  1419. 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
  1420. column map for the bulk copy.
  1421. > [!IMPORTANT]
  1422. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1423. 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
  1424. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1425. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationOrdinal.cs#1)]
  1426. ]]></format>
  1427. </remarks>
  1428. </member>
  1429. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn">
  1430. <summary>
  1431. Name of the column being mapped in the data source.
  1432. </summary><value>
  1433. The string value of the
  1434. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn" />
  1435. property.
  1436. </value><remarks>
  1437. <format type="text/markdown"><![CDATA[
  1438. ## Remarks
  1439. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> properties are mutually exclusive.
  1440. The last value set takes precedence.
  1441. ## Examples
  1442. 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
  1443. 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
  1444. column map for the bulk copy.
  1445. > [!IMPORTANT]
  1446. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1447. 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
  1448. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1449. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationColumn#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationColumn.cs#1)]
  1450. ]]></format>
  1451. </remarks>
  1452. </member>
  1453. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal">
  1454. <summary>
  1455. The ordinal position of the source column within the data source.
  1456. </summary><value>
  1457. The integer value of the
  1458. <see cref="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal" />
  1459. property.
  1460. </value><remarks>
  1461. <format type="text/markdown"><![CDATA[
  1462. ## Remarks
  1463. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceColumn%2A> and <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping.SourceOrdinal%2A> properties are mutually exclusive.
  1464. The last value set takes precedence.
  1465. ## Examples
  1466. 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
  1467. 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
  1468. bulk copy.
  1469. > [!IMPORTANT]
  1470. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1471. 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
  1472. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1473. [!code-csharp[SqlBulkCopy.ColumnMappingDestinationOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingDestinationOrdinal.cs#1)]
  1474. ]]></format>
  1475. </remarks>
  1476. </member>
  1477. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection">
  1478. <summary>Collection of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> objects that inherits from <see cref="T:System.Collections.CollectionBase" />.</summary><remarks>
  1479. <format type="text/markdown"><![CDATA[
  1480. ## Remarks
  1481. Column mappings define the mapping between data source and the target table.
  1482. 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.
  1483. For this to work, source and target schemas must match. If they do not, an <xref:System.InvalidOperationException> is thrown.
  1484. 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
  1485. ignored.
  1486. 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.
  1487. ## Examples
  1488. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1489. 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.
  1490. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> are added to the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection> for the
  1491. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> object to create a column map for the bulk copy.
  1492. > [!IMPORTANT]
  1493. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1494. 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
  1495. use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1496. [!code-csharp[SqlBulkCopy.ColumnMappingCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollection.cs#1)]
  1497. ]]></format>
  1498. </remarks>
  1499. </member>
  1500. <member name="P:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Item(System.Int32)">
  1501. <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>
  1502. </member>
  1503. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1504. <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>
  1505. <format type="text/markdown"><![CDATA[
  1506. ## Examples
  1507. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1508. 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.
  1509. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1510. > [!IMPORTANT]
  1511. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1512. 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,
  1513. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1514. [!code-csharp[SqlBulkCopy.ColumnMapping#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMapping.cs)]
  1515. ]]>
  1516. </format>
  1517. </remarks>
  1518. </member>
  1519. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.Int32,System.Int32)">
  1520. <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>
  1521. <format type="text/markdown"><![CDATA[
  1522. ## Remarks
  1523. 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
  1524. mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1525. ## Examples
  1526. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1527. 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.
  1528. <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.
  1529. > [!IMPORTANT]
  1530. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1531. 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
  1532. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1533. [!code-csharp[SqlBulkCopy.ColumnMappingCollectionOrdinal#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollectionOrdinal.cs#1)]
  1534. ]]></format>
  1535. </remarks>
  1536. </member>
  1537. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.Int32,System.String)">
  1538. <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>
  1539. <format type="text/markdown"><![CDATA[
  1540. ## Remarks
  1541. 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.
  1542. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1543. ## Examples
  1544. 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
  1545. 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
  1546. column map for the bulk copy.
  1547. > [!IMPORTANT]
  1548. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1549. 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
  1550. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1551. [!code-csharp[SqlBulkCopy_ColumnMappingIndexColName#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingIndexColName.cs#1)]
  1552. ]]></format>
  1553. </remarks>
  1554. </member>
  1555. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.String,System.Int32)">
  1556. <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>
  1557. <format type="text/markdown"><![CDATA[
  1558. ## Remarks
  1559. 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.
  1560. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  1561. ## Examples
  1562. The following example bulk copies data from a source table in the **AdventureWorks** sample database to a destination table in the same database.
  1563. 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.
  1564. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> objects are used to create a column map for the bulk copy.
  1565. > [!IMPORTANT]
  1566. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1567. 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,
  1568. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1569. [!code-csharp[SqlBulkCopy.ColumnMappingColNameIndex#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingColNameIndex.cs#1)]
  1570. ]]></format>
  1571. </remarks>
  1572. </member>
  1573. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Add(System.String,System.String)">
  1574. <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>
  1575. <format type="text/markdown"><![CDATA[
  1576. ## Remarks
  1577. 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.
  1578. If you try to add a mapping that is different from others already in the collection, an <xref:System.InvalidOperationException> is thrown.
  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.
  1581. 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
  1582. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping> object by specifying the column names.
  1583. > [!IMPORTANT]
  1584. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  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,
  1586. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1587. [!code-csharp[SqlBulkCopy.ColumnMappingCollection#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingCollection.cs#1)]
  1588. ]]></format>
  1589. </remarks>
  1590. </member>
  1591. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear">
  1592. <summary>Clears the contents of the collection.</summary><remarks>
  1593. <format type="text/markdown"><![CDATA[
  1594. ## Remarks
  1595. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1596. instance to process more than one bulk copy operation. If you create column mappings for one bulk copy operation, you must clear the
  1597. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection> after the <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> method and before processing the next bulk copy.
  1598. 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
  1599. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1600. ## Examples
  1601. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1602. 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.
  1603. 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.
  1604. > [!IMPORTANT]
  1605. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1606. 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
  1607. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1608. [!code-csharp[SqlBulkCopy.ColumnMappingOrdersDetails#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingOrdersDetails.cs#1)]
  1609. ]]></format>
  1610. </remarks>
  1611. </member>
  1612. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Contains(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1613. <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>
  1614. <see langword="true" /> if the specified mapping exists in the collection; otherwise <see langword="false" />.</returns>
  1615. </member>
  1616. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.CopyTo(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping[],System.Int32)">
  1617. <param name="array">The one-dimensional <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" /> array that is the destination of the elements copied from
  1618. <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" />
  1619. items, starting at a particular index.
  1620. </summary>
  1621. </member>
  1622. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.IndexOf(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1623. <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>
  1624. </member>
  1625. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1626. <param name="index">Integer value of the location within the <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection" /> at which to insert the new
  1627. <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping" />.</param><param name="value">
  1628. <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>
  1629. </member>
  1630. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove(Microsoft.Data.SqlClient.SqlBulkCopyColumnMapping)">
  1631. <param name="value">
  1632. <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>
  1633. <format type="text/markdown"><![CDATA[
  1634. ## Remarks
  1635. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1636. 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
  1637. <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
  1638. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method, or remove mappings individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A>
  1639. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method.
  1640. 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
  1641. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1642. ## Examples
  1643. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1644. 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.
  1645. 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**
  1646. mapping and then adds the appropriate mappings for the second bulk copy operation.
  1647. > [!IMPORTANT]
  1648. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1649. 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
  1650. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1651. [!code-csharp[SqlBulkCopy.ColumnMappingRemove#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingRemove.cs#1)]
  1652. ]]></format>
  1653. </remarks>
  1654. </member>
  1655. <member name="M:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt(System.Int32)">
  1656. <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>
  1657. <format type="text/markdown"><![CDATA[
  1658. ## Remarks
  1659. The <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method is most commonly used when you use a single <xref:Microsoft.Data.SqlClient.SqlBulkCopy>
  1660. 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
  1661. <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
  1662. <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Clear%2A> method, or remove mappings individually using the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.Remove%2A>
  1663. method or the <xref:Microsoft.Data.SqlClient.SqlBulkCopyColumnMappingCollection.RemoveAt%2A> method.
  1664. 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
  1665. <xref:Microsoft.Data.SqlClient.SqlBulkCopy> for each operation.
  1666. ## Examples
  1667. The following example performs two bulk copy operations. The first operation copies sales order header information, and the second copies sales order details.
  1668. 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.
  1669. 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
  1670. **SalesOrderID** mapping and then adds the appropriate mappings for the second bulk copy operation.
  1671. > [!IMPORTANT]
  1672. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1673. 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
  1674. Transact-SQL `INSERT … SELECT` statement to copy the data.
  1675. [!code-csharp[SqlBulkCopy.ColumnMappingRemoveAt#1](~/../sqlclient/doc/samples/SqlBulkCopy_ColumnMappingRemoveAt.cs#1)]
  1676. ]]></format>
  1677. </remarks>
  1678. </member>
  1679. <member name="T:Microsoft.Data.SqlClient.SqlBulkCopyOptions">
  1680. <summary>Bitwise flag that specifies one or more options to use with an instance of <see cref="T:Microsoft.Data.SqlClient.SqlBulkCopy" />.</summary><remarks>
  1681. <format type="text/markdown"><![CDATA[
  1682. ## Remarks
  1683. You can use the <xref:Microsoft.Data.SqlClient.SqlBulkCopyOptions> enumeration when you construct a <xref:Microsoft.Data.SqlClient.SqlBulkCopy> instance to change how the
  1684. <xref:Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer%2A> methods for that instance behave.
  1685. ## Examples
  1686. 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,
  1687. instead of generating a new value for each row's identity column.
  1688. 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.
  1689. 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
  1690. primary key violations.
  1691. > [!IMPORTANT]
  1692. > This sample will not run unless you have created the work tables as described in [Bulk Copy Example Setup](~/docs/framework/data/adonet/sql/bulk-copy-example-setup.md).
  1693. 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,
  1694. it is easier and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
  1695. [!code-csharp[SqlBulkCopy.KeepIdentity#1](~/../sqlclient/doc/samples/SqlBulkCopy_KeepIdentity.cs)]
  1696. ]]></format>
  1697. </remarks>
  1698. </member>
  1699. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.AllowEncryptedValueModifications">
  1700. <summary>
  1701. <format type="text/markdown"><![CDATA[
  1702. When specified, **AllowEncryptedValueModifications** enables bulk copying of encrypted data between tables or databases, without decrypting the data. Typically,
  1703. 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
  1704. to disabled) and then would use this option to bulk insert the data, which is still encrypted.
  1705. 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,
  1706. or if it is correctly encrypted using the same encryption type, algorithm and key as the target column.
  1707. ]]></format>
  1708. </summary>
  1709. </member>
  1710. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.CheckConstraints">
  1711. <summary>Check constraints while data is being inserted. By default, constraints are not checked.</summary>
  1712. </member>
  1713. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.Default">
  1714. <summary>Use the default values for all options.</summary>
  1715. </member>
  1716. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.FireTriggers">
  1717. <summary>When specified, cause the server to fire the insert triggers for the rows being inserted into the database.</summary>
  1718. </member>
  1719. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.KeepIdentity">
  1720. <summary>Preserve source identity values. When not specified, identity values are assigned by the destination.</summary>
  1721. </member>
  1722. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.KeepNulls">
  1723. <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>
  1724. </member>
  1725. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.TableLock">
  1726. <summary>Obtain a bulk update lock for the duration of the bulk copy operation. When not specified, row locks are used.</summary>
  1727. </member>
  1728. <member name="F:Microsoft.Data.SqlClient.SqlBulkCopyOptions.UseInternalTransaction">
  1729. <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" />
  1730. object to the constructor, an <see cref="T:System.ArgumentException" /> occurs.
  1731. </summary>
  1732. </member>
  1733. <member name="T:Microsoft.Data.SqlClient.SqlClientFactory">
  1734. <summary>
  1735. Represents a set of methods for creating instances of the
  1736. <see cref="N:Microsoft.Data.SqlClient" />
  1737. provider's implementation of the data source classes.
  1738. </summary><remarks>
  1739. To be added.
  1740. </remarks>
  1741. </member>
  1742. <member name="F:Microsoft.Data.SqlClient.SqlClientFactory.Instance">
  1743. <summary>
  1744. Gets an instance of the
  1745. <see cref="T:Microsoft.Data.SqlClient.SqlClientFactory" />
  1746. . This can be used to retrieve strongly typed data objects.
  1747. </summary><remarks>
  1748. <format type="text/markdown"><![CDATA[
  1749. ## Examples
  1750. The following code fragment uses the <xref:Microsoft.Data.SqlClient.SqlClientFactory.Instance> property to retrieve a **SqlClientFactory** instance, and then return a strongly typed
  1751. <xref:System.Data.Common.DbCommand> instance:
  1752. ```csharp
  1753. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1754. DbCommand cmd = newFactory.CreateCommand();
  1755. ```
  1756. ]]></format>
  1757. </remarks>
  1758. </member>
  1759. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateCommand">
  1760. <summary>
  1761. Returns a strongly typed
  1762. <see cref="T:System.Data.Common.DbCommand" />
  1763. instance.
  1764. </summary><returns>
  1765. A new strongly typed instance of
  1766. <see cref="T:System.Data.Common.DbCommand" />
  1767. .
  1768. </returns><remarks>
  1769. <format type="text/markdown"><![CDATA[
  1770. ## Examples
  1771. The following code fragment returns a strongly typed <xref:System.Data.Common.DbCommand> instance:
  1772. ```csharp
  1773. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1774. DbCommand cmd = newFactory.CreateCommand();
  1775. ```
  1776. ]]></format>
  1777. </remarks>
  1778. </member>
  1779. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateCommandBuilder">
  1780. <summary>
  1781. Returns a strongly typed
  1782. <see cref="T:System.Data.Common.DbCommandBuilder" />
  1783. instance.
  1784. </summary><returns>
  1785. A new strongly typed instance of
  1786. <see cref="T:System.Data.Common.DbCommandBuilder" />
  1787. .
  1788. </returns><remarks>
  1789. <format type="text/markdown"><![CDATA[
  1790. ## Examples
  1791. The following code fragment returns a strongly typed <xref:System.Data.Common.DbCommandBuilder> instance:
  1792. ```csharp
  1793. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1794. DbCommandBuilder cmd = newFactory.CreateCommandBuilder();
  1795. ```
  1796. ]]></format>
  1797. </remarks>
  1798. </member>
  1799. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateConnection">
  1800. <summary>
  1801. Returns a strongly typed
  1802. <see cref="T:System.Data.Common.DbConnection" />
  1803. instance.
  1804. </summary><returns>
  1805. A new strongly typed instance of
  1806. <see cref="T:System.Data.Common.DbConnection" />
  1807. .
  1808. </returns><remarks>
  1809. <format type="text/markdown"><![CDATA[
  1810. ## Examples
  1811. The following code fragment returns a strongly typed <xref:System.Data.Common.DbConnection> instance:
  1812. ```csharp
  1813. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1814. DbConnection cmd = newFactory.CreateConnection();
  1815. ```
  1816. ]]></format>
  1817. </remarks>
  1818. </member>
  1819. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateConnectionStringBuilder">
  1820. <summary>
  1821. Returns a strongly typed
  1822. <see cref="T:System.Data.Common.DbConnectionStringBuilder" />
  1823. instance.
  1824. </summary><returns>
  1825. A new strongly typed instance of
  1826. <see cref="T:System.Data.Common.DbConnectionStringBuilder" />
  1827. .
  1828. </returns><remarks>
  1829. <format type="text/markdown"><![CDATA[
  1830. ## Examples
  1831. The following code fragment returns a strongly typed <xref:System.Data.Common.DbConnectionStringBuilder> instance:
  1832. ```csharp
  1833. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1834. DbConnectionStringBuilder cmd =
  1835. newFactory.CreateConnectionStringBuilder();
  1836. ```
  1837. ]]></format>
  1838. </remarks>
  1839. </member>
  1840. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateDataAdapter">
  1841. <summary>
  1842. Returns a strongly typed
  1843. <see cref="T:System.Data.Common.DbDataAdapter" />
  1844. instance.
  1845. </summary><returns>
  1846. A new strongly typed instance of
  1847. <see cref="T:System.Data.Common.DbDataAdapter" />
  1848. .
  1849. </returns><remarks>
  1850. <format type="text/markdown"><![CDATA[
  1851. ## Examples
  1852. The following code fragment returns a strongly typed <xref:System.Data.Common.DbDataAdapter> instance:
  1853. ```csharp
  1854. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1855. DbDataAdapter cmd = newFactory.CreateDataAdapter();
  1856. ```
  1857. ]]></format>
  1858. </remarks>
  1859. </member>
  1860. <member name="M:Microsoft.Data.SqlClient.SqlClientFactory.CreateParameter">
  1861. <summary>
  1862. Returns a strongly typed
  1863. <see cref="T:System.Data.Common.DbParameter" />
  1864. instance.
  1865. </summary><returns>
  1866. A new strongly typed instance of
  1867. <see cref="T:System.Data.Common.DbParameter" />
  1868. .
  1869. </returns><remarks>
  1870. <format type="text/markdown"><![CDATA[
  1871. ## Examples
  1872. The following code fragment returns a strongly typed <xref:System.Data.Common.DbParameter> instance:
  1873. ```csharp
  1874. SqlClientFactory newFactory = SqlClientFactory.Instance;
  1875. DbParameter cmd = newFactory.CreateParameter();
  1876. ```
  1877. ]]></format>
  1878. </remarks>
  1879. </member>
  1880. <member name="T:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames">
  1881. <summary>Provides a list of constants for use with the **GetSchema** method to retrieve metadata collections.</summary><remarks>To be added.</remarks>
  1882. </member>
  1883. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Columns">
  1884. <summary>A constant for use with the **GetSchema** method that represents the **Columns** collection.</summary><remarks>To be added.</remarks>
  1885. </member>
  1886. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Databases">
  1887. <summary>A constant for use with the **GetSchema** method that represents the **Databases** collection.</summary><remarks>To be added.</remarks>
  1888. </member>
  1889. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ForeignKeys">
  1890. <summary>A constant for use with the **GetSchema** method that represents the **ForeignKeys** collection.</summary><remarks>To be added.</remarks>
  1891. </member>
  1892. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.IndexColumns">
  1893. <summary>A constant for use with the **GetSchema** method that represents the **IndexColumns** collection.</summary><remarks>To be added.</remarks>
  1894. </member>
  1895. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Indexes">
  1896. <summary>A constant for use with the **GetSchema** method that represents the **Indexes** collection.</summary><remarks>To be added.</remarks>
  1897. </member>
  1898. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Parameters">
  1899. <summary>A constant for use with the **GetSchema** method that represents the **Parameters** collection.</summary><remarks>To be added.</remarks>
  1900. </member>
  1901. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ProcedureColumns">
  1902. <summary>A constant for use with the **GetSchema** method that represents the **ProcedureColumns** collection.</summary><remarks>To be added.</remarks>
  1903. </member>
  1904. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Procedures">
  1905. <summary>A constant for use with the **GetSchema** method that represents the **Procedures** collection.</summary><remarks>To be added.</remarks>
  1906. </member>
  1907. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Tables">
  1908. <summary>A constant for use with the **GetSchema** method that represents the **Tables** collection.</summary><remarks>To be added.</remarks>
  1909. </member>
  1910. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.UserDefinedTypes">
  1911. <summary>A constant for use with the **GetSchema** method that represents the **UserDefinedTypes** collection.</summary><remarks>To be added.</remarks>
  1912. </member>
  1913. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Users">
  1914. <summary>A constant for use with the **GetSchema** method that represents the **Users** collection.</summary><remarks>To be added.</remarks>
  1915. </member>
  1916. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.ViewColumns">
  1917. <summary>A constant for use with the **GetSchema** method that represents the **ViewColumns** collection.</summary><remarks>To be added.</remarks>
  1918. </member>
  1919. <member name="F:Microsoft.Data.SqlClient.SqlClientMetaDataCollectionNames.Views">
  1920. <summary>A constant for use with the **GetSchema** method that represents the **Views** collection.</summary><remarks>To be added.</remarks>
  1921. </member>
  1922. <member name="T:Microsoft.Data.SqlClient.SqlCommand">
  1923. <summary>
  1924. Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. This class cannot be inherited.
  1925. </summary><remarks>
  1926. <format type="text/markdown"><![CDATA[
  1927. ## Remarks
  1928. 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.
  1929. <xref:Microsoft.Data.SqlClient.SqlCommand> features the following methods for executing commands at a SQL Server database:
  1930. |Item|Description|
  1931. |----------|-----------------|
  1932. |<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.|
  1933. |<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.|
  1934. |<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.|
  1935. |<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.|
  1936. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>|Executes commands such as Transact-SQL INSERT, DELETE, UPDATE, and SET statements.|
  1937. |<xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A>|Retrieves a single value (for example, an aggregate value) from a database.|
  1938. |<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.|
  1939. 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.
  1940. 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.
  1941. > [!NOTE]
  1942. > Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
  1943. ## Examples
  1944. 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.
  1945. [!code-csharp[SqlCommand Example#1](~/../sqlclient/doc/samples/SqlCommand.cs#1)]
  1946. The following sample shows how to create and execute different types of SqlCommand objects.
  1947. First you must create the sample database, by executing the following script:
  1948. [!code-sql[Setup Database](~/../sqlclient/doc/samples/SqlCommand_Setup.sql#1)]
  1949. Next, compile and execute the following:
  1950. [!code-csharp[SqlCommand Example#2](~/../sqlclient/doc/samples/SqlCommand_Intro.cs#1)]
  1951. ]]></format>
  1952. </remarks>
  1953. </member>
  1954. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor">
  1955. <summary>
  1956. Initializes a new instance of the
  1957. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  1958. class.
  1959. </summary><remarks>
  1960. <format type="text/markdown"><![CDATA[
  1961. ## Remarks
  1962. 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>.
  1963. |Properties|Initial value|
  1964. |----------------|-------------------|
  1965. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|empty string ("")|
  1966. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  1967. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  1968. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|Null|
  1969. You can change the value for any of these properties through a separate call to the property.
  1970. ## Examples
  1971. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets the `CommandTimeout` property.
  1972. [!code-csharp[Classic WebData IDbCommand_CommandTimeout.cs](~/../sqlclient/doc/samples/IDbCommand_CommandTimeout.cs)]
  1973. ]]></format>
  1974. </remarks>
  1975. </member>
  1976. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String)">
  1977. <param name="cmdText">
  1978. The text of the query.
  1979. </param><summary>
  1980. Initializes a new instance of the
  1981. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  1982. class with the text of the query.
  1983. </summary><remarks>
  1984. <format type="text/markdown"><![CDATA[
  1985. ## Remarks
  1986. When an instance of <xref:Microsoft.Data.SqlClient.SqlCommand> is created, the following read/write properties are set to initial values.
  1987. |Properties|Initial value|
  1988. |----------------|-------------------|
  1989. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  1990. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  1991. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  1992. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|null|
  1993. You can change the value for any of these properties through a separate call to the property.
  1994. ## Examples
  1995. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand>, passing in the connection string and command text.
  1996. [!code-csharp[SqlCommand_SqlCommand1](~/../sqlclient/doc/samples/SqlCommand_SqlCommand1.cs#1)]
  1997. ]]></format>
  1998. </remarks>
  1999. </member>
  2000. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)">
  2001. <param name="cmdText">
  2002. The text of the query.
  2003. </param><param name="connection">
  2004. A
  2005. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2006. that represents the connection to an instance of SQL Server.
  2007. </param><summary>
  2008. Initializes a new instance of the
  2009. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2010. class with the text of the query and a
  2011. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2012. .
  2013. </summary><remarks>
  2014. <format type="text/markdown"><![CDATA[
  2015. ## Remarks
  2016. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2017. |Properties|Initial value|
  2018. |----------------|-------------------|
  2019. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2020. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2021. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2022. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|A new <xref:Microsoft.Data.SqlClient.SqlConnection> that is the value for the `connection` parameter.|
  2023. You can change the value for any of these parameters by setting the related property.
  2024. ## Examples
  2025. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2026. [!code-csharp[SqlCommand_SqlCommand2.cs](~/../sqlclient/doc/samples/SqlCommand_SqlCommand2.cs#1)]
  2027. ]]></format>
  2028. </remarks>
  2029. </member>
  2030. <member name="M:Microsoft.Data.SqlClient.SqlCommand.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection,Microsoft.Data.SqlClient.SqlTransaction)">
  2031. <param name="cmdText">
  2032. The text of the query.
  2033. </param><param name="connection">
  2034. A
  2035. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2036. that represents the connection to an instance of SQL Server.
  2037. </param><param name="transaction">
  2038. The
  2039. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2040. in which the
  2041. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2042. executes.
  2043. </param><summary>
  2044. Initializes a new instance of the
  2045. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2046. class with the text of the query, a
  2047. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2048. , and the
  2049. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2050. .
  2051. </summary><remarks>
  2052. <format type="text/markdown"><![CDATA[
  2053. ## Remarks
  2054. The following table shows initial property values for an instance of <xref:Microsoft.Data.SqlClient.SqlCommand>.
  2055. |Properties|Initial value|
  2056. |----------------|-------------------|
  2057. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandText%2A>|`cmdText`|
  2058. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A>|30|
  2059. |<xref:Microsoft.Data.SqlClient.SqlCommand.CommandType%2A>|`CommandType.Text`|
  2060. |<xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A>|A new <xref:Microsoft.Data.SqlClient.SqlConnection> that is the value for the `connection` parameter.|
  2061. You can change the value for any of these parameters by setting the related property.
  2062. ]]></format>
  2063. </remarks>
  2064. </member>
  2065. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandText">
  2066. <summary>
  2067. Gets or sets the Transact-SQL statement, table name or stored procedure to execute at the data source.
  2068. </summary><value>
  2069. The Transact-SQL statement or stored procedure to execute. The default is an empty string.
  2070. </value><remarks>
  2071. <format type="text/markdown"><![CDATA[
  2072. ## Remarks
  2073. 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.
  2074. 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:
  2075. ```sql
  2076. SELECT * FROM dbo.Customers WHERE CustomerID = @CustomerID
  2077. ```
  2078. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  2079. ## Examples
  2080. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2081. [!code-csharp[SqlCommand_CommandText](~/../sqlclient/doc/samples/SqlCommand_CommandText.cs)]
  2082. ]]></format>
  2083. </remarks>
  2084. </member>
  2085. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout">
  2086. <summary>
  2087. 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.
  2088. </summary><value>
  2089. The time in seconds to wait for the command to execute. The default is 30 seconds.
  2090. </value><remarks>
  2091. <format type="text/markdown"><![CDATA[
  2092. ## Remarks
  2093. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).
  2094. > [!NOTE]
  2095. > 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>.
  2096. <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> has no effect when the command is executed against a context connection (a <xref:Microsoft.Data.SqlClient.SqlConnection> opened with "context connection=true" in the connection string).
  2097. > [!NOTE]
  2098. > 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.
  2099. 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.
  2100. [!code-csharp[SqlCommand CommandTimeout](~/../sqlclient/doc/samples/SqlCommand_CommandTimeout.cs)]
  2101. ]]></format>
  2102. </remarks>
  2103. </member>
  2104. <member name="P:Microsoft.Data.SqlClient.SqlCommand.CommandType">
  2105. <summary>
  2106. Gets or sets a value indicating how the
  2107. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  2108. property is to be interpreted.
  2109. </summary><value>
  2110. One of the
  2111. <see cref="T:System.Data.CommandType" />
  2112. values. The default is
  2113. <see langword="Text" />
  2114. .
  2115. </value><remarks>
  2116. <format type="text/markdown"><![CDATA[
  2117. ## Remarks
  2118. 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.
  2119. 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:
  2120. SELECT * FROM Customers WHERE CustomerID = @CustomerID
  2121. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  2122. ## Examples
  2123. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2124. [!code-csharp[IDbCommand_CommandTimeout](~/../sqlclient/doc/samples/IDbCommand_CommandTimeout.cs)]
  2125. ]]></format>
  2126. </remarks>
  2127. </member>
  2128. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Connection">
  2129. <summary>
  2130. Gets or sets the
  2131. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2132. used by this instance of the
  2133. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2134. .
  2135. </summary><value>
  2136. The connection to a data source. The default value is
  2137. <see langword="null" />
  2138. .
  2139. </value><remarks>
  2140. <format type="text/markdown"><![CDATA[
  2141. ## Remarks
  2142. 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>.
  2143. 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.
  2144. ## Examples
  2145. The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and sets some of its properties.
  2146. [!code-csharp[SqlCommand_Connection](~/../sqlclient/doc/samples/SqlCommand_Connection.cs)]
  2147. ]]></format>
  2148. </remarks><exception cref="T:System.InvalidOperationException">
  2149. The
  2150. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  2151. property was changed while the command was enlisted in a transaction.
  2152. </exception>
  2153. </member>
  2154. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbConnection">
  2155. <summary>
  2156. To be added.
  2157. </summary><value>
  2158. To be added.
  2159. </value><remarks>
  2160. To be added.
  2161. </remarks>
  2162. </member>
  2163. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbParameterCollection">
  2164. <summary>
  2165. To be added.
  2166. </summary><value>
  2167. To be added.
  2168. </value><remarks>
  2169. To be added.
  2170. </remarks>
  2171. </member>
  2172. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DbTransaction">
  2173. <summary>
  2174. To be added.
  2175. </summary><value>
  2176. To be added.
  2177. </value><remarks>
  2178. To be added.
  2179. </remarks>
  2180. </member>
  2181. <member name="P:Microsoft.Data.SqlClient.SqlCommand.DesignTimeVisible">
  2182. <summary>
  2183. Gets or sets a value indicating whether the command object should be visible in a Windows Form Designer control.
  2184. </summary><value>
  2185. A value indicating whether the command object should be visible in a control. The default is
  2186. <see langword="true" />
  2187. .
  2188. </value><remarks>
  2189. To be added.
  2190. </remarks>
  2191. </member>
  2192. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Parameters">
  2193. <summary>
  2194. Gets the
  2195. <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" />
  2196. .
  2197. </summary><value>
  2198. The parameters of the Transact-SQL statement or stored procedure. The default is an empty collection.
  2199. </value><remarks>
  2200. <format type="text/markdown"><![CDATA[
  2201. ## Remarks
  2202. 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:
  2203. SELECT * FROM Customers WHERE CustomerID = @CustomerID
  2204. > [!NOTE]
  2205. > If the parameters in the collection do not match the requirements of the query to be executed, an error may result.
  2206. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  2207. ## Examples
  2208. The following example demonstrates how to create a <xref:Microsoft.Data.SqlClient.SqlCommand> and add parameters to the <xref:Microsoft.Data.SqlClient.SqlParameterCollection>.
  2209. [!code-csharp[SqlParameterCollection.AddWithValue#1](~/../sqlclient/doc/samples/SqlParameterCollection_AddWithValue.cs#1)]
  2210. ]]></format>
  2211. </remarks>
  2212. </member>
  2213. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Transaction">
  2214. <summary>
  2215. Gets or sets the
  2216. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2217. within which the
  2218. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2219. executes.
  2220. </summary><value>
  2221. The
  2222. <see cref="T:Microsoft.Data.SqlClient.SqlTransaction" />
  2223. . The default value is
  2224. <see langword="null" />
  2225. .
  2226. </value><remarks>
  2227. <format type="text/markdown"><![CDATA[
  2228. ## Remarks
  2229. 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.
  2230. ]]></format>
  2231. </remarks>
  2232. </member>
  2233. <member name="P:Microsoft.Data.SqlClient.SqlCommand.UpdatedRowSource">
  2234. <summary>
  2235. 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" />.
  2236. </summary><value>
  2237. One of the <see cref="T:System.Data.UpdateRowSource" /> values.
  2238. </value><remarks>
  2239. <format type="text/markdown"><![CDATA[
  2240. ## Remarks
  2241. 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**.
  2242. For more information about using the **UpdatedRowSource** property, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md).
  2243. ]]></format>
  2244. </remarks>
  2245. </member>
  2246. <member name="E:Microsoft.Data.SqlClient.SqlCommand.StatementCompleted">
  2247. <summary>
  2248. Occurs when the execution of a Transact-SQL statement completes.
  2249. </summary><remarks>
  2250. To be added.
  2251. </remarks>
  2252. </member>
  2253. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery">
  2254. <summary>
  2255. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2256. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2257. .
  2258. </summary><returns>
  2259. An
  2260. <see cref="T:System.IAsyncResult" />
  2261. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2262. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  2263. , which returns the number of affected rows.
  2264. </returns><remarks>
  2265. <format type="text/markdown"><![CDATA[
  2266. ## Remarks
  2267. 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.
  2268. 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.
  2269. 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>.
  2270. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2271. ## Examples
  2272. 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.
  2273. [!code-csharp[SqlCommand_BeginExecuteNonQuery](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteNonQuery.cs)]
  2274. ]]></format>
  2275. </remarks><exception cref="T:System.InvalidCastException">
  2276. A
  2277. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2278. other than **Binary** or **VarBinary** was used when
  2279. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2280. was set to
  2281. <see cref="T:System.IO.Stream" />
  2282. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2283. -or-
  2284. A
  2285. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2286. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2287. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2288. was set to
  2289. <see cref="T:System.IO.TextReader" />
  2290. .
  2291. -or-
  2292. A
  2293. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2294. other than **Xml** was used when
  2295. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2296. was set to
  2297. <see cref="T:System.Xml.XmlReader" />
  2298. .
  2299. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2300. Any error that occurred while executing the command text.
  2301. -or-
  2302. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2303. </exception><exception cref="T:System.InvalidOperationException">
  2304. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2305. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2306. .
  2307. -or-
  2308. The
  2309. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2310. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2311. </exception><exception cref="T:System.IO.IOException">
  2312. An error occurred in a
  2313. <see cref="T:System.IO.Stream" />
  2314. ,
  2315. <see cref="T:System.Xml.XmlReader" />
  2316. or
  2317. <see cref="T:System.IO.TextReader" />
  2318. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2319. </exception><exception cref="T:System.ObjectDisposedException">
  2320. The
  2321. <see cref="T:System.IO.Stream" />
  2322. ,
  2323. <see cref="T:System.Xml.XmlReader" />
  2324. or
  2325. <see cref="T:System.IO.TextReader" />
  2326. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2327. </exception>
  2328. </member>
  2329. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(System.AsyncCallback,System.Object)">
  2330. <param name="callback">
  2331. An
  2332. <see cref="T:System.AsyncCallback" />
  2333. delegate that is invoked when the command's execution has completed. Pass
  2334. <see langword="null" />
  2335. (
  2336. <see langword="Nothing" />
  2337. in Microsoft Visual Basic) to indicate that no callback is required.
  2338. </param><param name="stateObject">
  2339. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2340. <see cref="P:System.IAsyncResult.AsyncState" />
  2341. property.
  2342. </param><summary>
  2343. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2344. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2345. , given a callback procedure and state information.
  2346. </summary><returns>
  2347. An
  2348. <see cref="T:System.IAsyncResult" />
  2349. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2350. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  2351. , which returns the number of affected rows.
  2352. </returns><remarks>
  2353. <format type="text/markdown"><![CDATA[
  2354. ## Remarks
  2355. 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.
  2356. 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.
  2357. 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.
  2358. 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.
  2359. 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.
  2360. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2361. ## Examples
  2362. 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).
  2363. 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.
  2364. 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.
  2365. [!code-csharp[DataWorks SqlCommand_BeginExecuteNonQueryForm#1](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteNonQueryForm.cs)]
  2366. ]]></format>
  2367. </remarks><exception cref="T:System.InvalidCastException">
  2368. A
  2369. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2370. other than **Binary** or **VarBinary** was used when
  2371. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2372. was set to
  2373. <see cref="T:System.IO.Stream" />
  2374. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2375. -or-
  2376. A
  2377. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2378. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2379. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2380. was set to
  2381. <see cref="T:System.IO.TextReader" />
  2382. .
  2383. -or-
  2384. A
  2385. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2386. other than **Xml** was used when
  2387. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2388. was set to
  2389. <see cref="T:System.Xml.XmlReader" />
  2390. .
  2391. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2392. Any error that occurred while executing the command text.
  2393. -or-
  2394. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2395. </exception><exception cref="T:System.InvalidOperationException">
  2396. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2397. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2398. .
  2399. -or-
  2400. The
  2401. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2402. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2403. </exception>
  2404. </member>
  2405. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader">
  2406. <summary>
  2407. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2408. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2409. , and retrieves one or more result sets from the server.
  2410. </summary><returns>
  2411. An
  2412. <see cref="T:System.IAsyncResult" />
  2413. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2414. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2415. , which returns a
  2416. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2417. instance that can be used to retrieve the returned rows.
  2418. </returns><remarks>
  2419. <format type="text/markdown"><![CDATA[
  2420. ## Remarks
  2421. 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.
  2422. 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.
  2423. 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>.
  2424. 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.
  2425. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2426. ## Examples
  2427. 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.
  2428. [!code-csharp[SqlCommand_BeginExecuteReader#1](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReader.cs)]
  2429. ]]></format>
  2430. </remarks><exception cref="T:System.InvalidCastException">
  2431. A
  2432. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2433. other than **Binary** or **VarBinary** was used when
  2434. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2435. was set to
  2436. <see cref="T:System.IO.Stream" />
  2437. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2438. -or-
  2439. A
  2440. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2441. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2442. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2443. was set to
  2444. <see cref="T:System.IO.TextReader" />
  2445. .
  2446. -or-
  2447. A
  2448. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2449. other than **Xml** was used when
  2450. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2451. was set to
  2452. <see cref="T:System.Xml.XmlReader" />
  2453. .
  2454. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2455. Any error that occurred while executing the command text.
  2456. -or-
  2457. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2458. </exception><exception cref="T:System.InvalidOperationException">
  2459. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2460. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2461. .
  2462. -or-
  2463. The
  2464. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2465. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2466. </exception><exception cref="T:System.IO.IOException">
  2467. An error occurred in a
  2468. <see cref="T:System.IO.Stream" />
  2469. ,
  2470. <see cref="T:System.Xml.XmlReader" />
  2471. or
  2472. <see cref="T:System.IO.TextReader" />
  2473. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2474. </exception><exception cref="T:System.ObjectDisposedException">
  2475. The
  2476. <see cref="T:System.IO.Stream" />
  2477. ,
  2478. <see cref="T:System.Xml.XmlReader" />
  2479. or
  2480. <see cref="T:System.IO.TextReader" />
  2481. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2482. </exception>
  2483. </member>
  2484. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.AsyncCallback,System.Object)">
  2485. <param name="callback">
  2486. An
  2487. <see cref="T:System.AsyncCallback" />
  2488. delegate that is invoked when the command's execution has completed. Pass
  2489. <see langword="null" />
  2490. (
  2491. <see langword="Nothing" />
  2492. in Microsoft Visual Basic) to indicate that no callback is required.
  2493. </param><param name="stateObject">
  2494. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2495. <see cref="P:System.IAsyncResult.AsyncState" />
  2496. property.
  2497. </param><summary>
  2498. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2499. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2500. and retrieves one or more result sets from the server, given a callback procedure and state information.
  2501. </summary><returns>
  2502. An
  2503. <see cref="T:System.IAsyncResult" />
  2504. that can be used to poll, wait for results, or both; this value is also needed when invoking
  2505. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2506. , which returns a
  2507. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2508. instance which can be used to retrieve the returned rows.
  2509. </returns><remarks>
  2510. <format type="text/markdown"><![CDATA[
  2511. ## Remarks
  2512. 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.
  2513. 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.
  2514. 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.
  2515. 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.
  2516. 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.
  2517. 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.
  2518. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2519. ## Examples
  2520. 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>.
  2521. 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.
  2522. 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.
  2523. [!code-csharp[SqlCommand_BeginExecuteReaderAsync.cs](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsync.cs)]
  2524. ]]></format>
  2525. </remarks><exception cref="T:System.InvalidCastException">
  2526. A
  2527. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2528. other than **Binary** or **VarBinary** was used when
  2529. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2530. was set to
  2531. <see cref="T:System.IO.Stream" />
  2532. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2533. -or-
  2534. A
  2535. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2536. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2537. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2538. was set to
  2539. <see cref="T:System.IO.TextReader" />
  2540. .
  2541. -or-
  2542. A
  2543. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2544. other than **Xml** was used when
  2545. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2546. was set to
  2547. <see cref="T:System.Xml.XmlReader" />
  2548. .
  2549. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2550. Any error that occurred while executing the command text.
  2551. -or-
  2552. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2553. </exception><exception cref="T:System.InvalidOperationException">
  2554. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2555. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2556. .
  2557. -or-
  2558. The
  2559. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2560. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2561. </exception><exception cref="T:System.IO.IOException">
  2562. An error occurred in a
  2563. <see cref="T:System.IO.Stream" />
  2564. ,
  2565. <see cref="T:System.Xml.XmlReader" />
  2566. or
  2567. <see cref="T:System.IO.TextReader" />
  2568. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2569. </exception><exception cref="T:System.ObjectDisposedException">
  2570. The
  2571. <see cref="T:System.IO.Stream" />
  2572. ,
  2573. <see cref="T:System.Xml.XmlReader" />
  2574. or
  2575. <see cref="T:System.IO.TextReader" />
  2576. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2577. </exception>
  2578. </member>
  2579. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.AsyncCallback,System.Object,System.Data.CommandBehavior)">
  2580. <param name="callback">
  2581. An
  2582. <see cref="T:System.AsyncCallback" />
  2583. delegate that is invoked when the command's execution has completed. Pass
  2584. <see langword="null" />
  2585. (
  2586. <see langword="Nothing" />
  2587. in Microsoft Visual Basic) to indicate that no callback is required.
  2588. </param><param name="stateObject">
  2589. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2590. <see cref="P:System.IAsyncResult.AsyncState" />
  2591. property.
  2592. </param><param name="behavior">
  2593. One of the
  2594. <see cref="T:System.Data.CommandBehavior" />
  2595. values, indicating options for statement execution and data retrieval.
  2596. </param><summary>
  2597. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2598. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2599. , using one of the
  2600. <see langword="CommandBehavior" />
  2601. values, and retrieving one or more result sets from the server, given a callback procedure and state information.
  2602. </summary><returns>
  2603. An
  2604. <see cref="T:System.IAsyncResult" />
  2605. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2606. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2607. , which returns a
  2608. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2609. instance which can be used to retrieve the returned rows.
  2610. </returns><remarks>
  2611. <format type="text/markdown"><![CDATA[
  2612. ## Remarks
  2613. 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.
  2614. 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.
  2615. 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.
  2616. 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.
  2617. 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.
  2618. 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.
  2619. 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.
  2620. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2621. ## Examples
  2622. 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>.
  2623. 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.
  2624. 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.
  2625. 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.
  2626. [!code-csharp[SqlCommand_BeginExecuteReaderAsyncBehavior](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs)]
  2627. ]]></format>
  2628. </remarks><exception cref="T:System.InvalidCastException">
  2629. A
  2630. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2631. other than **Binary** or **VarBinary** was used when
  2632. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2633. was set to
  2634. <see cref="T:System.IO.Stream" />
  2635. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2636. -or-
  2637. A
  2638. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2639. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2640. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2641. was set to
  2642. <see cref="T:System.IO.TextReader" />
  2643. .
  2644. -or-
  2645. A
  2646. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2647. other than **Xml** was used when
  2648. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2649. was set to
  2650. <see cref="T:System.Xml.XmlReader" />
  2651. .
  2652. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2653. Any error that occurred while executing the command text.
  2654. -or-
  2655. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2656. </exception><exception cref="T:System.InvalidOperationException">
  2657. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2658. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2659. .
  2660. -or-
  2661. The
  2662. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2663. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2664. </exception><exception cref="T:System.IO.IOException">
  2665. An error occurred in a
  2666. <see cref="T:System.IO.Stream" />
  2667. ,
  2668. <see cref="T:System.Xml.XmlReader" />
  2669. or
  2670. <see cref="T:System.IO.TextReader" />
  2671. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2672. </exception><exception cref="T:System.ObjectDisposedException">
  2673. The
  2674. <see cref="T:System.IO.Stream" />
  2675. ,
  2676. <see cref="T:System.Xml.XmlReader" />
  2677. or
  2678. <see cref="T:System.IO.TextReader" />
  2679. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2680. </exception>
  2681. </member>
  2682. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader(System.Data.CommandBehavior)">
  2683. <param name="behavior">
  2684. One of the
  2685. <see cref="T:System.Data.CommandBehavior" />
  2686. values, indicating options for statement execution and data retrieval.
  2687. </param><summary>
  2688. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2689. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2690. using one of the
  2691. <see cref="T:System.Data.CommandBehavior" />
  2692. values.
  2693. </summary><returns>
  2694. An
  2695. <see cref="T:System.IAsyncResult" />
  2696. that can be used to poll, wait for results, or both; this value is also needed when invoking
  2697. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  2698. , which returns a
  2699. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  2700. instance that can be used to retrieve the returned rows.
  2701. </returns><remarks>
  2702. <format type="text/markdown"><![CDATA[
  2703. ## Remarks
  2704. 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.
  2705. 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.
  2706. 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.
  2707. 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>.
  2708. 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.
  2709. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2710. ## Examples
  2711. 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.
  2712. 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.
  2713. [!code-csharp[SqlCommand_BeginExecuteReaderAsyncSimple](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteReaderAsyncSimple.cs)]
  2714. ]]></format>
  2715. </remarks><exception cref="T:System.InvalidCastException">
  2716. A
  2717. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2718. other than **Binary** or **VarBinary** was used when
  2719. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2720. was set to
  2721. <see cref="T:System.IO.Stream" />
  2722. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2723. -or-
  2724. A
  2725. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2726. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2727. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2728. was set to
  2729. <see cref="T:System.IO.TextReader" />
  2730. .
  2731. -or-
  2732. A
  2733. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2734. other than **Xml** was used when
  2735. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2736. was set to
  2737. <see cref="T:System.Xml.XmlReader" />
  2738. .
  2739. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2740. Any error that occurred while executing the command text.
  2741. -or-
  2742. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2743. </exception><exception cref="T:System.InvalidOperationException">
  2744. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2745. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2746. .
  2747. -or-
  2748. The
  2749. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2750. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2751. </exception><exception cref="T:System.IO.IOException">
  2752. An error occurred in a
  2753. <see cref="T:System.IO.Stream" />
  2754. ,
  2755. <see cref="T:System.Xml.XmlReader" />
  2756. or
  2757. <see cref="T:System.IO.TextReader" />
  2758. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2759. </exception><exception cref="T:System.ObjectDisposedException">
  2760. The
  2761. <see cref="T:System.IO.Stream" />
  2762. ,
  2763. <see cref="T:System.Xml.XmlReader" />
  2764. or
  2765. <see cref="T:System.IO.TextReader" />
  2766. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2767. </exception>
  2768. </member>
  2769. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader">
  2770. <summary>
  2771. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2772. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2773. and returns results as an
  2774. <see cref="T:System.Xml.XmlReader" />
  2775. object.
  2776. </summary><returns>
  2777. An
  2778. <see cref="T:System.IAsyncResult" />
  2779. that can be used to poll or wait for results, or both; this value is also needed when invoking
  2780. <see langword="EndExecuteXmlReader" />
  2781. , which returns a single XML value.
  2782. </returns><remarks>
  2783. <format type="text/markdown"><![CDATA[
  2784. ## Remarks
  2785. 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.
  2786. 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.
  2787. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> query can be formatted as in the following C# example:
  2788. ```csharp
  2789. SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM dbo.Contact FOR XML AUTO, XMLDATA", SqlConn);
  2790. ```
  2791. 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.
  2792. The multiple active result set (MARS) feature lets multiple actions use the same connection.
  2793. 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.
  2794. 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>.
  2795. 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.
  2796. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2797. ## Examples
  2798. 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.
  2799. [!code-csharp[SqlCommand_BeginExecuteXmlReader#1]((~/../sqlclient/doc/samples/SqlCommand_BeginExecuteXmlReader.cs)]
  2800. ]]></format>
  2801. </remarks><exception cref="T:System.InvalidCastException">
  2802. A
  2803. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2804. other than **Binary** or **VarBinary** was used when
  2805. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2806. was set to
  2807. <see cref="T:System.IO.Stream" />
  2808. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2809. -or-
  2810. A
  2811. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2812. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2813. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2814. was set to
  2815. <see cref="T:System.IO.TextReader" />
  2816. .
  2817. -or-
  2818. A
  2819. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2820. other than **Xml** was used when
  2821. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2822. was set to
  2823. <see cref="T:System.Xml.XmlReader" />
  2824. .
  2825. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2826. Any error that occurred while executing the command text.
  2827. -or-
  2828. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2829. </exception><exception cref="T:System.InvalidOperationException">
  2830. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2831. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2832. .
  2833. -or-
  2834. The
  2835. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2836. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2837. </exception><exception cref="T:System.IO.IOException">
  2838. An error occurred in a
  2839. <see cref="T:System.IO.Stream" />
  2840. ,
  2841. <see cref="T:System.Xml.XmlReader" />
  2842. or
  2843. <see cref="T:System.IO.TextReader" />
  2844. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2845. </exception><exception cref="T:System.ObjectDisposedException">
  2846. The
  2847. <see cref="T:System.IO.Stream" />
  2848. ,
  2849. <see cref="T:System.Xml.XmlReader" />
  2850. or
  2851. <see cref="T:System.IO.TextReader" />
  2852. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2853. </exception>
  2854. </member>
  2855. <member name="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader(System.AsyncCallback,System.Object)">
  2856. <param name="callback">
  2857. An
  2858. <see cref="T:System.AsyncCallback" />
  2859. delegate that is invoked when the command's execution has completed. Pass
  2860. <see langword="null" />
  2861. (
  2862. <see langword="Nothing" />
  2863. in Microsoft Visual Basic) to indicate that no callback is required.
  2864. </param><param name="stateObject">
  2865. A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the
  2866. <see cref="P:System.IAsyncResult.AsyncState" />
  2867. property.
  2868. </param><summary>
  2869. Initiates the asynchronous execution of the Transact-SQL statement or stored procedure that is described by this
  2870. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2871. and returns results as an
  2872. <see cref="T:System.Xml.XmlReader" />
  2873. object, using a callback procedure.
  2874. </summary><returns>
  2875. An
  2876. <see cref="T:System.IAsyncResult" />
  2877. that can be used to poll, wait for results, or both; this value is also needed when the
  2878. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  2879. is called, which returns the results of the command as XML.
  2880. </returns><remarks>
  2881. <format type="text/markdown"><![CDATA[
  2882. ## Remarks
  2883. 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.
  2884. 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.
  2885. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A> query can be formatted as in the following C# example:
  2886. ```csharp
  2887. SqlCommand command = new SqlCommand("SELECT ContactID, FirstName, LastName FROM Contact FOR XML AUTO, XMLDATA", SqlConn);
  2888. ```
  2889. 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.
  2890. The multiple active result set (MARS) feature lets multiple actions use the same connection.
  2891. 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.
  2892. 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.
  2893. 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.
  2894. 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.
  2895. This method ignores the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> property.
  2896. ## Examples
  2897. 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>.
  2898. 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.
  2899. 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.
  2900. [!code-csharp[SqlCommand_BeginExecuteXmlReaderAsync](~/../sqlclient/doc/samples/SqlCommand_BeginExecuteXmlReaderAsync.cs)]
  2901. ]]></format>
  2902. </remarks><exception cref="T:System.InvalidCastException">
  2903. A
  2904. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2905. other than **Binary** or **VarBinary** was used when
  2906. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2907. was set to
  2908. <see cref="T:System.IO.Stream" />
  2909. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2910. -or-
  2911. A
  2912. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2913. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  2914. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2915. was set to
  2916. <see cref="T:System.IO.TextReader" />
  2917. .
  2918. -or-
  2919. A
  2920. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  2921. other than **Xml** was used when
  2922. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  2923. was set to
  2924. <see cref="T:System.Xml.XmlReader" />
  2925. .
  2926. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  2927. Any error that occurred while executing the command text.
  2928. -or-
  2929. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2930. </exception><exception cref="T:System.InvalidOperationException">
  2931. The name/value pair "Asynchronous Processing=true" was not included within the connection string defining the connection for this
  2932. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2933. .
  2934. -or-
  2935. The
  2936. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  2937. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2938. </exception><exception cref="T:System.IO.IOException">
  2939. An error occurred in a
  2940. <see cref="T:System.IO.Stream" />
  2941. ,
  2942. <see cref="T:System.Xml.XmlReader" />
  2943. or
  2944. <see cref="T:System.IO.TextReader" />
  2945. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2946. </exception><exception cref="T:System.ObjectDisposedException">
  2947. The
  2948. <see cref="T:System.IO.Stream" />
  2949. ,
  2950. <see cref="T:System.Xml.XmlReader" />
  2951. or
  2952. <see cref="T:System.IO.TextReader" />
  2953. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  2954. </exception><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" /><altmember cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  2955. </member>
  2956. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Cancel">
  2957. <summary>
  2958. Tries to cancel the execution of a
  2959. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2960. .
  2961. </summary><remarks>
  2962. <format type="text/markdown"><![CDATA[
  2963. ## Remarks
  2964. 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.
  2965. 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.
  2966. ## Examples
  2967. The following example demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.Cancel%2A> method.
  2968. [!code-csharp[SqlCommand_Cancel](~/../sqlclient/doc/samples/WebData SqlCommand_Cancel.cs)]
  2969. ]]></format>
  2970. </remarks>
  2971. </member>
  2972. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Clone">
  2973. <summary>
  2974. Creates a new
  2975. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2976. object that is a copy of the current instance.
  2977. </summary><returns>
  2978. A new
  2979. <see cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  2980. object that is a copy of this instance.
  2981. </returns><remarks>
  2982. To be added.
  2983. </remarks>
  2984. </member>
  2985. <member name="M:Microsoft.Data.SqlClient.SqlCommand.CreateDbParameter">
  2986. <summary>
  2987. To be added.
  2988. </summary><returns>
  2989. To be added.
  2990. </returns><remarks>
  2991. To be added.
  2992. </remarks>
  2993. </member>
  2994. <member name="M:Microsoft.Data.SqlClient.SqlCommand.CreateParameter">
  2995. <summary>
  2996. Creates a new instance of a
  2997. <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />
  2998. object.
  2999. </summary><returns>
  3000. A
  3001. <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />
  3002. object.
  3003. </returns><remarks>
  3004. <format type="text/markdown"><![CDATA[
  3005. ## Remarks
  3006. The <xref:Microsoft.Data.SqlClient.SqlCommand.CreateParameter%2A> method is a strongly-typed version of <xref:System.Data.IDbCommand.CreateParameter%2A>.
  3007. ]]></format>
  3008. </remarks><summary>
  3009. Creates a new instance of a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  3010. </summary><returns>
  3011. A <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.
  3012. </returns><remarks>
  3013. To be added.
  3014. </remarks>
  3015. </member>
  3016. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)">
  3017. <param name="asyncResult">
  3018. The
  3019. <see cref="T:System.IAsyncResult" />
  3020. returned by the call to
  3021. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3022. .
  3023. </param><summary>
  3024. Finishes asynchronous execution of a Transact-SQL statement.
  3025. </summary><returns>
  3026. The number of rows affected (the same behavior as
  3027. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery" />
  3028. ).
  3029. </returns><remarks>
  3030. <format type="text/markdown"><![CDATA[
  3031. ## Remarks
  3032. 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.
  3033. ## Examples
  3034. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery>.
  3035. ]]></format>
  3036. </remarks><exception cref="T:System.ArgumentException">
  3037. <paramref name="asyncResult" />
  3038. parameter is null (
  3039. <see langword="Nothing" />
  3040. in Microsoft Visual Basic)
  3041. </exception><exception cref="T:System.InvalidOperationException">
  3042. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3043. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3044. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3045. to complete execution of a call to
  3046. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3047. .
  3048. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3049. The amount of time specified in
  3050. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" />
  3051. elapsed and the asynchronous operation specified with
  3052. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3053. is not complete.
  3054. -or-
  3055. In some situations,
  3056. <see cref="T:System.IAsyncResult" />
  3057. can be set to
  3058. <see langword="IsCompleted" />
  3059. incorrectly. If this occurs and
  3060. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult)" />
  3061. is called, EndExecuteNonQuery could raise a SqlException error if the amount of time specified in
  3062. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" />
  3063. elapsed and the asynchronous operation specified with
  3064. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3065. 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.
  3066. </exception>
  3067. </member>
  3068. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)">
  3069. <param name="asyncResult">
  3070. The
  3071. <see cref="T:System.IAsyncResult" />
  3072. returned by the call to
  3073. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader" />
  3074. .
  3075. </param><summary>
  3076. Finishes asynchronous execution of a Transact-SQL statement, returning the requested
  3077. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3078. .
  3079. </summary><returns>
  3080. A
  3081. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3082. object that can be used to retrieve the requested rows.
  3083. </returns><remarks>
  3084. <format type="text/markdown"><![CDATA[
  3085. ## Remarks
  3086. 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.
  3087. ## Examples
  3088. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteReader%2A>.
  3089. ]]></format>
  3090. </remarks><exception cref="T:System.ArgumentException">
  3091. <paramref name="asyncResult" />
  3092. parameter is null (
  3093. <see langword="Nothing" />
  3094. in Microsoft Visual Basic)
  3095. </exception><exception cref="T:System.InvalidOperationException">
  3096. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3097. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3098. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteReader(System.IAsyncResult)" />
  3099. to complete execution of a call to
  3100. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3101. .
  3102. </exception>
  3103. </member>
  3104. <member name="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)">
  3105. <param name="asyncResult">
  3106. The
  3107. <see cref="T:System.IAsyncResult" />
  3108. returned by the call to
  3109. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader" />
  3110. .
  3111. </param><summary>
  3112. Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.
  3113. </summary><returns>
  3114. An
  3115. <see cref="T:System.Xml.XmlReader" />
  3116. object that can be used to fetch the resulting XML data.
  3117. </returns><remarks>
  3118. <format type="text/markdown"><![CDATA[
  3119. ## Remarks
  3120. 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.
  3121. ## Examples
  3122. For examples demonstrating the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader%2A> method, see <xref:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteXmlReader%2A>.
  3123. ]]></format>
  3124. </remarks><exception cref="T:System.ArgumentException">
  3125. <paramref name="asyncResult" />
  3126. parameter is null (
  3127. <see langword="Nothing" />
  3128. in Microsoft Visual Basic)
  3129. </exception><exception cref="T:System.InvalidOperationException">
  3130. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3131. was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called
  3132. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.EndExecuteXmlReader(System.IAsyncResult)" />
  3133. to complete execution of a call to
  3134. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.BeginExecuteNonQuery" />
  3135. .
  3136. </exception>
  3137. </member>
  3138. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(System.Data.CommandBehavior)">
  3139. <param name="behavior">
  3140. To be added.
  3141. </param><summary>
  3142. To be added.
  3143. </summary><returns>
  3144. To be added.
  3145. </returns><remarks>
  3146. To be added.
  3147. </remarks>
  3148. </member>
  3149. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)">
  3150. <param name="behavior">
  3151. To be added.
  3152. </param><param name="cancellationToken">
  3153. To be added.
  3154. </param><summary>
  3155. To be added.
  3156. </summary><returns>
  3157. To be added.
  3158. </returns><remarks>
  3159. To be added.
  3160. </remarks>
  3161. </member>
  3162. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery">
  3163. <summary>
  3164. Executes a Transact-SQL statement against the connection and returns the number of rows affected.
  3165. </summary><returns>
  3166. The number of rows affected.
  3167. </returns><remarks>
  3168. <format type="text/markdown"><![CDATA[
  3169. ## Remarks
  3170. 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.
  3171. 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.
  3172. 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.
  3173. 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.
  3174. 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.
  3175. 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.
  3176. ## Examples
  3177. 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.
  3178. [!code-csharp[SqlCommand_ExecuteNonQuery](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs)]
  3179. ]]></format>
  3180. </remarks><exception cref="T:System.InvalidCastException">
  3181. A
  3182. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3183. other than **Binary** or **VarBinary** was used when
  3184. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3185. was set to
  3186. <see cref="T:System.IO.Stream" />
  3187. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3188. -or-
  3189. A
  3190. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3191. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3192. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3193. was set to
  3194. <see cref="T:System.IO.TextReader" />
  3195. .
  3196. -or-
  3197. A
  3198. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3199. other than **Xml** was used when
  3200. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3201. was set to
  3202. <see cref="T:System.Xml.XmlReader" />
  3203. .
  3204. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3205. 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.
  3206. -or-
  3207. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3208. </exception><exception cref="T:System.IO.IOException">
  3209. An error occurred in a
  3210. <see cref="T:System.IO.Stream" />
  3211. ,
  3212. <see cref="T:System.Xml.XmlReader" />
  3213. or
  3214. <see cref="T:System.IO.TextReader" />
  3215. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3216. </exception><exception cref="T:System.InvalidOperationException">
  3217. The
  3218. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3219. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3220. </exception><exception cref="T:System.ObjectDisposedException">
  3221. The
  3222. <see cref="T:System.IO.Stream" />
  3223. ,
  3224. <see cref="T:System.Xml.XmlReader" />
  3225. or
  3226. <see cref="T:System.IO.TextReader" />
  3227. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3228. </exception>
  3229. </member>
  3230. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(System.Threading.CancellationToken)">
  3231. <param name="cancellationToken">
  3232. The cancellation instruction.
  3233. </param><summary>
  3234. An asynchronous version of
  3235. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery" />
  3236. , 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.
  3237. </summary><returns>
  3238. A task representing the asynchronous operation.
  3239. </returns><remarks>
  3240. <format type="text/markdown"><![CDATA[
  3241. ## Remarks
  3242. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3243. ]]></format>
  3244. </remarks><exception cref="T:System.InvalidCastException">
  3245. A
  3246. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3247. other than **Binary** or **VarBinary** was used when
  3248. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3249. was set to
  3250. <see cref="T:System.IO.Stream" />
  3251. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3252. -or-
  3253. A
  3254. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3255. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3256. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3257. was set to
  3258. <see cref="T:System.IO.TextReader" />
  3259. .
  3260. -or-
  3261. A
  3262. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3263. other than **Xml** was used when
  3264. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3265. was set to
  3266. <see cref="T:System.Xml.XmlReader" />
  3267. .
  3268. </exception><exception cref="T:System.InvalidOperationException">
  3269. Calling
  3270. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(System.Threading.CancellationToken)" />
  3271. more than once for the same instance before task completion.
  3272. -or-
  3273. The
  3274. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3275. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3276. -or-
  3277. <see langword="Context Connection=true" />
  3278. is specified in the connection string.
  3279. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3280. SQL Server returned an error while executing the command text.
  3281. -or-
  3282. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3283. </exception><exception cref="T:System.IO.IOException">
  3284. An error occurred in a
  3285. <see cref="T:System.IO.Stream" />
  3286. ,
  3287. <see cref="T:System.Xml.XmlReader" />
  3288. or
  3289. <see cref="T:System.IO.TextReader" />
  3290. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3291. </exception><exception cref="T:System.ObjectDisposedException">
  3292. The
  3293. <see cref="T:System.IO.Stream" />
  3294. ,
  3295. <see cref="T:System.Xml.XmlReader" />
  3296. or
  3297. <see cref="T:System.IO.TextReader" />
  3298. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3299. </exception>
  3300. </member>
  3301. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader">
  3302. <summary>
  3303. Sends the
  3304. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3305. to the
  3306. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3307. and builds a
  3308. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3309. .
  3310. </summary><returns>
  3311. A
  3312. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3313. object.
  3314. </returns><remarks>
  3315. <format type="text/markdown"><![CDATA[
  3316. ## Remarks
  3317. 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>.
  3318. > [!NOTE]
  3319. > If a transaction is deadlocked, an exception may not be thrown until <xref:Microsoft.Data.SqlClient.SqlDataReader.Read%2A> is called.
  3320. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  3321. 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.
  3322. ## Examples
  3323. 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.
  3324. [!code-csharp[SqlCommand_ExecuteReader](~/../sqlclient/doc/samples/SqlCommand_ExecuteReader.cs)]
  3325. ]]></format>
  3326. </remarks><exception cref="T:System.InvalidCastException">
  3327. A
  3328. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3329. other than **Binary** or **VarBinary** was used when
  3330. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3331. was set to
  3332. <see cref="T:System.IO.Stream" />
  3333. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3334. -or-
  3335. A
  3336. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3337. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3338. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3339. was set to
  3340. <see cref="T:System.IO.TextReader" />
  3341. .
  3342. -or-
  3343. A
  3344. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3345. other than **Xml** was used when
  3346. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3347. was set to
  3348. <see cref="T:System.Xml.XmlReader" />
  3349. .
  3350. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3351. 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.
  3352. -or-
  3353. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3354. </exception><exception cref="T:System.InvalidOperationException">
  3355. The current state of the connection is closed.
  3356. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  3357. requires an open
  3358. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3359. .
  3360. -or-
  3361. The
  3362. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3363. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3364. </exception><exception cref="T:System.IO.IOException">
  3365. An error occurred in a
  3366. <see cref="T:System.IO.Stream" />
  3367. ,
  3368. <see cref="T:System.Xml.XmlReader" />
  3369. or
  3370. <see cref="T:System.IO.TextReader" />
  3371. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3372. </exception><exception cref="T:System.ObjectDisposedException">
  3373. The
  3374. <see cref="T:System.IO.Stream" />
  3375. ,
  3376. <see cref="T:System.Xml.XmlReader" />
  3377. or
  3378. <see cref="T:System.IO.TextReader" />
  3379. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3380. </exception>
  3381. </member>
  3382. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)">
  3383. <param name="behavior">
  3384. One of the
  3385. <see cref="T:System.Data.CommandBehavior" />
  3386. values.
  3387. </param><summary>
  3388. Sends the
  3389. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3390. to the
  3391. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3392. , and builds a
  3393. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3394. using one of the
  3395. <see cref="T:System.Data.CommandBehavior" />
  3396. values.
  3397. </summary><returns>
  3398. A
  3399. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3400. object.
  3401. </returns><remarks>
  3402. <format type="text/markdown"><![CDATA[
  3403. ## Remarks
  3404. 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>.
  3405. > [!NOTE]
  3406. > 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.
  3407. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  3408. 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.
  3409. ## Examples
  3410. 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>.
  3411. [!code-csharp[SqlCommand_ExecuteReader2](~/../sqlclient/doc/samples/SqlCommand_ExecuteReader2.cs#1)]
  3412. ]]></format>
  3413. </remarks><exception cref="T:System.InvalidCastException">
  3414. A
  3415. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3416. other than **Binary** or **VarBinary** was used when
  3417. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3418. was set to
  3419. <see cref="T:System.IO.Stream" />
  3420. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3421. -or-
  3422. A
  3423. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3424. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3425. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3426. was set to
  3427. <see cref="T:System.IO.TextReader" />
  3428. .
  3429. -or-
  3430. A
  3431. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3432. other than **Xml** was used when
  3433. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3434. was set to
  3435. <see cref="T:System.Xml.XmlReader" />
  3436. .
  3437. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3438. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3439. </exception><exception cref="T:System.IO.IOException">
  3440. An error occurred in a
  3441. <see cref="T:System.IO.Stream" />
  3442. ,
  3443. <see cref="T:System.Xml.XmlReader" />
  3444. or
  3445. <see cref="T:System.IO.TextReader" />
  3446. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3447. </exception><exception cref="T:System.InvalidOperationException">
  3448. The
  3449. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3450. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3451. </exception><exception cref="T:System.ObjectDisposedException">
  3452. The
  3453. <see cref="T:System.IO.Stream" />
  3454. ,
  3455. <see cref="T:System.Xml.XmlReader" />
  3456. or
  3457. <see cref="T:System.IO.TextReader" />
  3458. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3459. </exception>
  3460. </member>
  3461. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync">
  3462. <summary>
  3463. An asynchronous version of
  3464. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  3465. , which sends the
  3466. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3467. to the
  3468. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3469. and builds a
  3470. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3471. . Exceptions will be reported via the returned Task object.
  3472. </summary><returns>
  3473. A task representing the asynchronous operation.
  3474. </returns><remarks>
  3475. <format type="text/markdown"><![CDATA[
  3476. ## Remarks
  3477. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3478. ]]></format>
  3479. </remarks><exception cref="T:System.InvalidCastException">
  3480. A
  3481. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3482. other than **Binary** or **VarBinary** was used when
  3483. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3484. was set to
  3485. <see cref="T:System.IO.Stream" />
  3486. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3487. -or-
  3488. A
  3489. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3490. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3491. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3492. was set to
  3493. <see cref="T:System.IO.TextReader" />
  3494. .
  3495. -or-
  3496. A
  3497. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3498. other than **Xml** was used when
  3499. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3500. was set to
  3501. <see cref="T:System.Xml.XmlReader" />
  3502. .
  3503. </exception><exception cref="T:System.ArgumentException">
  3504. An invalid
  3505. <see cref="T:System.Data.CommandBehavior" />
  3506. value.
  3507. </exception><exception cref="T:System.InvalidOperationException">
  3508. Calling
  3509. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync" />
  3510. more than once for the same instance before task completion.
  3511. -or-
  3512. The
  3513. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3514. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3515. -or-
  3516. <see langword="Context Connection=true" />
  3517. is specified in the connection string.
  3518. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3519. SQL Server returned an error while executing the command text.
  3520. -or-
  3521. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3522. </exception><exception cref="T:System.IO.IOException">
  3523. An error occurred in a
  3524. <see cref="T:System.IO.Stream" />
  3525. ,
  3526. <see cref="T:System.Xml.XmlReader" />
  3527. or
  3528. <see cref="T:System.IO.TextReader" />
  3529. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3530. </exception><exception cref="T:System.ObjectDisposedException">
  3531. The
  3532. <see cref="T:System.IO.Stream" />
  3533. ,
  3534. <see cref="T:System.Xml.XmlReader" />
  3535. or
  3536. <see cref="T:System.IO.TextReader" />
  3537. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3538. </exception>
  3539. </member>
  3540. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior)">
  3541. <param name="behavior">
  3542. Options for statement execution and data retrieval. When is set to
  3543. <see langword="Default" />
  3544. ,
  3545. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" />
  3546. reads the entire row before returning a complete Task.
  3547. </param><summary>
  3548. An asynchronous version of
  3549. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)" />
  3550. , which sends the
  3551. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3552. to the
  3553. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3554. , and builds a
  3555. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3556. . Exceptions will be reported via the returned Task object.
  3557. </summary><returns>
  3558. A task representing the asynchronous operation.
  3559. </returns><remarks>
  3560. <format type="text/markdown"><![CDATA[
  3561. ## Remarks
  3562. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3563. ]]></format>
  3564. </remarks><exception cref="T:System.InvalidCastException">
  3565. A
  3566. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3567. other than **Binary** or **VarBinary** was used when
  3568. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3569. was set to
  3570. <see cref="T:System.IO.Stream" />
  3571. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3572. -or-
  3573. A
  3574. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3575. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3576. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3577. was set to
  3578. <see cref="T:System.IO.TextReader" />
  3579. .
  3580. -or-
  3581. A
  3582. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3583. other than **Xml** was used when
  3584. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3585. was set to
  3586. <see cref="T:System.Xml.XmlReader" />
  3587. .
  3588. </exception><exception cref="T:System.ArgumentException">
  3589. An invalid
  3590. <see cref="T:System.Data.CommandBehavior" />
  3591. value.
  3592. </exception><exception cref="T:System.InvalidOperationException">
  3593. Calling
  3594. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior)" />
  3595. more than once for the same instance before task completion.
  3596. -or-
  3597. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3598. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3599. -or-
  3600. <see langword="Context Connection=true" />
  3601. is specified in the connection string.
  3602. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3603. SQL Server returned an error while executing the command text.
  3604. -or-
  3605. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3606. </exception><exception cref="T:System.IO.IOException">
  3607. An error occurred in a
  3608. <see cref="T:System.IO.Stream" />
  3609. ,
  3610. <see cref="T:System.Xml.XmlReader" />
  3611. or
  3612. <see cref="T:System.IO.TextReader" />
  3613. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3614. </exception><exception cref="T:System.ObjectDisposedException">
  3615. The
  3616. <see cref="T:System.IO.Stream" />
  3617. ,
  3618. <see cref="T:System.Xml.XmlReader" />
  3619. or
  3620. <see cref="T:System.IO.TextReader" />
  3621. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3622. </exception>
  3623. </member>
  3624. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)">
  3625. <param name="behavior">
  3626. Options for statement execution and data retrieval. When is set to
  3627. <see langword="Default" />
  3628. ,
  3629. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)" />
  3630. reads the entire row before returning a complete Task.
  3631. </param><param name="cancellationToken">
  3632. The cancellation instruction.
  3633. </param><summary>
  3634. An asynchronous version of
  3635. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(System.Data.CommandBehavior)" />
  3636. , which sends the
  3637. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3638. to the
  3639. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3640. , and builds a
  3641. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3642. 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.
  3643. </summary><returns>
  3644. A task representing the asynchronous operation.
  3645. </returns><remarks>
  3646. <format type="text/markdown"><![CDATA[
  3647. ## Remarks
  3648. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3649. ]]></format>
  3650. </remarks><exception cref="T:System.InvalidCastException">
  3651. A
  3652. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3653. other than **Binary** or **VarBinary** was used when
  3654. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3655. was set to
  3656. <see cref="T:System.IO.Stream" />
  3657. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3658. -or-
  3659. A
  3660. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3661. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3662. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3663. was set to
  3664. <see cref="T:System.IO.TextReader" />
  3665. .
  3666. -or-
  3667. A
  3668. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3669. other than **Xml** was used when
  3670. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3671. was set to
  3672. <see cref="T:System.Xml.XmlReader" />
  3673. .
  3674. </exception><exception cref="T:System.ArgumentException">
  3675. An invalid
  3676. <see cref="T:System.Data.CommandBehavior" />
  3677. value.
  3678. </exception><exception cref="T:System.InvalidOperationException">
  3679. Calling
  3680. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)" />
  3681. more than once for the same instance before task completion.
  3682. -or-
  3683. The
  3684. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3685. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3686. -or-
  3687. <see langword="Context Connection=true" />
  3688. is specified in the connection string.
  3689. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3690. SQL Server returned an error while executing the command text.
  3691. -or-
  3692. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3693. </exception><exception cref="T:System.IO.IOException">
  3694. An error occurred in a
  3695. <see cref="T:System.IO.Stream" />
  3696. ,
  3697. <see cref="T:System.Xml.XmlReader" />
  3698. or
  3699. <see cref="T:System.IO.TextReader" />
  3700. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3701. </exception><exception cref="T:System.ObjectDisposedException">
  3702. The
  3703. <see cref="T:System.IO.Stream" />
  3704. ,
  3705. <see cref="T:System.Xml.XmlReader" />
  3706. or
  3707. <see cref="T:System.IO.TextReader" />
  3708. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3709. </exception>
  3710. </member>
  3711. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Threading.CancellationToken)">
  3712. <param name="cancellationToken">
  3713. The cancellation instruction.
  3714. </param><summary>
  3715. An asynchronous version of
  3716. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReader" />
  3717. , which sends the
  3718. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3719. to the
  3720. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3721. and builds a
  3722. <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" />
  3723. .
  3724. 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.
  3725. </summary><returns>
  3726. A task representing the asynchronous operation.
  3727. </returns><remarks>
  3728. <format type="text/markdown">
  3729. <![CDATA[
  3730. ## Remarks
  3731. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3732. ]]>
  3733. </format>
  3734. </remarks><exception cref="T:System.InvalidCastException">
  3735. A
  3736. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3737. other than **Binary** or **VarBinary** was used when
  3738. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3739. was set to
  3740. <see cref="T:System.IO.Stream" />
  3741. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3742. -or-
  3743. A
  3744. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3745. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3746. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3747. was set to
  3748. <see cref="T:System.IO.TextReader" />
  3749. .
  3750. -or-
  3751. A
  3752. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3753. other than **Xml** was used when
  3754. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3755. was set to
  3756. <see cref="T:System.Xml.XmlReader" />
  3757. .
  3758. </exception><exception cref="T:System.ArgumentException">
  3759. An invalid
  3760. <see cref="T:System.Data.CommandBehavior" />
  3761. value.
  3762. </exception><exception cref="T:System.InvalidOperationException">
  3763. Calling
  3764. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteReaderAsync(System.Data.CommandBehavior,System.Threading.CancellationToken)" />
  3765. more than once for the same instance before task completion.
  3766. -or-
  3767. The
  3768. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3769. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3770. -or-
  3771. <see langword="Context Connection=true" />
  3772. is specified in the connection string.
  3773. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3774. SQL Server returned an error while executing the command text.
  3775. -or-
  3776. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3777. </exception><exception cref="T:System.IO.IOException">
  3778. An error occurred in a
  3779. <see cref="T:System.IO.Stream" />
  3780. ,
  3781. <see cref="T:System.Xml.XmlReader" />
  3782. or
  3783. <see cref="T:System.IO.TextReader" />
  3784. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3785. </exception><exception cref="T:System.ObjectDisposedException">
  3786. The
  3787. <see cref="T:System.IO.Stream" />
  3788. ,
  3789. <see cref="T:System.Xml.XmlReader" />
  3790. or
  3791. <see cref="T:System.IO.TextReader" />
  3792. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3793. </exception>
  3794. </member>
  3795. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar">
  3796. <summary>
  3797. 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.
  3798. </summary><returns>
  3799. The first column of the first row in the result set, or a null reference (
  3800. <see langword="Nothing" />
  3801. in Visual Basic) if the result set is empty. Returns a maximum of 2033 characters.
  3802. </returns><remarks>
  3803. <format type="text/markdown"><![CDATA[
  3804. ## Remarks
  3805. 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>.
  3806. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar%2A> query can be formatted as in the following C# example:
  3807. ```csharp
  3808. cmd.CommandText = "SELECT COUNT(*) FROM dbo.region";
  3809. Int32 count = (Int32) cmd.ExecuteScalar();
  3810. ```
  3811. ## Examples
  3812. 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.
  3813. [!code-csharp[SqlCommand.ExecuteScalar#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteScalar.cs#1)]
  3814. ]]></format>
  3815. </remarks><exception cref="T:System.InvalidCastException">
  3816. A
  3817. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3818. other than **Binary** or **VarBinary** was used when
  3819. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3820. was set to
  3821. <see cref="T:System.IO.Stream" />
  3822. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3823. -or-
  3824. A
  3825. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3826. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3827. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3828. was set to
  3829. <see cref="T:System.IO.TextReader" />
  3830. .
  3831. -or-
  3832. A
  3833. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3834. other than **Xml** was used when
  3835. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3836. was set to
  3837. <see cref="T:System.Xml.XmlReader" />
  3838. .
  3839. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3840. 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.
  3841. -or-
  3842. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3843. </exception><exception cref="T:System.InvalidOperationException">
  3844. The
  3845. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3846. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3847. </exception><exception cref="T:System.IO.IOException">
  3848. An error occurred in a
  3849. <see cref="T:System.IO.Stream" />
  3850. ,
  3851. <see cref="T:System.Xml.XmlReader" />
  3852. or
  3853. <see cref="T:System.IO.TextReader" />
  3854. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3855. </exception><exception cref="T:System.ObjectDisposedException">
  3856. The
  3857. <see cref="T:System.IO.Stream" />
  3858. ,
  3859. <see cref="T:System.Xml.XmlReader" />
  3860. or
  3861. <see cref="T:System.IO.TextReader" />
  3862. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3863. </exception>
  3864. </member>
  3865. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)">
  3866. <param name="cancellationToken">
  3867. The cancellation instruction.
  3868. </param><summary>
  3869. An asynchronous version of
  3870. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar" />
  3871. , 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.
  3872. 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.
  3873. </summary><returns>
  3874. A task representing the asynchronous operation.
  3875. </returns><remarks>
  3876. <format type="text/markdown"><![CDATA[
  3877. ## Remarks
  3878. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  3879. ]]></format>
  3880. </remarks><exception cref="T:System.InvalidCastException">
  3881. A
  3882. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3883. other than **Binary** or **VarBinary** was used when
  3884. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3885. was set to
  3886. <see cref="T:System.IO.Stream" />
  3887. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3888. -or-
  3889. A
  3890. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3891. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3892. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3893. was set to
  3894. <see cref="T:System.IO.TextReader" />
  3895. .
  3896. -or-
  3897. A
  3898. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3899. other than **Xml** was used when
  3900. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3901. was set to
  3902. <see cref="T:System.Xml.XmlReader" />
  3903. .
  3904. </exception><exception cref="T:System.InvalidOperationException">
  3905. Calling
  3906. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  3907. more than once for the same instance before task completion.
  3908. -or-
  3909. The
  3910. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3911. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3912. -or-
  3913. <see langword="Context Connection=true" />
  3914. is specified in the connection string.
  3915. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3916. SQL Server returned an error while executing the command text.
  3917. -or-
  3918. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3919. </exception><exception cref="T:System.IO.IOException">
  3920. An error occurred in a
  3921. <see cref="T:System.IO.Stream" />
  3922. ,
  3923. <see cref="T:System.Xml.XmlReader" />
  3924. or
  3925. <see cref="T:System.IO.TextReader" />
  3926. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3927. </exception><exception cref="T:System.ObjectDisposedException">
  3928. The
  3929. <see cref="T:System.IO.Stream" />
  3930. ,
  3931. <see cref="T:System.Xml.XmlReader" />
  3932. or
  3933. <see cref="T:System.IO.TextReader" />
  3934. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3935. </exception>
  3936. </member>
  3937. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader">
  3938. <summary>
  3939. Sends the
  3940. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  3941. to the
  3942. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  3943. and builds an
  3944. <see cref="T:System.Xml.XmlReader" />
  3945. object.
  3946. </summary><returns>
  3947. An
  3948. <see cref="T:System.Xml.XmlReader" />
  3949. object.
  3950. </returns><remarks>
  3951. <format type="text/markdown"><![CDATA[
  3952. ## Remarks
  3953. The **XmlReader** returned by this method does not support asynchronous operations.
  3954. 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.
  3955. A typical <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader%2A> query can be formatted as in the following Microsoft Visual C# example:
  3956. ```csharp
  3957. SqlCommand command = new SqlCommand("SELECT * FROM dbo.Customers FOR XML AUTO, XMLDATA", SqlConn);
  3958. ```
  3959. 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.
  3960. The multiple active result set (MARS) feature allows for multiple actions using the same connection.
  3961. 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.
  3962. ## Examples
  3963. 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.
  3964. [!code-csharp[SqlCommand_ExecuteXmlReader#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteXmlReader.cs#1)]
  3965. ]]></format>
  3966. </remarks><exception cref="T:System.InvalidCastException">
  3967. A
  3968. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3969. other than **Binary** or **VarBinary** was used when
  3970. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3971. was set to
  3972. <see cref="T:System.IO.Stream" />
  3973. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3974. -or-
  3975. A
  3976. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3977. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  3978. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3979. was set to
  3980. <see cref="T:System.IO.TextReader" />
  3981. .
  3982. -or-
  3983. A
  3984. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  3985. other than **Xml** was used when
  3986. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  3987. was set to
  3988. <see cref="T:System.Xml.XmlReader" />
  3989. .
  3990. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  3991. 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.
  3992. -or-
  3993. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3994. </exception><exception cref="T:System.InvalidOperationException">
  3995. The
  3996. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  3997. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  3998. </exception><exception cref="T:System.IO.IOException">
  3999. An error occurred in a
  4000. <see cref="T:System.IO.Stream" />
  4001. ,
  4002. <see cref="T:System.Xml.XmlReader" />
  4003. or
  4004. <see cref="T:System.IO.TextReader" />
  4005. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4006. </exception><exception cref="T:System.ObjectDisposedException">
  4007. The
  4008. <see cref="T:System.IO.Stream" />
  4009. ,
  4010. <see cref="T:System.Xml.XmlReader" />
  4011. or
  4012. <see cref="T:System.IO.TextReader" />
  4013. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4014. </exception>
  4015. </member>
  4016. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync">
  4017. <summary>
  4018. An asynchronous version of
  4019. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  4020. , which sends the
  4021. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4022. to the
  4023. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4024. and builds an
  4025. <see cref="T:System.Xml.XmlReader" />
  4026. object.
  4027. Exceptions will be reported via the returned Task object.
  4028. </summary><returns>
  4029. A task representing the asynchronous operation.
  4030. </returns><remarks>
  4031. <format type="text/markdown"><![CDATA[
  4032. ## Remarks
  4033. The **XmlReader** returned by this method does not support asynchronous operations.
  4034. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4035. ]]></format>
  4036. </remarks><exception cref="T:System.InvalidCastException">
  4037. A
  4038. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4039. other than **Binary** or **VarBinary** was used when
  4040. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4041. was set to
  4042. <see cref="T:System.IO.Stream" />
  4043. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4044. -or-
  4045. A
  4046. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4047. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4048. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4049. was set to
  4050. <see cref="T:System.IO.TextReader" />
  4051. .
  4052. -or-
  4053. A
  4054. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4055. other than **Xml** was used when
  4056. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4057. was set to
  4058. <see cref="T:System.Xml.XmlReader" />
  4059. .
  4060. </exception><exception cref="T:System.InvalidOperationException">
  4061. Calling
  4062. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4063. more than once for the same instance before task completion.
  4064. -or-
  4065. The
  4066. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4067. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4068. -or-
  4069. <see langword="Context Connection=true" />
  4070. is specified in the connection string.
  4071. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4072. SQL Server returned an error while executing the command text.
  4073. -or-
  4074. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4075. </exception><exception cref="T:System.IO.IOException">
  4076. An error occurred in a
  4077. <see cref="T:System.IO.Stream" />
  4078. ,
  4079. <see cref="T:System.Xml.XmlReader" />
  4080. or
  4081. <see cref="T:System.IO.TextReader" />
  4082. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4083. </exception><exception cref="T:System.ObjectDisposedException">
  4084. The
  4085. <see cref="T:System.IO.Stream" />
  4086. ,
  4087. <see cref="T:System.Xml.XmlReader" />
  4088. or
  4089. <see cref="T:System.IO.TextReader" />
  4090. object was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4091. </exception>
  4092. </member>
  4093. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync(System.Threading.CancellationToken)">
  4094. <param name="cancellationToken">
  4095. The cancellation instruction.
  4096. </param><summary>
  4097. An asynchronous version of
  4098. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteXmlReader" />
  4099. , which sends the
  4100. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandText" />
  4101. to the
  4102. <see cref="P:Microsoft.Data.SqlClient.SqlCommand.Connection" />
  4103. and builds an
  4104. <see cref="T:System.Xml.XmlReader" />
  4105. object.
  4106. 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.
  4107. </summary><returns>
  4108. A task representing the asynchronous operation.
  4109. </returns><remarks>
  4110. <format type="text/markdown"><![CDATA[
  4111. ## Remarks
  4112. The **XmlReader** returned by this method does not support asynchronous operations.
  4113. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  4114. ]]></format>
  4115. </remarks><exception cref="T:System.InvalidCastException">
  4116. A
  4117. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4118. other than **Binary** or **VarBinary** was used when
  4119. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4120. was set to
  4121. <see cref="T:System.IO.Stream" />
  4122. . For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4123. -or-
  4124. A
  4125. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4126. other than **Char**, **NChar**, **NVarChar**, **VarChar**, or **Xml** was used when
  4127. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4128. was set to
  4129. <see cref="T:System.IO.TextReader" />
  4130. .
  4131. -or-
  4132. A
  4133. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType" />
  4134. other than **Xml** was used when
  4135. <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" />
  4136. was set to
  4137. <see cref="T:System.Xml.XmlReader" />
  4138. .
  4139. </exception><exception cref="T:System.InvalidOperationException">
  4140. Calling
  4141. <see cref="M:Microsoft.Data.SqlClient.SqlCommand.ExecuteScalarAsync(System.Threading.CancellationToken)" />
  4142. more than once for the same instance before task completion.
  4143. -or-
  4144. The
  4145. <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />
  4146. closed or dropped during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4147. -or-
  4148. <see langword="Context Connection=true" />
  4149. is specified in the connection string.
  4150. </exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">
  4151. SQL Server returned an error while executing the command text.
  4152. -or-
  4153. A timeout occurred during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4154. </exception><exception cref="T:System.IO.IOException">
  4155. An error occurred in a
  4156. <see cref="T:System.IO.Stream" />
  4157. ,
  4158. <see cref="T:System.Xml.XmlReader" />
  4159. or
  4160. <see cref="T:System.IO.TextReader" />
  4161. object during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4162. </exception><exception cref="T:System.ObjectDisposedException">
  4163. The
  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 was closed during a streaming operation. For more information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  4170. </exception>
  4171. </member>
  4172. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Prepare">
  4173. <summary>
  4174. Creates a prepared version of the command on an instance of SQL Server.
  4175. </summary><remarks>
  4176. <format type="text/markdown"><![CDATA[
  4177. ## Remarks
  4178. 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.
  4179. 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.
  4180. > [!NOTE]
  4181. > 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.
  4182. 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.
  4183. 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>.
  4184. 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.
  4185. ## Examples
  4186. The following example demonstrates the use of the <xref:Microsoft.Data.SqlClient.SqlCommand.Prepare%2A> method.
  4187. [!code-csharp[SqlCommand.Prepare#1](~/../sqlclient/doc/samples/SqlCommand_Prepare.cs#1)]
  4188. ]]></format>
  4189. </remarks>
  4190. </member>
  4191. <member name="P:Microsoft.Data.SqlClient.SqlCommand.Notification">
  4192. <summary>
  4193. Gets or sets a value that specifies the
  4194. <see cref="T:Microsoft.Data.Sql.SqlNotificationRequest" />
  4195. object bound to this command.
  4196. </summary><value>
  4197. When set to null (default), no notification should be requested.
  4198. </value><remarks>
  4199. <format type="text/markdown"><![CDATA[
  4200. ## Remarks
  4201. You must set the value for this property before the command is executed for it to take effect.
  4202. ]]></format>
  4203. </remarks>
  4204. </member>
  4205. <member name="M:Microsoft.Data.SqlClient.SqlCommand.ResetCommandTimeout">
  4206. <summary> Resets the <see cref="P:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout" /> property to its default value.
  4207. </summary><remarks>
  4208. <format type="text/markdown"><![CDATA[
  4209. ## Remarks
  4210. The default value of the <xref:Microsoft.Data.SqlClient.SqlCommand.CommandTimeout%2A> is 30 seconds.
  4211. ]]></format>
  4212. </remarks>
  4213. </member>
  4214. <member name="M:Microsoft.Data.SqlClient.SqlCommand.Dispose(System.Boolean)">
  4215. <param name="disposing">
  4216. To be added.
  4217. </param><summary>
  4218. To be added.
  4219. </summary><remarks>
  4220. To be added.
  4221. </remarks>
  4222. </member>
  4223. <member name="T:Microsoft.Data.SqlClient.SqlCommandBuilder">
  4224. <summary>
  4225. Automatically generates single-table commands that are used to reconcile changes made to a
  4226. <see cref="T:System.Data.DataSet" />
  4227. with the associated SQL Server database. This class cannot be inherited.
  4228. </summary><remarks>
  4229. <format type="text/markdown"><![CDATA[
  4230. ## Remarks
  4231. 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>.
  4232. 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.
  4233. 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.
  4234. 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.
  4235. 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.
  4236. 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.
  4237. ## Examples
  4238. 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>.
  4239. [!code-csharp[SqlCommandBuilder#1](~/../sqlclient/doc/samples/SqlCommandBuilder.cs#1)]
  4240. ]]></format>
  4241. </remarks>
  4242. </member>
  4243. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.#ctor">
  4244. <summary>
  4245. Initializes a new instance of the
  4246. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4247. class.
  4248. </summary><remarks>
  4249. To be added.
  4250. </remarks>
  4251. </member>
  4252. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.#ctor(Microsoft.Data.SqlClient.SqlDataAdapter)">
  4253. <param name="adapter">
  4254. The name of the
  4255. <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />
  4256. .
  4257. </param><summary>
  4258. Initializes a new instance of the
  4259. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4260. class with the associated
  4261. <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" />
  4262. object.
  4263. </summary><remarks>
  4264. <format type="text/markdown"><![CDATA[
  4265. ## Remarks
  4266. 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.
  4267. 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.
  4268. ]]></format>
  4269. </remarks>
  4270. </member>
  4271. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.CatalogLocation">
  4272. <summary>
  4273. Sets or gets the
  4274. <see cref="T:System.Data.Common.CatalogLocation" />
  4275. for an instance of the
  4276. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4277. class.
  4278. </summary><value>
  4279. A
  4280. <see cref="T:System.Data.Common.CatalogLocation" />
  4281. object.
  4282. </value><remarks>
  4283. To be added.
  4284. </remarks>
  4285. </member>
  4286. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.CatalogSeparator">
  4287. <summary>
  4288. Sets or gets a string used as the catalog separator for an instance of the
  4289. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4290. class.
  4291. </summary><value>
  4292. A string that indicates the catalog separator for use with an instance of the
  4293. <see cref="T:Microsoft.Data.SqlClient.SqlCommandBuilder" />
  4294. class.
  4295. </value><remarks>
  4296. To be added.
  4297. </remarks>
  4298. </member>
  4299. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.DataAdapter">
  4300. <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>
  4301. <format type="text/markdown"><![CDATA[
  4302. ## Remarks
  4303. 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.
  4304. 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.
  4305. ]]></format>
  4306. </remarks>
  4307. </member>
  4308. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.DeriveParameters(Microsoft.Data.SqlClient.SqlCommand)">
  4309. <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>
  4310. <format type="text/markdown"><![CDATA[
  4311. ## Remarks
  4312. `DeriveParameters` overwrites any existing parameter information for the `SqlDbCommand`.
  4313. `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.
  4314. 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.
  4315. For more information, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  4316. ]]></format>
  4317. </remarks><exception cref="T:System.InvalidOperationException">The command text is not a valid stored procedure name.</exception>
  4318. </member>
  4319. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.QuotePrefix">
  4320. <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>
  4321. <format type="text/markdown"><![CDATA[
  4322. ## Remarks
  4323. > [!NOTE]
  4324. > 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.
  4325. ]]></format>
  4326. </remarks><exception cref="T:System.InvalidOperationException">This property cannot be changed after an INSERT, UPDATE, or DELETE command has been generated.</exception>
  4327. </member>
  4328. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteSuffix">
  4329. <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>
  4330. <format type="text/markdown"><![CDATA[
  4331. ## Remarks
  4332. > [!NOTE]
  4333. > 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.
  4334. ]]></format>
  4335. </remarks><exception cref="T:System.InvalidOperationException">This property cannot be changed after an insert, update, or delete command has been generated.</exception>
  4336. </member>
  4337. <member name="P:Microsoft.Data.SqlClient.SqlCommandBuilder.SchemaSeparator">
  4338. <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>
  4339. <format type="text/markdown"><![CDATA[
  4340. ## Remarks
  4341. 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.
  4342. ]]></format>
  4343. </remarks>
  4344. </member>
  4345. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.ApplyParameterInfo(System.Data.Common.DbParameter,System.Data.DataRow,System.Data.StatementType,System.Boolean)">
  4346. <param name="parameter">
  4347. To be added.
  4348. </param><param name="datarow">
  4349. To be added.
  4350. </param><param name="statementType">
  4351. To be added.
  4352. </param><param name="whereClause">
  4353. To be added.
  4354. </param><summary>
  4355. To be added.
  4356. </summary><remarks>
  4357. To be added.
  4358. </remarks>
  4359. </member>
  4360. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand">
  4361. <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>
  4362. <format type="text/markdown"><![CDATA[
  4363. ## Remarks
  4364. 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.
  4365. 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>.
  4366. 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>.
  4367. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4368. ]]></format>
  4369. </remarks>
  4370. </member>
  4371. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetDeleteCommand(System.Boolean)">
  4372. <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>
  4373. <format type="text/markdown"><![CDATA[
  4374. ## Remarks
  4375. 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.
  4376. 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>.
  4377. 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>.
  4378. 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:
  4379. - 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.
  4380. - 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.
  4381. - 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.
  4382. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4383. ]]></format>
  4384. </remarks>
  4385. </member>
  4386. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand">
  4387. <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>
  4388. <format type="text/markdown"><![CDATA[
  4389. ## Remarks
  4390. 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.
  4391. 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>.
  4392. 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>.
  4393. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4394. ]]></format>
  4395. </remarks>
  4396. </member>
  4397. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetInsertCommand(System.Boolean)">
  4398. <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>
  4399. <format type="text/markdown"><![CDATA[
  4400. ## Remarks
  4401. 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.
  4402. 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>.
  4403. 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>.
  4404. 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:
  4405. - 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.
  4406. - 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.
  4407. - 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.
  4408. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4409. ]]></format>
  4410. </remarks>
  4411. </member>
  4412. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterName(System.Int32)">
  4413. <param name="parameterOrdinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4414. </member>
  4415. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterName(System.String)">
  4416. <param name="parameterName">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4417. </member>
  4418. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetParameterPlaceholder(System.Int32)">
  4419. <param name="parameterOrdinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4420. </member>
  4421. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetSchemaTable(System.Data.Common.DbCommand)">
  4422. <param name="srcCommand">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4423. </member>
  4424. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand">
  4425. <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>
  4426. <format type="text/markdown"><![CDATA[
  4427. ## Remarks
  4428. 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.
  4429. 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>.
  4430. 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>.
  4431. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4432. ]]></format>
  4433. </remarks>
  4434. </member>
  4435. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.GetUpdateCommand(System.Boolean)">
  4436. <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>
  4437. <format type="text/markdown"><![CDATA[
  4438. ## Remarks
  4439. 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.
  4440. 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>.
  4441. 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>.
  4442. 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:
  4443. - 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.
  4444. - 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.
  4445. - 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.
  4446. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  4447. ]]></format>
  4448. </remarks>
  4449. </member>
  4450. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.InitializeCommand(System.Data.Common.DbCommand)">
  4451. <param name="command">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4452. </member>
  4453. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.QuoteIdentifier(System.String)">
  4454. <param name="unquotedIdentifier">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4455. </member>
  4456. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.SetRowUpdatingHandler(System.Data.Common.DbDataAdapter)">
  4457. <param name="adapter">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  4458. </member>
  4459. <member name="M:Microsoft.Data.SqlClient.SqlCommandBuilder.UnquoteIdentifier(System.String)">
  4460. <param name="quotedIdentifier">The identifier that will have its embedded quotes removed.</param><summary>Given a quoted identifier, returns the correct unquoted form of that identifier. This includes correctly unescaping any embedded quotes in the identifier.</summary><returns>The unquoted identifier, with embedded quotes properly unescaped.</returns><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/retrieving-and-modifying-data.md">Connecting and Retrieving Data in ADO.NET</related><related type="Article" href="~/docs/framework/data/adonet/sql/index.md">Using the .NET Framework Data Provider for SQL Server</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  4461. </member>
  4462. <member name="T:Microsoft.Data.SqlClient.SqlConnection">
  4463. <summary>Represents a connection to a SQL Server database. This class cannot be inherited.</summary><remarks>
  4464. <format type="text/markdown"><![CDATA[
  4465. ## Remarks
  4466. 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>.
  4467. 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.
  4468. See <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> for a list of the keywords in a connection string.
  4469. 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.
  4470. > [!NOTE]
  4471. > Login and logout events will not be raised on the server when a connection is fetched from or returned to the connection pool, because the connection is not actually closed when it is returned to the connection pool. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  4472. 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.
  4473. ```vb
  4474. Using connection As New SqlConnection(connectionString)
  4475. connection.Open()
  4476. ' Do work here; connection closed on following line.
  4477. End Using
  4478. ```
  4479. ```csharp
  4480. using (SqlConnection connection = new SqlConnection(connectionString))
  4481. {
  4482. connection.Open();
  4483. // Do work here; connection closed on following line.
  4484. }
  4485. ```
  4486. > [!NOTE]
  4487. > To deploy high-performance applications, you must use connection pooling. When you use the .NET Framework Data Provider for SQL Server, you do not have to enable connection pooling because the provider manages this automatically, although you can modify some settings. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  4488. 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.
  4489. An application that creates an instance of the <xref:Microsoft.Data.SqlClient.SqlConnection> object can require all direct and indirect callers to have sufficient permission to the code by setting declarative or imperative security demands. <xref:Microsoft.Data.SqlClient.SqlConnection> makes security demands using the <xref:Microsoft.Data.SqlClient.SqlClientPermission> object. Users can verify that their code has sufficient permissions by using the <xref:Microsoft.Data.SqlClient.SqlClientPermissionAttribute> object. Users and administrators can also use the [Caspol.exe (Code Access Security Policy Tool)](~/docs/framework/tools/caspol-exe-code-access-security-policy-tool.md) to modify security policy at the machine, user, and enterprise levels. For more information, see [Security in .NET](~/docs/standard/security/index.md). For an example demonstrating how to use security demands, see [Code Access Security and ADO.NET](~/docs/framework/data/adonet/code-access-security.md).
  4490. For more information about handling warning and informational messages from the server, see [Connection Events](~/docs/framework/data/adonet/connection-events.md). For more information about SQL Server engine errors and error messages, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  4491. > [!CAUTION]
  4492. > 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.
  4493. ## Examples
  4494. 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.
  4495. [!code-csharp[SqlCommand_ExecuteNonQuery Example#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs#1)]
  4496. ]]></format>
  4497. </remarks>
  4498. </member>
  4499. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor">
  4500. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnection" /> class.</summary><remarks>
  4501. <format type="text/markdown"><![CDATA[
  4502. ## Remarks
  4503. 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.
  4504. |Properties|Initial value|
  4505. |----------------|-------------------|
  4506. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>|empty string ("")|
  4507. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A>|15|
  4508. |<xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A>|empty string ("")|
  4509. |<xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A>|empty string ("")|
  4510. 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.
  4511. ## Examples
  4512. The following example creates and opens a <xref:Microsoft.Data.SqlClient.SqlConnection>.
  4513. [!code-csharp[SqlConnection_SqlConnection Example#1](~/../sqlclient/doc/samples/SqlConnection_SqlConnection.cs#1)]
  4514. ]]></format>
  4515. </remarks>
  4516. </member>
  4517. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String)">
  4518. <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>
  4519. <format type="text/markdown"><![CDATA[
  4520. ## Remarks
  4521. 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.
  4522. |Properties|Initial value|
  4523. |----------------|-------------------|
  4524. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>|`connectionString`|
  4525. |<xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout%2A>|15|
  4526. |<xref:Microsoft.Data.SqlClient.SqlConnection.Database%2A>|empty string ("")|
  4527. |<xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A>|empty string ("")|
  4528. 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.
  4529. ## Examples
  4530. The following example creates and opens a <xref:Microsoft.Data.SqlClient.SqlConnection>.
  4531. [!code-csharp[SqlConnection_SqlConnection1 Example#1](~/../sqlclient/doc/samples/SqlConnection_SqlConnection1.cs#1)]
  4532. ]]></format>
  4533. </remarks>
  4534. </member>
  4535. <member name="M:Microsoft.Data.SqlClient.SqlConnection.#ctor(System.String,Microsoft.Data.SqlClient.SqlCredential)">
  4536. <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>
  4537. </member>
  4538. <member name="P:Microsoft.Data.SqlClient.SqlConnection.AccessToken">
  4539. <summary>Gets or sets the access token for the connection.</summary><value>The access token for the connection.</value><remarks>To be added.</remarks>
  4540. </member>
  4541. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ClientConnectionId">
  4542. <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>
  4543. <format type="text/markdown"><![CDATA[
  4544. ## Remarks
  4545. <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.
  4546. 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.
  4547. ]]></format>
  4548. </remarks>
  4549. </member>
  4550. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString">
  4551. <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>
  4552. <format type="text/markdown"><![CDATA[
  4553. ## Remarks
  4554. 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`.
  4555. 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.
  4556. ```
  4557. "Persist Security Info=False;Integrated Security=true;Initial Catalog=Northwind;server=(local)"
  4558. ```
  4559. Use the new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder> to construct valid connection strings at run time. For more information, see [Connection String Builders](~/docs/framework/data/adonet/connection-string-builders.md).
  4560. 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>.
  4561. 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.
  4562. 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".
  4563. 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.
  4564. 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.
  4565. 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.
  4566. Keywords are not case sensitive.
  4567. The following table lists the valid names for keyword values within the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
  4568. |Keyword|Default|Description|
  4569. |-------------|-------------|-----------------|
  4570. |Addr|N/A|Synonym of **Data Source**.|
  4571. |Address|N/A|Synonym of **Data Source**.|
  4572. |App|N/A|Synonym of **Application Name**.|
  4573. |Application Name|N/A|The name of the application, or '.NET SQLClient Data Provider' if no application name is provided.<br /><br /> An application name can be 128 characters or less.|
  4574. |ApplicationIntent|ReadWrite|Declares the application workload type when connecting to a server. Possible values are `ReadOnly` and `ReadWrite`. For example:<br /><br /> `ApplicationIntent=ReadOnly`<br /><br /> For more information about SqlClient support for Always On Availability Groups, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).|
  4575. |Asynchronous Processing<br /><br /> -or-<br /><br /> Async|'false'|When `true`, enables asynchronous operation support. Recognized values are `true`, `false`, `yes`, and `no`.<br /><br /> This property is ignored beginning in .NET Framework 4.5. For more information about SqlClient support for asynchronous programming, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).|
  4576. |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.|
  4577. |Authentication|N/A|The authentication method used for [Connecting to SQL Database By Using Azure Active Directory Authentication](https://azure.microsoft.com/documentation/articles/sql-database-aad-authentication/#7-connect-to-your-database-by-using-azure-active-directory-identities).<br /><br /> Valid values are:<br /><br /> `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Password`, `Sql Password`. Currently `Active Directory Integrated` and `Active Directory Interactive` modes of authentication are only supported for .NET Framework. |
  4578. |Column Encryption Setting|N/A|Enables or disables [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine?view=sql-server-2017) functionality for the connection.|
  4579. |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.|
  4580. |Connection Lifetime<br /><br /> -or-<br /><br /> Load Balance Timeout|0|When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by `Connection Lifetime`. This is useful in clustered configurations to force load balancing between a running server and a server just brought online.<br /><br /> A value of zero (0) causes pooled connections to have the maximum connection timeout.|
  4581. |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).|
  4582. |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).|
  4583. |Context Connection|'false'|`true` if an in-process connection to SQL Server should be made.|
  4584. |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.|
  4585. |Data Source<br /><br /> -or-<br /><br /> Server<br /><br /> -or-<br /><br /> Address<br /><br /> -or-<br /><br /> Addr<br /><br /> -or-<br /><br /> Network Address|N/A|The name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name:<br /><br /> `server=tcp:servername, portnumber`<br /><br /> When specifying a local instance, always use (local). To force a protocol, add one of the following prefixes:<br /><br /> `np:(local), tcp:(local), lpc:(local)`<br /><br /> Beginning in .NET Framework 4.5, you can also connect to a LocalDB database as follows:<br /><br /> `server=(localdb)\\myInstance`<br /><br /> For more information about LocalDB, see [SqlClient Support for LocalDB](~/docs/framework/data/adonet/sql/sqlclient-support-for-localdb.md).<br /><br /> **Data Source** must use the TCP format or the Named Pipes format.<br /><br /> TCP format is as follows:<br /><br /> - tcp:\<host name>\\<instance name\><br />- tcp:\<host name>,\<TCP/IP port number><br /><br /> The TCP format must start with the prefix "tcp:" and is followed by the database instance, as specified by a host name and an instance name. This format is not applicable when connecting to Azure SQL Database. TCP is automatically selected for connections to Azure SQL Database when no protocol is specified.<br /><br /> The host name MUST be specified in one of the following ways:<br /><br /> - NetBIOSName<br />- IPv4Address<br />- IPv6Address<br /><br /> The instance name is used to resolve to a particular TCP/IP port number on which a database instance is hosted. Alternatively, specifying a TCP/IP port number directly is also allowed. If both instance name and port number are not present, the default database instance is used.<br /><br /> The Named Pipes format is as follows:<br /><br /> - np:\\\\<host name\>\pipe\\<pipe name\><br /><br /> The Named Pipes format MUST start with the prefix "np:" and is followed by a named pipe name.<br /><br /> The host name MUST be specified in one of the following ways:<br /><br /> - NetBIOSName<br />- IPv4Address<br />- IPv6Address<br /><br /> The pipe name is used to identify the database instance to which the .NET Framework application will be connected.<br /><br /> If the value of the **Network** key is specified, the prefixes "tcp:" and "np:" should not be specified. **Note:** You can force the use of TCP instead of shared memory, either by prefixing **tcp:** to the server name in the connection string, or by using **localhost**.|
  4586. |Encrypt|'false'|When `true`, SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](~/docs/framework/data/adonet/connection-string-syntax.md).<br /><br /> Beginning in .NET Framework 4.5, when `TrustServerCertificate` is false and `Encrypt` is true, the server name (or IP address) in a SQL Server SSL certificate must exactly match the server name (or IP address) specified in the connection string. Otherwise, the connection attempt will fail. For information about support for certificates whose subject starts with a wildcard character (*), see [Accepted wildcards used by server certificates for server authentication](https://support.microsoft.com/kb/258858).|
  4587. |Enlist|'true'|`true` indicates that the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.|
  4588. |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.|
  4589. |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.|
  4590. |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`).|
  4591. |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.|
  4592. |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.|
  4593. |MultipleActiveResultSets|'false'|When `true`, an application can maintain multiple active result sets (MARS). When `false`, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.<br /><br /> Recognized values are `true` and `false`.<br /><br /> For more information, see [Multiple Active Result Sets (MARS)](~/docs/framework/data/adonet/sql/multiple-active-result-sets-mars.md).|
  4594. |`MultiSubnetFailover`|FALSE|Always specify `multiSubnetFailover=True` when connecting to the availability group listener of a SQL Server 2012 (or later) availability group or a SQL Server 2012 (or later) Failover Cluster Instance. `multiSubnetFailover=True` configures SqlClient to provide faster detection of and connection to the (currently) active server. Possible values are `Yes` and `No`, `True` and `False` or `1` and `0`. For example:<br /><br /> `MultiSubnetFailover=True`<br /><br /> The default is `False`. For more information about SqlClient's support for Always On AGs, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).|
  4595. |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;`|
  4596. |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.|
  4597. |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.|
  4598. |Persist Security Info<br /><br /> -or-<br /><br /> PersistSecurityInfo|'false'|When set to `false` or `no` (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password. Recognized values are `true`, `false`, `yes`, and `no`.|
  4599. |PoolBlockingPeriod|Auto|Sets the blocking period behavior for a connection pool. See <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PoolBlockingPeriod> property for details.|
  4600. |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".|
  4601. |Replication|'false'|`true` if replication is supported using the connection.|
  4602. |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.|
  4603. |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>|
  4604. |TrustServerCertificate|'false'|When set to `true`, SSL is used to encrypt the channel when bypassing walking the certificate chain to validate trust. If TrustServerCertificate is set to `true` and Encrypt is set to `false`, the channel is not encrypted. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](~/docs/framework/data/adonet/connection-string-syntax.md).|
  4605. |Type System Version|N/A|A string value that indicates the type system the application expects. The functionality available to a client application is dependent on the version of SQL Server and the compatibility level of the database. Explicitly setting the type system version that the client application was written for avoids potential problems that could cause an application to break if a different version of SQL Server is used. **Note:** The type system version cannot be set for common language runtime (CLR) code executing in-process in SQL Server. For more information, see [SQL Server Common Language Runtime Integration](~/docs/framework/data/adonet/sql/sql-server-common-language-runtime-integration.md). <br /><br /> Possible values are:<br /><br /> `Type System Version=SQL Server 2012;`<br /><br /> `Type System Version=SQL Server 2008;`<br /><br /> `Type System Version=SQL Server 2005;`<br /><br /> `Type System Version=Latest;`<br /><br /> `Type System Version=SQL Server 2012;` specifies that the application will require version 11.0.0.0 of Microsoft.SqlServer.Types.dll. The other `Type System Version` settings will require version 10.0.0.0 of Microsoft.SqlServer.Types.dll.<br /><br /> `Latest` is obsolete and should not be used. `Latest` is equivalent to `Type System Version=SQL Server 2008;`.|
  4606. |User ID<br /><br /> -or-<br /><br /> UID<br /><br /> -or-|N/A|The SQL Server login account. Not recommended. To maintain a high level of security, we strongly recommend that you use the `Integrated Security` or `Trusted_Connection` keywords instead. <xref:Microsoft.Data.SqlClient.SqlCredential> is a more secure way to specify credentials for a connection that uses SQL Server Authentication.<br /><br /> The user ID must be 128 characters or less.|
  4607. |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.|
  4608. |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.|
  4609. The following list contains the valid names for connection pooling values within the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  4610. - Connection Lifetime (or Load Balance Timeout)
  4611. - Enlist
  4612. - Max Pool Size
  4613. - Min Pool Size
  4614. - Pooling
  4615. 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.
  4616. > [!NOTE]
  4617. > 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.
  4618. > [!NOTE]
  4619. > Universal data link (UDL) files are not supported for the .NET Framework Data Provider for SQL Server.
  4620. > [!CAUTION]
  4621. > In this release, the application should use caution when constructing a connection string based on user input (for example when retrieving user ID and password information from a dialog box, and appending it to the connection string). The application should make sure that a user cannot embed additional connection string parameters in these values (for example, entering a password as "validpassword;database=somedb" in an attempt to attach to a different database). If you need to construct connection strings based on user input, use the new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>, which validates the connection string and helps to eliminate this problem. See [Connection String Builders](~/docs/framework/data/adonet/connection-string-builders.md) for more information.
  4622. ## Examples
  4623. 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.
  4624. [!code-csharp[SqlConnection_ConnectionString Example#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionString.cs#1)]
  4625. ]]></format>
  4626. </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>
  4627. </member>
  4628. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionTimeout">
  4629. <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>
  4630. <format type="text/markdown"><![CDATA[
  4631. ## Remarks
  4632. 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.
  4633. ## Examples
  4634. 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.
  4635. [!code-csharp[SqlConnection_ConnectionTimeout Example#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionTimeout.cs#1)]
  4636. ]]></format>
  4637. </remarks><exception cref="T:System.ArgumentException">The value set is less than 0.</exception>
  4638. </member>
  4639. <member name="P:Microsoft.Data.SqlClient.SqlConnection.Credential">
  4640. <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>
  4641. <format type="text/markdown"><![CDATA[
  4642. ## Remarks
  4643. `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>.
  4644. The default value of <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is null.
  4645. An <xref:System.InvalidOperationException> exception will be raised:
  4646. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set on an open connection.
  4647. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when `Context Connection=true`.
  4648. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when `Integrated Security = true`.
  4649. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when the connection string uses `Password`.
  4650. - If <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> is set when the connection string uses `UserID`.
  4651. ]]></format>
  4652. </remarks>
  4653. </member>
  4654. <member name="P:Microsoft.Data.SqlClient.SqlConnection.Database">
  4655. <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>
  4656. <format type="text/markdown"><![CDATA[
  4657. ## Remarks
  4658. 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.
  4659. ## Examples
  4660. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  4661. [!code-csharp[SqlConnection_Database Example#1](~/../sqlclient/doc/samples/SqlConnection_Database.cs#1)]
  4662. ]]></format>
  4663. </remarks>
  4664. </member>
  4665. <member name="P:Microsoft.Data.SqlClient.SqlConnection.DataSource">
  4666. <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>
  4667. <format type="text/markdown"><![CDATA[
  4668. ## Remarks
  4669. > [!NOTE]
  4670. > 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".
  4671. ## Examples
  4672. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  4673. [!code-csharp[SqlConnection_DataSource Example#1](~/../sqlclient/doc/samples/SqlConnection_DataSource.cs#1)]
  4674. ]]></format>
  4675. </remarks>
  4676. </member>
  4677. <member name="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors">
  4678. <summary>Gets or sets the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors" /> property.</summary><value>
  4679. <see langword="true" /> if the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.FireInfoMessageEventOnUserErrors" /> property has been set; otherwise <see langword="false" />.</value><remarks>
  4680. <format type="text/markdown"><![CDATA[
  4681. ## Remarks
  4682. 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.
  4683. > [!NOTE]
  4684. > 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.
  4685. For more information on working with events, see [Connection Events](~/docs/framework/data/adonet/connection-events.md). For more information on errors generated by the SQL Server engine, see [Database Engine Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  4686. ]]></format>
  4687. </remarks>
  4688. </member>
  4689. <member name="P:Microsoft.Data.SqlClient.SqlConnection.PacketSize">
  4690. <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>
  4691. <format type="text/markdown"><![CDATA[
  4692. ## Remarks
  4693. 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.
  4694. <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.
  4695. 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).
  4696. ## Examples
  4697. 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.
  4698. [!code-csharp[SqlConnection_PacketSize Example#1](~/../sqlclient/doc/samples/SqlConnection_PacketSize.cs#1)]
  4699. ]]></format>
  4700. </remarks>
  4701. </member>
  4702. <member name="P:Microsoft.Data.SqlClient.SqlConnection.ServerVersion">
  4703. <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>
  4704. <format type="text/markdown"><![CDATA[
  4705. ## Remarks
  4706. 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.
  4707. <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>.
  4708. ## Examples
  4709. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.ServerVersion%2A> property.
  4710. [!code-csharp[SqlConnection_ServerVersion Example#1](~/../sqlclient/doc/samples/SqlConnection_ServerVersion.cs#1)]
  4711. ]]></format>
  4712. </remarks><exception cref="T:System.InvalidOperationException">The connection is closed.
  4713. <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>
  4714. </member>
  4715. <member name="P:Microsoft.Data.SqlClient.SqlConnection.State">
  4716. <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>
  4717. <format type="text/markdown"><![CDATA[
  4718. ## Remarks
  4719. 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>.
  4720. ]]></format>
  4721. </remarks>
  4722. </member>
  4723. <member name="P:Microsoft.Data.SqlClient.SqlConnection.StatisticsEnabled">
  4724. <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>
  4725. <format type="text/markdown"><![CDATA[
  4726. ## Remarks
  4727. Enabling statistics gathering has a minor, but measurable effect on performance and therefore should be enabled only when it is required.
  4728. ]]></format>
  4729. </remarks>
  4730. </member>
  4731. <member name="P:Microsoft.Data.SqlClient.SqlConnection.WorkstationId">
  4732. <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>
  4733. <format type="text/markdown"><![CDATA[
  4734. ## Remarks
  4735. 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.
  4736. ## Examples
  4737. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays the <xref:Microsoft.Data.SqlClient.SqlConnection.WorkstationId%2A> property.
  4738. [!code-csharp[SqlConnection_WorkstationId Example#1](~/../sqlclient/doc/samples/SqlConnection_WorkstationId.cs#1)]
  4739. ]]></format>
  4740. </remarks>
  4741. </member>
  4742. <member name="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage">
  4743. <summary>Occurs when SQL Server returns a warning or informational message.</summary><remarks>
  4744. <format type="text/markdown"><![CDATA[
  4745. ## Remarks
  4746. 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.
  4747. 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).
  4748. For more information and an example, see [Connection Events](~/docs/framework/data/adonet/connection-events.md).
  4749. ]]></format>
  4750. </remarks>
  4751. </member>
  4752. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginDbTransaction(System.Data.IsolationLevel)">
  4753. <param name="isolationLevel">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4754. </member>
  4755. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction">
  4756. <summary>Starts a database transaction.</summary><returns>An object representing the new transaction.</returns><remarks>
  4757. <format type="text/markdown"><![CDATA[
  4758. ## Remarks
  4759. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  4760. 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.
  4761. > [!NOTE]
  4762. > 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.
  4763. > [!CAUTION]
  4764. > 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**.
  4765. > [!CAUTION]
  4766. > 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.
  4767. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  4768. ## Examples
  4769. 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.
  4770. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  4771. ]]></format>
  4772. </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>
  4773. </member>
  4774. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.Data.IsolationLevel)">
  4775. <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>
  4776. <format type="text/markdown"><![CDATA[
  4777. ## Remarks
  4778. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  4779. 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.
  4780. > [!NOTE]
  4781. > 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).
  4782. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  4783. > [!CAUTION]
  4784. > 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.
  4785. ## Examples
  4786. 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.
  4787. [!code-csharp[SqlConnection_BeginTransaction1 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction1.cs#1)]
  4788. ]]></format>
  4789. </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>
  4790. </member>
  4791. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.Data.IsolationLevel,System.String)">
  4792. <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>
  4793. <format type="text/markdown"><![CDATA[
  4794. ## Remarks
  4795. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  4796. 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.
  4797. 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.
  4798. > [!NOTE]
  4799. > 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).
  4800. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  4801. > [!CAUTION]
  4802. > 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.
  4803. ## Examples
  4804. 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.
  4805. [!code-csharp[SqlConnection_BeginTransaction3 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction3.cs#1)]
  4806. ]]></format>
  4807. </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>
  4808. </member>
  4809. <member name="M:Microsoft.Data.SqlClient.SqlConnection.BeginTransaction(System.String)">
  4810. <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>
  4811. <format type="text/markdown"><![CDATA[
  4812. ## Remarks
  4813. This command maps to the SQL Server implementation of BEGIN TRANSACTION.
  4814. The length of the `transactionName` parameter must not exceed 32 characters; otherwise an exception will be thrown.
  4815. 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.
  4816. 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.
  4817. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  4818. > [!CAUTION]
  4819. > 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.
  4820. ## Examples
  4821. 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.
  4822. [!code-csharp[SqlConnection_BeginTransaction2 Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction2.cs#1)]
  4823. ]]></format>
  4824. </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>
  4825. </member>
  4826. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangeDatabase(System.String)">
  4827. <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>
  4828. <format type="text/markdown"><![CDATA[
  4829. ## Remarks
  4830. 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.
  4831. ## Examples
  4832. The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> and displays some of its read-only properties.
  4833. [!code-csharp[SqlConnection_Database Example#1](~/../sqlclient/doc/samples/SqlConnection_Database.cs#1)]
  4834. ]]></format>
  4835. </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>
  4836. </member>
  4837. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,Microsoft.Data.SqlClient.SqlCredential,System.Security.SecureString)">
  4838. <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">
  4839. The connection string contains any combination of <see langword="UserId" />, <see langword="Password" />, or <see langword="Integrated Security=true" />.
  4840. -or-
  4841. The connection string contains <see langword="Context Connection=true" />.
  4842. -or-
  4843. <paramref name="newSecurePassword" /> is greater than 128 characters.
  4844. -or-
  4845. <paramref name="newSecurePassword" /> is not read only.
  4846. -or-
  4847. <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>
  4848. </member>
  4849. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,System.String)">
  4850. <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>
  4851. <format type="text/markdown"><![CDATA[
  4852. ## Remarks
  4853. 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.
  4854. 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.
  4855. 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.
  4856. 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.
  4857. ## Examples
  4858. The following is a simple example of changing a password:
  4859. ```csharp
  4860. class Program {
  4861. static void Main(string[] args) {
  4862. Microsoft.Data.SqlClient.SqlConnection.ChangePassword(
  4863. "Data Source=a_server;Initial Catalog=a_database;UID=user;PWD=old_password",
  4864. "new_password");
  4865. }
  4866. }
  4867. ```
  4868. ```vb
  4869. Module Module1
  4870. Sub Main()
  4871. Microsoft.Data.SqlClient.SqlConnection.ChangePassword(
  4872. "Data Source=a_server;Initial Catalog=a_database;UID=user;PWD=old_password",
  4873. "new_password")
  4874. End Sub
  4875. End Module
  4876. ```
  4877. The following console application demonstrates the issues involved in changing a user's password because the current password has expired.
  4878. [!code-csharp[SqlConnection_ConnectionString1#1](~/../sqlclient/doc/samples/SqlConnection_ConnectionString1.cs#1)]
  4879. ]]></format>
  4880. </remarks><exception cref="T:System.ArgumentException">The connection string includes the option to use integrated security.
  4881. Or
  4882. 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>
  4883. </member>
  4884. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ClearAllPools">
  4885. <summary>Empties the connection pool.</summary><remarks>
  4886. <format type="text/markdown"><![CDATA[
  4887. ## Remarks
  4888. <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.
  4889. ]]></format>
  4890. </remarks>
  4891. </member>
  4892. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ClearPool(Microsoft.Data.SqlClient.SqlConnection)">
  4893. <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>
  4894. <format type="text/markdown"><![CDATA[
  4895. ## Remarks
  4896. <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.
  4897. ]]></format>
  4898. </remarks>
  4899. </member>
  4900. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Close">
  4901. <summary>Closes the connection to the database. This is the preferred method of closing any open connection.</summary><remarks>
  4902. <format type="text/markdown"><![CDATA[
  4903. ## Remarks
  4904. 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.
  4905. > [!NOTE]
  4906. > 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`.
  4907. An application can call <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A> more than one time. No exception is generated.
  4908. 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.
  4909. > [!NOTE]
  4910. > Login and logout events will not be raised on the server when a connection is fetched from or returned to the connection pool, because the connection is not actually closed when it is returned to the connection pool. For more information, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  4911. > [!CAUTION]
  4912. > Do not call `Close` or `Dispose` on a Connection, a DataReader, or any other managed object in the `Finalize` method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a `Finalize` method in your class definition. For more information, see [Garbage Collection](~/docs/standard/garbage-collection/index.md).
  4913. ## Examples
  4914. 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.
  4915. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  4916. ]]></format>
  4917. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">The connection-level error that occurred while opening the connection.</exception>
  4918. </member>
  4919. <member name="M:Microsoft.Data.SqlClient.SqlConnection.CreateCommand">
  4920. <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>
  4921. <format type="text/markdown"><![CDATA[
  4922. ## Examples
  4923. [!code-csharp[SqlConnection_CreateCommand#1](~/../sqlclient/doc/samples/SqlConnection_CreateCommand.cs#1)]
  4924. ]]></format>
  4925. </remarks>
  4926. </member>
  4927. <member name="M:Microsoft.Data.SqlClient.SqlConnection.CreateDbCommand">
  4928. <summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  4929. </member>
  4930. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema">
  4931. <summary>Returns schema information for the data source of this <see cref="T:Microsoft.Data.SqlClient.SqlConnection" />. For more information about scheme, see [SQL Server Schema Collections](~/docs/framework/data/adonet/sql-server-schema-collections.md).</summary><returns>A <see cref="T:System.Data.DataTable" /> that contains schema information.</returns><remarks>To be added.</remarks>
  4932. </member>
  4933. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema(System.String)">
  4934. <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>
  4935. <format type="text/markdown"><![CDATA[
  4936. ## Remarks
  4937. You may need the schema information of the database, tables or columns. This sample:
  4938. - Uses GetSchema to get schema information.
  4939. - Use schema restrictions to get the specified information.
  4940. - Gets schema information of the database, tables, and some columns.
  4941. Before you run the sample, you need to create the sample database, using the following Transact-SQL:
  4942. ```
  4943. USE [master]
  4944. GO
  4945. CREATE DATABASE [MySchool]
  4946. GO
  4947. USE [MySchool]
  4948. GO
  4949. SET ANSI_NULLS ON
  4950. GO
  4951. SET QUOTED_IDENTIFIER ON
  4952. GO
  4953. CREATE TABLE [dbo].[Course]([CourseID] [nvarchar](10) NOT NULL,
  4954. [Year] [smallint] NOT NULL,
  4955. [Title] [nvarchar](100) NOT NULL,
  4956. [Credits] [int] NOT NULL,
  4957. [DepartmentID] [int] NOT NULL,
  4958. CONSTRAINT [PK_Course] PRIMARY KEY CLUSTERED
  4959. (
  4960. [CourseID] ASC,
  4961. [Year] ASC
  4962. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
  4963. GO
  4964. SET ANSI_NULLS ON
  4965. GO
  4966. SET QUOTED_IDENTIFIER ON
  4967. GO
  4968. CREATE TABLE [dbo].[Department]([DepartmentID] [int] IDENTITY(1,1) NOT NULL,
  4969. [Name] [nvarchar](50) NOT NULL,
  4970. [Budget] [money] NOT NULL,
  4971. [StartDate] [datetime] NOT NULL,
  4972. [Administrator] [int] NULL,
  4973. CONSTRAINT [PK_Department] PRIMARY KEY CLUSTERED
  4974. (
  4975. [DepartmentID] ASC
  4976. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
  4977. GO
  4978. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C1045', 2012, N'Calculus', 4, 7)
  4979. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C1061', 2012, N'Physics', 4, 1)
  4980. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C2021', 2012, N'Composition', 3, 2)
  4981. INSERT [dbo].[Course] ([CourseID], [Year], [Title], [Credits], [DepartmentID]) VALUES (N'C2042', 2012, N'Literature', 4, 2)
  4982. SET IDENTITY_INSERT [dbo].[Department] ON
  4983. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (1, N'Engineering', 350000.0000, CAST(0x0000999C00000000 AS DateTime), 2)
  4984. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (2, N'English', 120000.0000, CAST(0x0000999C00000000 AS DateTime), 6)
  4985. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (4, N'Economics', 200000.0000, CAST(0x0000999C00000000 AS DateTime), 4)
  4986. INSERT [dbo].[Department] ([DepartmentID], [Name], [Budget], [StartDate], [Administrator]) VALUES (7, N'Mathematics', 250024.0000, CAST(0x0000999C00000000 AS DateTime), 3)
  4987. SET IDENTITY_INSERT [dbo].[Department] OFF
  4988. ALTER TABLE [dbo].[Course] WITH CHECK ADD CONSTRAINT [FK_Course_Department] FOREIGN KEY([DepartmentID])
  4989. REFERENCES [dbo].[Department] ([DepartmentID])
  4990. GO
  4991. ALTER TABLE [dbo].[Course] CHECK CONSTRAINT [FK_Course_Department]
  4992. GO
  4993. ```
  4994. [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.
  4995. [!code-csharp[SqlConnection.GetSchema#1](~/../sqlclient/doc/samples/SqlConnection_GetSchema.cs#1)]
  4996. ]]></format>
  4997. </remarks><exception cref="T:System.ArgumentException">
  4998. <paramref name="collectionName" /> is specified as null.</exception>
  4999. </member>
  5000. <member name="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema(System.String,System.String[])">
  5001. <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>
  5002. <format type="text/markdown"><![CDATA[
  5003. ## Remarks
  5004. 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.
  5005. 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.
  5006. For a code sample demonstrating <xref:Microsoft.Data.SqlClient.SqlConnection.GetSchema%2A>, see <xref:Microsoft.Data.SqlClient.SqlConnection.GetSchema%2A>.
  5007. ]]></format>
  5008. </remarks><exception cref="T:System.ArgumentException">
  5009. <paramref name="collectionName" /> is specified as null.</exception><altmember cref="M:Microsoft.Data.SqlClient.SqlConnection.GetSchema" />
  5010. </member>
  5011. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Open">
  5012. <summary>Opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />.</summary><remarks>
  5013. <format type="text/markdown"><![CDATA[
  5014. ## Remarks
  5015. 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.
  5016. > [!NOTE]
  5017. > 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>.
  5018. > [!NOTE]
  5019. > 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.
  5020. > [!NOTE]
  5021. > 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.
  5022. ## Examples
  5023. 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.
  5024. [!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
  5025. ]]></format>
  5026. </remarks><exception cref="T:System.InvalidOperationException">Cannot open a connection without specifying a data source or server.
  5027. or
  5028. 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.
  5029. 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>
  5030. </member>
  5031. <member name="M:Microsoft.Data.SqlClient.SqlConnection.OpenAsync(System.Threading.CancellationToken)">
  5032. <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>
  5033. <format type="text/markdown"><![CDATA[
  5034. ## Remarks
  5035. 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>.
  5036. 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.
  5037. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  5038. ]]></format>
  5039. </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.
  5040. <see langword="Context Connection=true" /> is specified in the connection string.
  5041. 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>
  5042. </member>
  5043. <member name="M:Microsoft.Data.SqlClient.SqlConnection.ResetStatistics">
  5044. <summary>If statistics gathering is enabled, all values are reset to zero.</summary><remarks>
  5045. <format type="text/markdown"><![CDATA[
  5046. ## Remarks
  5047. If statistics gathering is not enabled and this method is called, no error is thrown.
  5048. ]]></format>
  5049. </remarks>
  5050. </member>
  5051. <member name="M:Microsoft.Data.SqlClient.SqlConnection.RetrieveStatistics">
  5052. <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>
  5053. <format type="text/markdown"><![CDATA[
  5054. ## Remarks
  5055. 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.
  5056. ]]></format>
  5057. </remarks>
  5058. </member>
  5059. <member name="M:Microsoft.Data.SqlClient.SqlConnection.Dispose(System.Boolean)">
  5060. <param name="disposing">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  5061. </member>
  5062. <member name="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder">
  5063. <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>
  5064. <format type="text/markdown"><![CDATA[
  5065. ## Remarks
  5066. 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.
  5067. 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.
  5068. 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.
  5069. 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:
  5070. ```vb
  5071. Dim builder As New Microsoft.Data.SqlClient.SqlConnectionStringBuilder
  5072. builder("Data Source") = "(local)"
  5073. builder("Integrated Security") = True
  5074. builder("Initial Catalog") = "AdventureWorks;NewValue=Bad"
  5075. Console.WriteLine(builder.ConnectionString)
  5076. ```
  5077. ```csharp
  5078. Microsoft.Data.SqlClient.SqlConnectionStringBuilder builder =
  5079. new Microsoft.Data.SqlClient.SqlConnectionStringBuilder();
  5080. builder["Data Source"] = "(local)";
  5081. builder["Integrated Security"] = true;
  5082. builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad";
  5083. Console.WriteLine(builder.ConnectionString);
  5084. ```
  5085. The result is the following connection string that handles the invalid value in a safe manner:
  5086. ```
  5087. Source=(local);Initial Catalog="AdventureWorks;NewValue=Bad";
  5088. Integrated Security=True
  5089. ```
  5090. ## Examples
  5091. 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.
  5092. > [!NOTE]
  5093. > 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.
  5094. [!code-csharp[SqlConnectionStringBuilder#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder.cs#1)]
  5095. ]]></format>
  5096. </remarks>
  5097. </member>
  5098. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.#ctor">
  5099. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> class.</summary><remarks>To be added.</remarks>
  5100. </member>
  5101. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.#ctor(System.String)">
  5102. <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>
  5103. <format type="text/markdown"><![CDATA[
  5104. ## Remarks
  5105. 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.
  5106. ## Examples
  5107. 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.
  5108. > [!NOTE]
  5109. > 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.
  5110. [!code-csharp[SqlConnectionStringBuilder3#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder3.cs#1)]
  5111. ]]></format>
  5112. </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>
  5113. </member>
  5114. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationIntent">
  5115. <summary>Declares the application workload type when connecting to a database in an SQL Server Availability Group. You can set the value of this property with <see cref="T:Microsoft.Data.SqlClient.ApplicationIntent" />. For more information about SqlClient support for Always On Availability Groups, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).</summary><value>Returns the current value of the property (a value of type <see cref="T:Microsoft.Data.SqlClient.ApplicationIntent" />).</value><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5116. </member>
  5117. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ApplicationName">
  5118. <summary>Gets or sets the name of the application associated with the connection string.</summary><value>The name of the application, or ".NET SqlClient Data Provider" if no name has been supplied.</value><remarks>
  5119. <format type="text/markdown"><![CDATA[
  5120. ## Remarks
  5121. This property corresponds to the "Application Name" and "app" keys within the connection string.
  5122. ## Examples
  5123. 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.
  5124. [!code-csharp[SqlConnectionStringBuilder.ApplicationName#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ApplicationName.cs#1)]
  5125. The sample displays the following text in the console window:
  5126. ```
  5127. Original: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  5128. ApplicationName=".Net SqlClient Data Provider"
  5129. Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True;Application Name="My Application"
  5130. ```
  5131. ]]></format>
  5132. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5133. </member>
  5134. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.AttachDBFilename">
  5135. <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>
  5136. <format type="text/markdown"><![CDATA[
  5137. ## Remarks
  5138. This property corresponds to the "AttachDBFilename", "extended properties", and "initial file name" keys within the connection string.
  5139. `AttachDBFilename` is only supported for primary data files with an .mdf extension.
  5140. 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.
  5141. ## Examples
  5142. 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.
  5143. [!code-csharp[DataWorks SqlConnectionStringBuilder_AttachDBFilename#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_AttachDBFilename.cs#1)]
  5144. ]]></format>
  5145. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5146. </member>
  5147. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Authentication">
  5148. <summary>Gets the authentication of the connection string.</summary><value>The authentication of the connection string.</value><remarks>To be added.</remarks>
  5149. </member>
  5150. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryCount">
  5151. <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>
  5152. </member>
  5153. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectRetryInterval">
  5154. <summary>Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure. This must be an integer between 1 and 60. The default is 10 seconds. An <see cref="T:System.ArgumentException" /> will be thrown if set to a value outside of the allowed range.</summary><value>Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure.</value>
  5155. </member>
  5156. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ConnectTimeout">
  5157. <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>
  5158. <format type="text/markdown"><![CDATA[
  5159. ## Remarks
  5160. This property corresponds to the "Connect Timeout", "connection timeout", and "timeout" keys within the connection string.
  5161. When opening a connection to a Azure SQL Database, set the connection timeout to 30 seconds.
  5162. ## Examples
  5163. 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.
  5164. [!code-csharp[SqlConnectionStringBuilder_ConnectTimeout#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ConnectTimeout.cs#1)]
  5165. ]]></format>
  5166. </remarks>
  5167. </member>
  5168. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.CurrentLanguage">
  5169. <summary>Gets or sets the SQL Server Language record name.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.CurrentLanguage" /> property, or <see langword="String.Empty" /> if no value has been supplied.</value><remarks>
  5170. <format type="text/markdown"><![CDATA[
  5171. ## Remarks
  5172. This property corresponds to the "Current Language" and "language" keys within the connection string.
  5173. ]]></format>
  5174. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5175. </member>
  5176. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.DataSource">
  5177. <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>
  5178. <format type="text/markdown"><![CDATA[
  5179. ## Remarks
  5180. 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.
  5181. ## Examples
  5182. 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:
  5183. [!code-csharp[SqlConnectionStringBuilder_DataSource#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_DataSource.cs#1)]
  5184. ]]></format>
  5185. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5186. </member>
  5187. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt">
  5188. <summary>Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Encrypt" /> property, or <see langword="false" /> if none has been supplied.</value><remarks>
  5189. <format type="text/markdown"><![CDATA[
  5190. ## Remarks
  5191. This property corresponds to the "Encrypt" key within the connection string.
  5192. ]]></format>
  5193. </remarks><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5194. </member>
  5195. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Enlist">
  5196. <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>
  5197. <format type="text/markdown"><![CDATA[
  5198. ## Remarks
  5199. This property corresponds to the "Enlist" key within the connection string.
  5200. ]]></format>
  5201. </remarks>
  5202. </member>
  5203. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartner">
  5204. <summary>Gets or sets the name or address of the partner server to connect to if the primary server is down.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.FailoverPartner" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>To be added.</remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5205. </member>
  5206. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.InitialCatalog">
  5207. <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>
  5208. <format type="text/markdown"><![CDATA[
  5209. ## Remarks
  5210. This property corresponds to the "Initial Catalog" and "database" keys within the connection string.
  5211. ## Examples
  5212. 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.
  5213. [!code-csharp[SqlConnectionStringBuilder_InitialCatalog#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_InitialCatalog.cs#1)]
  5214. ]]></format>
  5215. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5216. </member>
  5217. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IntegratedSecurity">
  5218. <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>
  5219. <format type="text/markdown"><![CDATA[
  5220. ## Remarks
  5221. This property corresponds to the "Integrated Security" and "trusted_connection" keys within the connection string.
  5222. ## Examples
  5223. 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.
  5224. > [!NOTE]
  5225. > 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.
  5226. [!code-csharp[SqlConnectionStringBuilder_IntegratedSecurity#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_IntegratedSecurity.cs#1)]
  5227. ]]></format>
  5228. </remarks>
  5229. </member>
  5230. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IsFixedSize">
  5231. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> has a fixed size.</summary><value>
  5232. <see langword="true" /> in every case, because the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> supplies a fixed-size collection of key/value pairs.</value><remarks>To be added.</remarks><related type="Article" href="https://msdn.microsoft.com/library/745c5f95-2f02-4674-b378-6d51a7ec2490">Working with Connection Strings</related><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5233. </member>
  5234. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item(System.String)">
  5235. <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>
  5236. <format type="text/markdown"><![CDATA[
  5237. ## Remarks
  5238. 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>.
  5239. ## Examples
  5240. 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.
  5241. [!code-csharp[SqlConnectionStringBuilder2#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder2.cs#1)]
  5242. ]]></format>
  5243. </remarks><exception cref="T:System.ArgumentNullException">
  5244. <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>
  5245. </member>
  5246. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys">
  5247. <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>
  5248. <format type="text/markdown"><![CDATA[
  5249. ## Remarks
  5250. 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.
  5251. ## Examples
  5252. 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.
  5253. [!code-csharp[SqlConnectionStringBuilder_Keys#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Keys.cs#1)]
  5254. ]]></format>
  5255. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values" /><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Item(System.String)" />
  5256. </member>
  5257. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.LoadBalanceTimeout">
  5258. <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>
  5259. <format type="text/markdown"><![CDATA[
  5260. ## Remarks
  5261. This property corresponds to the "Load Balance Timeout" and "connection lifetime" keys within the connection string.
  5262. ]]></format>
  5263. </remarks>
  5264. </member>
  5265. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MaxPoolSize">
  5266. <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>
  5267. <format type="text/markdown"><![CDATA[
  5268. ## Remarks
  5269. This property corresponds to the "Max Pool Size" key within the connection string.
  5270. ]]></format>
  5271. </remarks>
  5272. </member>
  5273. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MinPoolSize">
  5274. <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>
  5275. <format type="text/markdown"><![CDATA[
  5276. ## Remarks
  5277. This property corresponds to the "Min Pool Size" key within the connection string.
  5278. ]]></format>
  5279. </remarks>
  5280. </member>
  5281. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultipleActiveResultSets">
  5282. <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>
  5283. <format type="text/markdown"><![CDATA[
  5284. ## Remarks
  5285. This property corresponds to the "MultipleActiveResultSets" key within the connection string.
  5286. ## Examples
  5287. The following example explicitly disables the Multiple Active Result Sets feature.
  5288. [!code-csharp[SqlConnectionStringBuilder_MultipleActiveResultSets.MARS#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_MultipleActiveResultSets.cs#1)]
  5289. ]]></format>
  5290. </remarks>
  5291. </member>
  5292. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.MultiSubnetFailover">
  5293. <summary>If your application is connecting to an AlwaysOn availability group (AG) on different subnets, setting MultiSubnetFailover=true provides faster detection of and connection to the (currently) active server. For more information about SqlClient support for Always On Availability Groups, see [SqlClient Support for High Availability, Disaster Recovery](~/docs/framework/data/adonet/sql/sqlclient-support-for-high-availability-disaster-recovery.md).</summary><value>Returns <see cref="T:System.Boolean" /> indicating the current value of the property.</value><remarks>To be added.</remarks>
  5294. </member>
  5295. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PacketSize">
  5296. <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>
  5297. <format type="text/markdown"><![CDATA[
  5298. ## Remarks
  5299. This property corresponds to the "Packet Size" key within the connection string.
  5300. ]]></format>
  5301. </remarks>
  5302. </member>
  5303. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password">
  5304. <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>
  5305. <format type="text/markdown"><![CDATA[
  5306. ## Remarks
  5307. This property corresponds to the "Password" and "pwd" keys within the connection string.
  5308. 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.
  5309. ## Examples
  5310. The following example shows how to set <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Password%2A>.
  5311. [!code-csharp[SqlConnectionStringBuilder_Password#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Password.cs#1)]
  5312. ]]></format>
  5313. </remarks><exception cref="T:System.ArgumentNullException">The password was incorrectly set to null. See code sample below.</exception>
  5314. </member>
  5315. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PersistSecurityInfo">
  5316. <summary>Gets or sets a Boolean value that indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.PersistSecurityInfo" /> property, or <see langword="false" /> if none has been supplied.</value><remarks>
  5317. <format type="text/markdown"><![CDATA[
  5318. ## Remarks
  5319. This property corresponds to the "Persist Security Info" and "persistsecurityinfo" keys within the connection string.
  5320. ]]></format>
  5321. </remarks>
  5322. </member>
  5323. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Pooling">
  5324. <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>
  5325. <format type="text/markdown"><![CDATA[
  5326. ## Remarks
  5327. This property corresponds to the "Pooling" key within the connection string.
  5328. ]]></format>
  5329. </remarks>
  5330. </member>
  5331. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Replication">
  5332. <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>
  5333. <format type="text/markdown"><![CDATA[
  5334. ## Remarks
  5335. This property corresponds to the "Replication" key within the connection string.
  5336. ]]></format>
  5337. </remarks>
  5338. </member>
  5339. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding">
  5340. <summary>Gets or sets a string value that indicates how the connection maintains its association with an enlisted <see langword="System.Transactions" /> transaction.</summary><value>The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding" /> property, or <see langword="String.Empty" /> if none has been supplied.</value><remarks>
  5341. <format type="text/markdown"><![CDATA[
  5342. ## Remarks
  5343. 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>.
  5344. The following table shows the possible values for the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TransactionBinding%2A> property:
  5345. |Value|Description|
  5346. |-----------|-----------------|
  5347. |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.|
  5348. |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.|
  5349. ]]></format>
  5350. </remarks>
  5351. </member>
  5352. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TrustServerCertificate">
  5353. <summary>Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.</summary><value>A <see langword="Boolean" />. Recognized values are <see langword="true" />, <see langword="false" />, <see langword="yes" />, and <see langword="no" />.</value><remarks>
  5354. <format type="text/markdown"><![CDATA[
  5355. ## Remarks
  5356. When `TrustServerCertificate` is set to `true`, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. If `TrustServerCertificate` is set to `true` and encryption is turned on, the encryption level specified on the server will be used even if `Encrypt` is set to `false`. The connection will fail otherwise.
  5357. 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).
  5358. ]]></format>
  5359. </remarks>
  5360. </member>
  5361. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TypeSystemVersion">
  5362. <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:
  5363. <list type="table"><listheader><term> Value
  5364. </term><description> Description
  5365. </description></listheader><item><term> SQL Server 2005
  5366. </term><description> Uses the SQL Server 2005 type system. No conversions are made for the current version of ADO.NET.
  5367. </description></item><item><term> SQL Server 2008
  5368. </term><description> Uses the SQL Server 2008 type system.
  5369. </description></item><item><term> Latest
  5370. </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.
  5371. </description></item></list></value><remarks>
  5372. <format type="text/markdown"><![CDATA[
  5373. ## Remarks
  5374. 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.
  5375. ]]></format>
  5376. </remarks>
  5377. </member>
  5378. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserID">
  5379. <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>
  5380. <format type="text/markdown"><![CDATA[
  5381. ## Remarks
  5382. This property corresponds to the "User ID", "user", and "uid" keys within the connection string.
  5383. ]]></format>
  5384. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5385. </member>
  5386. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.UserInstance">
  5387. <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>
  5388. <format type="text/markdown"><![CDATA[
  5389. ## Remarks
  5390. This property corresponds to the "User Instance" key within the connection string.
  5391. > [!NOTE]
  5392. > This feature is available only with the SQL Server Express Edition. For more information on user instances, see [SQL Server Express User Instances](~/docs/framework/data/adonet/sql/sql-server-express-user-instances.md).
  5393. ]]></format>
  5394. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5395. </member>
  5396. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Values">
  5397. <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>
  5398. <format type="text/markdown"><![CDATA[
  5399. ## Remarks
  5400. 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.
  5401. ## Examples
  5402. The following example first creates a new <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>, and then iterates through all the values within the object.
  5403. [!code-csharp[SqlConnectionStringBuilder_Values#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Values.cs#1)]
  5404. ]]></format>
  5405. </remarks><altmember cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Keys" />
  5406. </member>
  5407. <member name="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.WorkstationID">
  5408. <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>
  5409. <format type="text/markdown"><![CDATA[
  5410. ## Remarks
  5411. This property corresponds to the "Workstation ID" and "wsid" keys within the connection string.
  5412. ]]></format>
  5413. </remarks><exception cref="T:System.ArgumentNullException">To set the value to null, use <see cref="F:System.DBNull.Value" />.</exception>
  5414. </member>
  5415. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Clear">
  5416. <summary>Clears the contents of the <see cref="T:Microsoft.Data.SqlClient.SqlConnectionStringBuilder" /> instance.</summary><remarks>
  5417. <format type="text/markdown"><![CDATA[
  5418. ## Remarks
  5419. 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.
  5420. ## Examples
  5421. 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.
  5422. [!code-csharp[DataWorks SqlConnectionStringBuilder_Clear#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Clear.cs#1)]
  5423. ]]></format>
  5424. </remarks>
  5425. </member>
  5426. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ContainsKey(System.String)">
  5427. <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>
  5428. <format type="text/markdown"><![CDATA[
  5429. ## Remarks
  5430. 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.
  5431. ## Examples
  5432. 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.
  5433. [!code-csharp[SqlConnectionStringBuilder_ContainsKey#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_ContainsKey.cs#1)]
  5434. The example displays the following output in the console window:
  5435. ```
  5436. Connection string = Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  5437. True
  5438. True
  5439. True
  5440. False
  5441. ```
  5442. ]]></format>
  5443. </remarks><exception cref="T:System.ArgumentNullException">
  5444. <paramref name="keyword" /> is null (<see langword="Nothing" /> in Visual Basic)</exception>
  5445. </member>
  5446. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.Remove(System.String)">
  5447. <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>
  5448. <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>
  5449. <format type="text/markdown"><![CDATA[
  5450. ## Remarks
  5451. 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.
  5452. 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.
  5453. |Key|Default value|
  5454. |---------|-------------------|
  5455. |Application Name|".Net SqlClient Data Provider"|
  5456. |Asynchronous Processing|False|
  5457. |AttachDBFilename|Empty string|
  5458. |Connection Timeout|15|
  5459. |Context Connection|False|
  5460. |Current Language|Empty string|
  5461. |Data Source|Empty string|
  5462. |Encrypt|False|
  5463. |Enlist|True|
  5464. |Failover Partner|Empty string|
  5465. |Initial Catalog|Empty string|
  5466. |Integrated Security|False|
  5467. |Load Balance Timeout|0|
  5468. |Max Pool Size|100|
  5469. |Min Pool Size|0|
  5470. |MultipleActiveResultSets|False|
  5471. |Network Library|Empty string|
  5472. |Packet Size|8000|
  5473. |Password|Empty string|
  5474. |Persist Security Info|False|
  5475. |Pooling|True|
  5476. |Replication|False|
  5477. |Transaction Binding|Implicit Unbind|
  5478. |User ID|Empty string|
  5479. |User Instance|False|
  5480. |Workstation ID|Empty string|
  5481. ## Examples
  5482. 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.
  5483. > [!NOTE]
  5484. > 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.
  5485. [!code-csharp[SqlConnectionStringBuilder_Remove#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_Remove.cs#1)]
  5486. The example displays the following text in the console window:
  5487. ```
  5488. Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password= a1Pass@@11
  5489. Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True
  5490. Database = AdventureWorks
  5491. ```
  5492. ]]></format>
  5493. </remarks><exception cref="T:System.ArgumentNullException">
  5494. <paramref name="keyword" /> is null (<see langword="Nothing" /> in Visual Basic)</exception>
  5495. </member>
  5496. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.ShouldSerialize(System.String)">
  5497. <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>
  5498. <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>
  5499. <format type="text/markdown"><![CDATA[
  5500. ## Remarks
  5501. This method behaves identically to the <xref:System.Data.Common.DbConnectionStringBuilder.ContainsKey%2A> method.
  5502. ]]></format>
  5503. </remarks>
  5504. </member>
  5505. <member name="M:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.TryGetValue(System.String,System.Object@)">
  5506. <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>
  5507. <see langword="true" /> if <paramref name="keyword" /> was found within the connection string; otherwise, <see langword="false" />.</returns><remarks>
  5508. <format type="text/markdown"><![CDATA[
  5509. ## Remarks
  5510. 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.
  5511. ## Examples
  5512. The following example demonstrates the behavior of the **TryGetValue** method.
  5513. [!code-csharp[SqlConnectionStringBuilder_TryGetValue#1](~/../sqlclient/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs#1)]
  5514. The sample displays the following results:
  5515. ```
  5516. Data Source=(local)
  5517. Trusted_Connection=True
  5518. Unable to retrieve value for 'InvalidKey'
  5519. Unable to retrieve value for null key.
  5520. ```
  5521. ]]></format>
  5522. </remarks><exception cref="T:System.ArgumentNullException">
  5523. <paramref name="keyword" /> contains a null value (<see langword="Nothing" /> in Visual Basic).</exception>
  5524. </member>
  5525. <member name="T:Microsoft.Data.SqlClient.SqlCredential">
  5526. <summary>
  5527. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> provides a more secure way to specify the password for a login attempt using SQL Server Authentication.
  5528. <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" />.
  5529. <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> cannot be inherited.
  5530. Windows Authentication (<see langword="Integrated Security = true" />) remains the most secure way to log in to a SQL Server database.</summary><remarks>
  5531. <format type="text/markdown"><![CDATA[
  5532. ## Remarks
  5533. Use <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A> to get or set a connection's <xref:Microsoft.Data.SqlClient.SqlCredential> object. Use <xref:Microsoft.Data.SqlClient.SqlConnection.ChangePassword%2A> to change the password for a <xref:Microsoft.Data.SqlClient.SqlCredential> object. For information on how a <xref:Microsoft.Data.SqlClient.SqlCredential> object affects connection pool behavior, see [SQL Server Connection Pooling (ADO.NET)](~/docs/framework/data/adonet/sql-server-connection-pooling.md).
  5534. 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:
  5535. - `Integrated Security = true`
  5536. - `Password`
  5537. - `User ID`
  5538. - `Context Connection = true`
  5539. The following sample connects to a SQL Server database using <xref:Microsoft.Data.SqlClient.SqlConnection.Credential%2A>:
  5540. ```
  5541. // change connection string in the APP.CONFIG file
  5542. <connectionStrings>
  5543. <add name="MyConnString"
  5544. connectionString="Initial Catalog=myDB;Server=myServer"
  5545. providerName="Microsoft.Data.SqlClient" />
  5546. </connectionStrings>
  5547. // then use the following snippet:
  5548. using System.Configuration;
  5549. System.Windows.Controls.TextBox txtUserId = new System.Windows.Controls.TextBox();
  5550. System.Windows.Controls.PasswordBox txtPwd = new System.Windows.Controls.PasswordBox();
  5551. Configuration config = Configuration.WebConfigurationManager.OpenWebConfiguration(Null);
  5552. ConnectionStringSettings connString = config.ConnectionStrings.ConnectionString["MyConnString"];
  5553. using (SqlConnection conn = new SqlConnection(connString.ConnectionString))
  5554. {
  5555. SecureString pwd = txtPwd.SecurePassword;
  5556. pwd.MakeReadOnly();
  5557. SqlCredential cred = new SqlCredential(txtUserId.Text, pwd);
  5558. conn.Credential = cred;
  5559. conn.Open();
  5560. }
  5561. ```
  5562. ]]></format>
  5563. </remarks>
  5564. </member>
  5565. <member name="M:Microsoft.Data.SqlClient.SqlCredential.#ctor(System.String,System.Security.SecureString)">
  5566. <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>
  5567. <format type="text/markdown"><![CDATA[
  5568. ## Remarks
  5569. 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.
  5570. ]]></format>
  5571. </remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5572. </member>
  5573. <member name="P:Microsoft.Data.SqlClient.SqlCredential.Password">
  5574. <summary>Gets the password component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</summary><value>The password component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</value><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5575. </member>
  5576. <member name="P:Microsoft.Data.SqlClient.SqlCredential.UserId">
  5577. <summary>Gets the user ID component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</summary><value>The user ID component of the <see cref="T:Microsoft.Data.SqlClient.SqlCredential" /> object.</value><remarks>To be added.</remarks><related type="Article" href="~/docs/framework/data/adonet/ado-net-overview.md">ADO.NET Overview</related>
  5578. </member>
  5579. <member name="T:Microsoft.Data.SqlClient.SqlDataAdapter">
  5580. <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>
  5581. <format type="text/markdown"><![CDATA[
  5582. ## Remarks
  5583. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter>, serves as a bridge between a <xref:System.Data.DataSet> and SQL Server for retrieving and saving data. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter> provides this bridge by mapping <xref:System.Data.Common.DbDataAdapter.Fill%2A>, which changes the data in the <xref:System.Data.DataSet> to match the data in the data source, and <xref:System.Data.Common.DbDataAdapter.Update%2A>, which changes the data in the data source to match the data in the <xref:System.Data.DataSet>, using the appropriate Transact-SQL statements against the data source. The update is performed on a by-row basis. For every inserted, modified, and deleted row, the <xref:System.Data.Common.DbDataAdapter.Update%2A> method determines the type of change that has been performed on it (`Insert`, `Update`, or `Delete`). Depending on the type of change, the `Insert`, `Update`, or `Delete` command template executes to propagate the modified row to the data source. When the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> fills a <xref:System.Data.DataSet>, it creates the necessary tables and columns for the returned data if they do not already exist. However, primary key information is not included in the implicitly created schema unless the <xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A> property is set to <xref:System.Data.MissingSchemaAction.AddWithKey>. You may also have the <xref:Microsoft.Data.SqlClient.SqlDataAdapter> create the schema of the <xref:System.Data.DataSet>, including primary key information, before filling it with data using `FillSchema`. For more information, see [Adding Existing Constraints to a DataSet](~/docs/framework/data/adonet/adding-existing-constraints-to-a-dataset.md).
  5584. <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.
  5585. > [!NOTE]
  5586. > 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.
  5587. 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.
  5588. 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.
  5589. 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.
  5590. 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.
  5591. > [!NOTE]
  5592. > 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).
  5593. ## Examples
  5594. 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.
  5595. [!code-csharp[SqlDataAdapter_SelectCommand Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SelectCommand.cs#1)]
  5596. ]]></format>
  5597. </remarks>
  5598. </member>
  5599. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor">
  5600. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDataAdapter" /> class.</summary><remarks>
  5601. <format type="text/markdown"><![CDATA[
  5602. ## Remarks
  5603. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  5604. |Properties|Initial value|
  5605. |----------------|-------------------|
  5606. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  5607. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  5608. You can change the value of any of these properties through a separate call to the property.
  5609. ## Examples
  5610. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  5611. [!code-csharp[SqlDataAdapter.SqlDataAdapter Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter.cs#1)]
  5612. ]]></format>
  5613. </remarks>
  5614. </member>
  5615. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(Microsoft.Data.SqlClient.SqlCommand)">
  5616. <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>
  5617. <format type="text/markdown"><![CDATA[
  5618. ## Remarks
  5619. 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.
  5620. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  5621. |Properties|Initial value|
  5622. |----------------|-------------------|
  5623. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  5624. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  5625. You can change the value of any of these properties through a separate call to the property.
  5626. 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.
  5627. ## Examples
  5628. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  5629. [!code-csharp[SqlDataAdapter_SqlDataAdapter1 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter1.cs#1)]
  5630. ]]></format>
  5631. </remarks>
  5632. </member>
  5633. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,Microsoft.Data.SqlClient.SqlConnection)">
  5634. <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>
  5635. <format type="text/markdown"><![CDATA[
  5636. ## Remarks
  5637. 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.
  5638. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  5639. |Properties|Initial value|
  5640. |----------------|-------------------|
  5641. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  5642. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  5643. You can change the value of either of these properties through a separate call to the property.
  5644. ## Examples
  5645. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  5646. [!code-csharp[SqlDataAdapter_SqlDataAdapter3 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter3.cs#1)]
  5647. ]]></format>
  5648. </remarks>
  5649. </member>
  5650. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.#ctor(System.String,System.String)">
  5651. <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>
  5652. <format type="text/markdown"><![CDATA[
  5653. ## Remarks
  5654. 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.
  5655. When an instance of <xref:Microsoft.Data.SqlClient.SqlDataAdapter> is created, the following read/write properties are set to the following initial values.
  5656. |Properties|Initial value|
  5657. |----------------|-------------------|
  5658. |<xref:System.Data.Common.DataAdapter.MissingMappingAction%2A>|`MissingMappingAction.Passthrough`|
  5659. |<xref:System.Data.Common.DataAdapter.MissingSchemaAction%2A>|`MissingSchemaAction.Add`|
  5660. You can change the value of any of these properties through a separate call to the property.
  5661. ## Examples
  5662. The following example creates a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> and sets some of its properties.
  5663. [!code-csharp[SqlDataAdapter_SqlDataAdapter2 Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_SqlDataAdapter2.cs#1)]
  5664. ]]></format>
  5665. </remarks>
  5666. </member>
  5667. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand">
  5668. <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>
  5669. <format type="text/markdown"><![CDATA[
  5670. ## Remarks
  5671. During <xref:System.Data.Common.DbDataAdapter.Update%2A>, if this property is not set and primary key information is present in the <xref:System.Data.DataSet>, the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.DeleteCommand%2A> can be generated automatically if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property and use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. Then, any additional commands that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. This generation logic requires key column information to be present in the <xref:System.Data.DataSet>. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  5672. 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.
  5673. 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.
  5674. ## Examples
  5675. 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.
  5676. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  5677. ]]></format>
  5678. </remarks>
  5679. </member>
  5680. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand">
  5681. <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>
  5682. <format type="text/markdown"><![CDATA[
  5683. ## Remarks
  5684. During <xref:System.Data.Common.DbDataAdapter.Update%2A>, if this property is not set and primary key information is present in the <xref:System.Data.DataSet>, the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.InsertCommand%2A> can be generated automatically if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property and use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. Then, any additional commands that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. This generation logic requires key column information to be present in the <xref:System.Data.DataSet>. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  5685. 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.
  5686. 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.
  5687. 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.
  5688. ## Examples
  5689. 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.
  5690. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  5691. ]]></format>
  5692. </remarks>
  5693. </member>
  5694. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand">
  5695. <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>
  5696. <format type="text/markdown"><![CDATA[
  5697. ## Remarks
  5698. 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.
  5699. 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.
  5700. ## Examples
  5701. 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.
  5702. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  5703. ]]></format>
  5704. </remarks>
  5705. </member>
  5706. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize">
  5707. <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.
  5708. <list type="table"><listheader><term> Value is
  5709. </term><description> Effect
  5710. </description></listheader><item><term> 0
  5711. </term><description> There is no limit on the batch size.
  5712. </description></item><item><term> 1
  5713. </term><description> Disables batch updating.
  5714. </description></item><item><term> &gt;1
  5715. </term><description> Changes are sent using batches of <see cref="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateBatchSize" /> operations at a time.
  5716. </description></item></list>
  5717. 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>
  5718. <format type="text/markdown"><![CDATA[
  5719. ## Remarks
  5720. 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.
  5721. 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.
  5722. Executing an extremely large batch could decrease performance. Therefore, you should test for the optimum batch size setting before implementing your application.
  5723. An <xref:System.ArgumentOutOfRangeException> is thrown if the value is set to a number less than zero.
  5724. ]]></format>
  5725. </remarks>
  5726. </member>
  5727. <member name="P:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand">
  5728. <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>
  5729. <format type="text/markdown"><![CDATA[
  5730. ## Remarks
  5731. During <xref:System.Data.Common.DbDataAdapter.Update%2A>, if this property is not set and primary key information is present in the <xref:System.Data.DataSet>, the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.UpdateCommand%2A> can be generated automatically if you set the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.SelectCommand%2A> property and use the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. Then, any additional commands that you do not set are generated by the <xref:Microsoft.Data.SqlClient.SqlCommandBuilder>. This generation logic requires key column information to be present in the <xref:System.Data.DataSet>. For more information, see [Generating Commands with CommandBuilders](~/docs/framework/data/adonet/generating-commands-with-commandbuilders.md).
  5732. 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.
  5733. > [!NOTE]
  5734. > 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.
  5735. 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`.
  5736. 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.
  5737. ## Examples
  5738. 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.
  5739. [!code-csharp[SqlDataAdapter#1](~/../sqlclient/doc/samples/SqlDataAdapter.cs#1)]
  5740. ]]></format>
  5741. </remarks>
  5742. </member>
  5743. <member name="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated">
  5744. <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>
  5745. <format type="text/markdown"><![CDATA[
  5746. ## Remarks
  5747. 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:
  5748. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  5749. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  5750. 3. The command executes.
  5751. 4. If the command is set to `FirstReturnedRecord`, the first returned result is placed in the <xref:System.Data.DataRow>.
  5752. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  5753. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  5754. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  5755. ## Examples
  5756. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  5757. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  5758. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  5759. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  5760. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  5761. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  5762. ]]></format>
  5763. </remarks>
  5764. </member>
  5765. <member name="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating">
  5766. <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>
  5767. <format type="text/markdown"><![CDATA[
  5768. ## Remarks
  5769. 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:
  5770. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  5771. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  5772. 3. The command executes.
  5773. 4. If the command is set to `FirstReturnedRecord`, the first returned result is placed in the <xref:System.Data.DataRow>.
  5774. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  5775. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  5776. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  5777. ## Examples
  5778. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  5779. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  5780. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  5781. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  5782. event args: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  5783. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  5784. ]]></format>
  5785. </remarks>
  5786. </member>
  5787. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.OnRowUpdated(System.Data.Common.RowUpdatedEventArgs)">
  5788. <param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  5789. </member>
  5790. <member name="M:Microsoft.Data.SqlClient.SqlDataAdapter.OnRowUpdating(System.Data.Common.RowUpdatingEventArgs)">
  5791. <param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  5792. </member>
  5793. <member name="T:Microsoft.Data.SqlClient.SqlDataReader">
  5794. <summary>Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.</summary><remarks>
  5795. <format type="text/markdown"><![CDATA[
  5796. ## Remarks
  5797. 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.
  5798. 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>.
  5799. 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.
  5800. <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.
  5801. 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.
  5802. > [!NOTE]
  5803. > 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>.
  5804. ## Examples
  5805. 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.
  5806. [!code-csharp[SqlDataReader_Read Example#1](~/../sqlclient/doc/samples/SqlDataReader_Read.cs#1)]
  5807. ]]></format>
  5808. </remarks>
  5809. </member>
  5810. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Connection">
  5811. <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>
  5812. </member>
  5813. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Depth">
  5814. <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>
  5815. <format type="text/markdown"><![CDATA[
  5816. ## Remarks
  5817. The outermost table has a depth of zero. The .NET Framework Data Provider for SQL Server does not support nesting and always returns zero.
  5818. ]]></format>
  5819. </remarks>
  5820. </member>
  5821. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.FieldCount">
  5822. <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>
  5823. <format type="text/markdown"><![CDATA[
  5824. ## Remarks
  5825. 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.
  5826. ]]></format>
  5827. </remarks><exception cref="T:System.NotSupportedException">There is no current connection to an instance of SQL Server.</exception>
  5828. </member>
  5829. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.HasRows">
  5830. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> contains one or more rows.</summary><value>
  5831. <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>
  5832. </member>
  5833. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.IsClosed">
  5834. <summary>Retrieves a Boolean value that indicates whether the specified <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> instance has been closed.</summary><value>
  5835. <see langword="true" /> if the specified <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> instance is closed; otherwise <see langword="false" />.</value><remarks>
  5836. <format type="text/markdown"><![CDATA[
  5837. ## Remarks
  5838. It is not possible to read from a <xref:Microsoft.Data.SqlClient.SqlDataReader> instance that is closed.
  5839. ]]></format>
  5840. </remarks>
  5841. </member>
  5842. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Item(System.Int32)">
  5843. <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>
  5844. </member>
  5845. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.Item(System.String)">
  5846. <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>
  5847. <format type="text/markdown"><![CDATA[
  5848. ## Remarks
  5849. 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".
  5850. This method is kana-width insensitive.
  5851. ]]></format>
  5852. </remarks><exception cref="T:System.IndexOutOfRangeException">No column with the specified name was found.</exception>
  5853. </member>
  5854. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.RecordsAffected">
  5855. <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>
  5856. <format type="text/markdown"><![CDATA[
  5857. ## Remarks
  5858. The value of this property is cumulative. For example, if two records are inserted in batch mode, the value of `RecordsAffected` will be two.
  5859. <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.
  5860. ]]></format>
  5861. </remarks>
  5862. </member>
  5863. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.SensitivityClassification">
  5864. <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>
  5865. </member>
  5866. <member name="P:Microsoft.Data.SqlClient.SqlDataReader.VisibleFieldCount">
  5867. <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>
  5868. <format type="text/markdown"><![CDATA[
  5869. ## Remarks
  5870. 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.
  5871. ]]></format>
  5872. </remarks>
  5873. </member>
  5874. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.Close">
  5875. <summary>Closes the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> object.</summary><remarks>
  5876. <format type="text/markdown"><![CDATA[
  5877. ## Remarks
  5878. You must ensure the <xref:Microsoft.Data.SqlClient.SqlDataReader.Close%2A> method is called when you are through using the <xref:Microsoft.Data.SqlClient.SqlDataReader> before using the associated <xref:Microsoft.Data.SqlClient.SqlConnection> for any other purpose. The `Close` method may either be called directly or through the <xref:Microsoft.Data.SqlClient.SqlDataReader.Dispose%2A> method, disposing directly or in the context of [the using statement](~/_csharplang/spec/statements.md#the-using-statement) block.
  5879. 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.
  5880. > [!CAUTION]
  5881. > Do not call `Close` or `Dispose` on a Connection, a DataReader, or any other managed object in the `Finalize` method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a `Finalize` method in your class definition. For more information, see [Garbage Collection](~/docs/standard/garbage-collection/index.md).
  5882. ## Examples
  5883. 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.
  5884. [!code-csharp[SqlDataReader_Close Example#1](~/../sqlclient/doc/samples/SqlDataReader_Close.cs#1)]
  5885. ]]></format>
  5886. </remarks>
  5887. </member>
  5888. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetBoolean(System.Int32)">
  5889. <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>
  5890. <format type="text/markdown"><![CDATA[
  5891. ## Remarks
  5892. No conversions are performed; therefore, the data retrieved must already be a Boolean, or an exception is generated.
  5893. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  5894. ]]></format>
  5895. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5896. </member>
  5897. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetByte(System.Int32)">
  5898. <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>
  5899. <format type="text/markdown"><![CDATA[
  5900. ## Remarks
  5901. No conversions are performed; therefore, the data retrieved must already be a byte.
  5902. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  5903. ]]></format>
  5904. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5905. </member>
  5906. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  5907. <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>
  5908. <format type="text/markdown"><![CDATA[
  5909. ## Remarks
  5910. <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>.
  5911. 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.
  5912. No conversions are performed; therefore, the data retrieved must already be a byte array.
  5913. ]]></format>
  5914. </remarks>
  5915. </member>
  5916. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetChar(System.Int32)">
  5917. <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>
  5918. <format type="text/markdown"><![CDATA[
  5919. ## Remarks
  5920. Not supported for <xref:Microsoft.Data.SqlClient>.
  5921. ]]></format>
  5922. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5923. </member>
  5924. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  5925. <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>
  5926. <format type="text/markdown"><![CDATA[
  5927. ## Remarks
  5928. <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>.
  5929. 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.
  5930. No conversions are performed; therefore. the data retrieved must already be a character array.
  5931. > [!NOTE]
  5932. > The <xref:Microsoft.Data.SqlClient.SqlDataReader.GetChars%2A> method returns 0 when `dataIndex` is negative.
  5933. ]]></format>
  5934. </remarks>
  5935. </member>
  5936. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDataTypeName(System.Int32)">
  5937. <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>
  5938. <format type="text/markdown"><![CDATA[
  5939. ## Remarks
  5940. Returns the name of the back-end data type.
  5941. `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.
  5942. ]]></format>
  5943. </remarks>
  5944. </member>
  5945. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDateTime(System.Int32)">
  5946. <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>
  5947. <format type="text/markdown"><![CDATA[
  5948. ## Remarks
  5949. No conversions are performed; therefore, the data retrieved must already be a <xref:System.DateTime> object.
  5950. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  5951. ]]></format>
  5952. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5953. </member>
  5954. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDateTimeOffset(System.Int32)">
  5955. <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>
  5956. <format type="text/markdown"><![CDATA[
  5957. ## Remarks
  5958. No conversions are performed; therefore, the data retrieved must already be a <xref:System.DateTimeOffset> object.
  5959. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  5960. ]]></format>
  5961. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5962. </member>
  5963. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDecimal(System.Int32)">
  5964. <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>
  5965. <format type="text/markdown"><![CDATA[
  5966. ## Remarks
  5967. No conversions are performed; therefore, the data retrieved must already be a <xref:System.Decimal> object.
  5968. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  5969. ]]></format>
  5970. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5971. </member>
  5972. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetDouble(System.Int32)">
  5973. <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>
  5974. <format type="text/markdown"><![CDATA[
  5975. ## Remarks
  5976. No conversions are performed. Therefore, the data retrieved must already be a double-precision floating point number.
  5977. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  5978. ]]></format>
  5979. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  5980. </member>
  5981. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetEnumerator">
  5982. <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>
  5983. <format type="text/markdown"><![CDATA[
  5984. ## Remarks
  5985. 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.
  5986. ]]></format>
  5987. </remarks>
  5988. </member>
  5989. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldType(System.Int32)">
  5990. <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>
  5991. </member>
  5992. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValue``1(System.Int32)">
  5993. <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>
  5994. <format type="text/markdown"><![CDATA[
  5995. ## Remarks
  5996. `T` can be one of the following types:
  5997. |||||
  5998. |-|-|-|-|
  5999. |Boolean|Byte|Char|DateTime|
  6000. |DateTimeOffset|Decimal|Double|Float|
  6001. |Guid|Int16|Int32|Int64|
  6002. |SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
  6003. |SqlDouble|SqlGuid|SqlInt16|SqlInt32|
  6004. |SqlInt64|SqlMoney|SqlSingle|SqlString|
  6005. |String|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|||
  6006. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6007. ]]></format>
  6008. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6009. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6010. 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).
  6011. Tried to read a previously-read column in sequential mode.
  6012. 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">
  6013. <typeparamref name="T" /> doesn't match the type returned by SQL Server or cannot be cast.</exception>
  6014. </member>
  6015. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValueAsync``1(System.Int32,System.Threading.CancellationToken)">
  6016. <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>
  6017. <format type="text/markdown"><![CDATA[
  6018. ## Remarks
  6019. `T` can be one of the following types:
  6020. |||||
  6021. |-|-|-|-|
  6022. |Boolean|Byte|Char|DateTime|
  6023. |DateTimeOffset|Decimal|Double|Float|
  6024. |Guid|Int16|Int32|Int64|
  6025. |SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
  6026. |SqlDouble|SqlGuid|SqlInt16|SqlInt32|
  6027. |SqlInt64|SqlMoney|SqlSingle|SqlString|
  6028. |String|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|||
  6029. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6030. ]]></format>
  6031. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6032. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6033. 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).
  6034. Tried to read a previously-read column in sequential mode.
  6035. 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.
  6036. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception><exception cref="T:System.Data.SqlTypes.SqlNullValueException">The value of the column was null (<see cref="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)" /> == <see langword="true" />), retrieving a non-SQL type.</exception><exception cref="T:System.InvalidCastException">
  6037. <typeparamref name="T" /> doesn't match the type returned by SQL Server or cannot be cast.</exception>
  6038. </member>
  6039. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetFloat(System.Int32)">
  6040. <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>
  6041. <format type="text/markdown"><![CDATA[
  6042. ## Remarks
  6043. No conversions are performed. Therefore, the data retrieved must already be a single-precision floating point number.
  6044. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6045. ]]></format>
  6046. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6047. </member>
  6048. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetGuid(System.Int32)">
  6049. <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>
  6050. <format type="text/markdown"><![CDATA[
  6051. ## Remarks
  6052. No conversions are performed; therefore, the data retrieved must already be a GUID.
  6053. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6054. ]]></format>
  6055. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6056. </member>
  6057. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt16(System.Int32)">
  6058. <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>
  6059. <format type="text/markdown"><![CDATA[
  6060. ## Remarks
  6061. No conversions are performed; therefore, the data retrieved must already be a 16-bit signed integer.
  6062. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6063. ]]></format>
  6064. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6065. </member>
  6066. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt32(System.Int32)">
  6067. <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>
  6068. <format type="text/markdown"><![CDATA[
  6069. ## Remarks
  6070. No conversions are performed; therefore, the data retrieved must already be a 32-bit signed integer.
  6071. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6072. ]]></format>
  6073. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6074. </member>
  6075. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetInt64(System.Int32)">
  6076. <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>
  6077. <format type="text/markdown"><![CDATA[
  6078. ## Remarks
  6079. No conversions are performed; therefore, the data retrieved must already be a 64-bit signed integer.
  6080. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6081. ]]></format>
  6082. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6083. </member>
  6084. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetName(System.Int32)">
  6085. <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>
  6086. </member>
  6087. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetOrdinal(System.String)">
  6088. <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>
  6089. <format type="text/markdown"><![CDATA[
  6090. ## Remarks
  6091. `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.
  6092. `GetOrdinal` is kana-width insensitive.
  6093. 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.
  6094. ## Examples
  6095. The following example demonstrates how to use the <xref:Microsoft.Data.SqlClient.SqlDataReader.GetOrdinal%2A> method.
  6096. [!code-csharp[SqlDataReader_GetOrdinal#1](~/../sqlclient/doc/samples/SqlDataReader_GetOrdinal.cs#1)]
  6097. ]]></format>
  6098. </remarks><exception cref="T:System.IndexOutOfRangeException">The name specified is not a valid column name.</exception>
  6099. </member>
  6100. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificFieldType(System.Int32)">
  6101. <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>
  6102. </member>
  6103. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificValue(System.Int32)">
  6104. <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>
  6105. </member>
  6106. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetProviderSpecificValues(System.Object[])">
  6107. <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>
  6108. </member>
  6109. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBinary(System.Int32)">
  6110. <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>
  6111. <format type="text/markdown"><![CDATA[
  6112. ## Remarks
  6113. No conversions are performed; therefore the data retrieved must already be a binary structure or an exception is generated.
  6114. ]]></format>
  6115. </remarks>
  6116. </member>
  6117. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBoolean(System.Int32)">
  6118. <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>
  6119. <format type="text/markdown"><![CDATA[
  6120. ## Remarks
  6121. No conversions are performed; therefore, the data retrieved must already be a Boolean or an exception is generated.
  6122. ]]></format>
  6123. </remarks>
  6124. </member>
  6125. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlByte(System.Int32)">
  6126. <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>
  6127. <format type="text/markdown"><![CDATA[
  6128. ## Remarks
  6129. No conversions are performed; therefore the data retrieved must already be a byte, or an exception is generated.
  6130. ]]></format>
  6131. </remarks>
  6132. </member>
  6133. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlBytes(System.Int32)">
  6134. <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>
  6135. </member>
  6136. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlChars(System.Int32)">
  6137. <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>
  6138. </member>
  6139. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDateTime(System.Int32)">
  6140. <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>
  6141. <format type="text/markdown"><![CDATA[
  6142. ## Remarks
  6143. No conversions are performed; therefore, the data retrieved must already be a date/time value, or an exception is generated.
  6144. ]]></format>
  6145. </remarks>
  6146. </member>
  6147. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDecimal(System.Int32)">
  6148. <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>
  6149. <format type="text/markdown"><![CDATA[
  6150. ## Remarks
  6151. No conversions are performed; therefore, the data retrieved must already be a decimal value, or an exception is generated.
  6152. ]]></format>
  6153. </remarks>
  6154. </member>
  6155. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlDouble(System.Int32)">
  6156. <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>
  6157. <format type="text/markdown"><![CDATA[
  6158. ## Remarks
  6159. No conversions are performed; therefore, the data retrieved must already be a double-precision floating-point number, or an exception is generated.
  6160. ]]></format>
  6161. </remarks>
  6162. </member>
  6163. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlGuid(System.Int32)">
  6164. <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>
  6165. <format type="text/markdown"><![CDATA[
  6166. ## Remarks
  6167. No conversions are performed; therefore, the data retrieved must already be a GUID, or an exception is generated.
  6168. ]]></format>
  6169. </remarks>
  6170. </member>
  6171. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt16(System.Int32)">
  6172. <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>
  6173. <format type="text/markdown"><![CDATA[
  6174. ## Remarks
  6175. No conversions are performed; therefore, the data retrieved must already be a 16-bit signed integer, or an exception is generated.
  6176. ]]></format>
  6177. </remarks>
  6178. </member>
  6179. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt32(System.Int32)">
  6180. <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>
  6181. <format type="text/markdown"><![CDATA[
  6182. ## Remarks
  6183. No conversions are performed; therefore the data retrieved must already be a 32-bit signed integer, or an exception is generated.
  6184. ]]></format>
  6185. </remarks>
  6186. </member>
  6187. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlInt64(System.Int32)">
  6188. <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>
  6189. <format type="text/markdown"><![CDATA[
  6190. ## Remarks
  6191. No conversions are performed; therefore, the data retrieved must already be a 64-bit signed integer, or an exception is generated.
  6192. ]]></format>
  6193. </remarks>
  6194. </member>
  6195. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlMoney(System.Int32)">
  6196. <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>
  6197. <format type="text/markdown"><![CDATA[
  6198. ## Remarks
  6199. No conversions are performed; therefore, the data retrieved must already be a decimal value, or an exception is generated.
  6200. ]]></format>
  6201. </remarks>
  6202. </member>
  6203. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlSingle(System.Int32)">
  6204. <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>
  6205. <format type="text/markdown"><![CDATA[
  6206. ## Remarks
  6207. No conversions are performed; therefore, the data retrieved must already be a single precision floating point number, or an exception is generated.
  6208. ]]></format>
  6209. </remarks>
  6210. </member>
  6211. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlString(System.Int32)">
  6212. <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>
  6213. <format type="text/markdown"><![CDATA[
  6214. ## Remarks
  6215. No conversions are performed; therefore, the data retrieved must already be a string, or an exception is generated.
  6216. ]]></format>
  6217. </remarks>
  6218. </member>
  6219. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValue(System.Int32)">
  6220. <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>
  6221. <format type="text/markdown"><![CDATA[
  6222. ## Remarks
  6223. <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>.
  6224. ]]></format>
  6225. </remarks>
  6226. </member>
  6227. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlValues(System.Object[])">
  6228. <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>
  6229. <format type="text/markdown"><![CDATA[
  6230. ## Remarks
  6231. 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.
  6232. ]]></format>
  6233. </remarks><exception cref="T:System.ArgumentNullException">
  6234. <paramref name="values" /> is null.</exception>
  6235. </member>
  6236. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSqlXml(System.Int32)">
  6237. <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>
  6238. <format type="text/markdown"><![CDATA[
  6239. ## Remarks
  6240. No conversions are performed; therefore, the data retrieved must already be an XML value.
  6241. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6242. ]]></format>
  6243. </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>
  6244. </member>
  6245. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetSchemaTable">
  6246. <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>
  6247. <format type="text/markdown"><![CDATA[
  6248. ## Remarks
  6249. For the <xref:Microsoft.Data.SqlClient.SqlDataReader.GetSchemaTable%2A> method returns metadata about each column in the following order:
  6250. |DataReader column|Description|
  6251. |-----------------------|-----------------|
  6252. |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.|
  6253. |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.|
  6254. |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.|
  6255. |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.|
  6256. |BaseServerName|The name of the instance of Microsoft SQL Server used by the <xref:Microsoft.Data.SqlClient.SqlDataReader>.|
  6257. |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.|
  6258. |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.|
  6259. |ColumnOrdinal|The zero-based ordinal of the column. This column cannot contain a null value.|
  6260. |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).|
  6261. |DataTypeName|Returns a string representing the data type of the specified column.|
  6262. |IsAliased|`true`: The column name is an alias.<br /><br /> `false`: The column name is not an alias.|
  6263. |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`.|
  6264. |IsColumnSet|`true`: The column is a sparse column that is a member of a column set.|
  6265. |IsExpression|`true`: The column is an expression.<br /><br /> `false`: The column is not an expression.|
  6266. |IsHidden|`true`: The column is hidden.<br /><br /> `false`: The column is not hidden.|
  6267. |IsIdentity|`true`: The column is an identity column.<br /><br /> `false`: The column is not an identity column.|
  6268. |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.|
  6269. |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.|
  6270. |IsReadOnly|`true`: The column cannot be modified.<br /><br /> `false`: The column can be modified.|
  6271. |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.|
  6272. |IsUnique|`true`: Column is of type `timestamp`.<br /><br /> `false`: Column is not of type `timestamp`.|
  6273. |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.|
  6274. |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.|
  6275. |NumericScale|If `ProviderType` is DBTYPE_DECIMAL or DBTYPE_NUMERIC, the number of digits to the right of the decimal point. Otherwise, this is 255.|
  6276. |ProviderSpecificDataType|Returns the provider-specific data type of the column based on the `Type System Version` keyword in the connection string.|
  6277. |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.|
  6278. |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.|
  6279. |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.|
  6280. |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.|
  6281. |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.|
  6282. > [!NOTE]
  6283. > 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.
  6284. ]]></format>
  6285. </remarks><exception cref="T:System.InvalidOperationException">The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed.</exception>
  6286. </member>
  6287. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetStream(System.Int32)">
  6288. <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>
  6289. <format type="text/markdown"><![CDATA[
  6290. ## Remarks
  6291. <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>.
  6292. Null values will be returned as an empty (zero bytes) <xref:System.IO.Stream>.
  6293. <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.
  6294. <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>.
  6295. The following <xref:System.IO.Stream> members are not available for objects returned by <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A>:
  6296. - BeginWrite
  6297. - EndWrite
  6298. - Length
  6299. - Position
  6300. - Seek
  6301. - SetLength
  6302. - Write
  6303. - WriteByte
  6304. - WriteTimeout
  6305. When the connection property `ContextConnection=true`, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetStream%2A> only supports synchronous data retrieval for both sequential (<xref:System.Data.CommandBehavior.SequentialAccess>) and non-sequential (<xref:System.Data.CommandBehavior.Default>) access.
  6306. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6307. ]]></format>
  6308. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6309. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6310. 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).
  6311. Tried to read a previously-read column in sequential mode.
  6312. 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:
  6313. - binary
  6314. - image
  6315. - varbinary
  6316. - udt</exception>
  6317. </member>
  6318. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetString(System.Int32)">
  6319. <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>
  6320. <format type="text/markdown"><![CDATA[
  6321. ## Remarks
  6322. No conversions are performed; therefore, the data retrieved must already be a string.
  6323. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6324. ]]></format>
  6325. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6326. </member>
  6327. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader(System.Int32)">
  6328. <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>
  6329. <format type="text/markdown"><![CDATA[
  6330. ## Remarks
  6331. <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>.
  6332. Null values will be returned as an empty (zero bytes) <xref:System.IO.TextReader>.
  6333. <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.
  6334. When the connection property `ContextConnection=true`, <xref:Microsoft.Data.SqlClient.SqlDataReader.GetTextReader%2A> only supports synchronous data retrieval for both sequential (<xref:System.Data.CommandBehavior.SequentialAccess>) and non-sequential (<xref:System.Data.CommandBehavior.Default>) access.
  6335. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6336. ]]></format>
  6337. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6338. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6339. 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).
  6340. Tried to read a previously-read column in sequential mode.
  6341. 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:
  6342. - char
  6343. - nchar
  6344. - ntext
  6345. - nvarchar
  6346. - text
  6347. - varchar</exception>
  6348. </member>
  6349. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetTimeSpan(System.Int32)">
  6350. <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>
  6351. <format type="text/markdown"><![CDATA[
  6352. ## Remarks
  6353. No conversions are performed; therefore, the data retrieved must already be a <xref:System.TimeSpan> object.
  6354. Call <xref:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull%2A> to check for null values before calling this method.
  6355. ]]></format>
  6356. </remarks><exception cref="T:System.InvalidCastException">The specified cast is not valid.</exception>
  6357. </member>
  6358. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetValue(System.Int32)">
  6359. <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>
  6360. <format type="text/markdown"><![CDATA[
  6361. ## Remarks
  6362. <xref:Microsoft.Data.SqlClient.SqlDataReader.GetValue%2A> returns data using the .NET Framework types.
  6363. ]]></format>
  6364. </remarks>
  6365. </member>
  6366. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetValues(System.Object[])">
  6367. <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>
  6368. <format type="text/markdown"><![CDATA[
  6369. ## Remarks
  6370. For most applications, this method provides an efficient means for retrieving all columns, instead of retrieving each column individually.
  6371. 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.
  6372. This method returns <xref:System.DBNull> for null database columns.
  6373. ## Examples
  6374. 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.
  6375. [!code-csharp[DataTableReader_GetValues#2](~/../sqlclient/doc/samples/DataTableReader_GetValues.cs#2)]
  6376. ]]></format>
  6377. </remarks>
  6378. </member>
  6379. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.GetXmlReader(System.Int32)">
  6380. <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>
  6381. <format type="text/markdown"><![CDATA[
  6382. ## Remarks
  6383. 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>.
  6384. <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>.
  6385. <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.
  6386. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6387. ]]></format>
  6388. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6389. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6390. 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).
  6391. Trying to read a previously read column in sequential mode.
  6392. 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>
  6393. </member>
  6394. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsCommandBehavior(System.Data.CommandBehavior)">
  6395. <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>
  6396. <see langword="true" /> if the specified <see cref="T:System.Data.CommandBehavior" /> is true, <see langword="false" /> otherwise.</returns><remarks>
  6397. <format type="text/markdown"><![CDATA[
  6398. ## Remarks
  6399. This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
  6400. ]]></format>
  6401. </remarks>
  6402. </member>
  6403. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNull(System.Int32)">
  6404. <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>
  6405. <see langword="true" /> if the specified column value is equivalent to <see cref="T:System.DBNull" />; otherwise <see langword="false" />.</returns><remarks>
  6406. <format type="text/markdown"><![CDATA[
  6407. ## Remarks
  6408. 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.
  6409. [!code-csharp[SqlDataReader_IsDBNull#1](~/../sqlclient/doc/samples/SqlDataReader_IsDBNull.cs#1)]
  6410. ]]></format>
  6411. </remarks>
  6412. </member>
  6413. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.IsDBNullAsync(System.Int32,System.Threading.CancellationToken)">
  6414. <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.
  6415. 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>
  6416. <see langword="true" /> if the specified column value is equivalent to <see langword="DBNull" /> otherwise <see langword="false" />.</returns><remarks>
  6417. <format type="text/markdown"><![CDATA[
  6418. ## Remarks
  6419. For more information, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  6420. ]]></format>
  6421. </remarks><exception cref="T:System.InvalidOperationException">The connection drops or is closed during the data retrieval.
  6422. The <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> is closed during the data retrieval.
  6423. 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).
  6424. Trying to read a previously read column in sequential mode.
  6425. 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.
  6426. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:System.IndexOutOfRangeException">Trying to read a column that does not exist.</exception>
  6427. </member>
  6428. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.NextResult">
  6429. <summary>Advances the data reader to the next result, when reading the results of batch Transact-SQL statements.</summary><returns>
  6430. <see langword="true" /> if there are more result sets; otherwise <see langword="false" />.</returns><remarks>
  6431. <format type="text/markdown"><![CDATA[
  6432. ## Remarks
  6433. Used to process multiple results, which can be generated by executing batch Transact-SQL statements.
  6434. By default, the data reader is positioned on the first result.
  6435. ]]></format>
  6436. </remarks>
  6437. </member>
  6438. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.NextResultAsync(System.Threading.CancellationToken)">
  6439. <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.
  6440. 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>
  6441. <format type="text/markdown"><![CDATA[
  6442. ## Remarks
  6443. For more information about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  6444. ]]></format>
  6445. </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.
  6446. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  6447. </member>
  6448. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.Read">
  6449. <summary>Advances the <see cref="T:Microsoft.Data.SqlClient.SqlDataReader" /> to the next record.</summary><returns>
  6450. <see langword="true" /> if there are more rows; otherwise <see langword="false" />.</returns><remarks>
  6451. <format type="text/markdown"><![CDATA[
  6452. ## Remarks
  6453. 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.
  6454. 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>.
  6455. ## Examples
  6456. 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.
  6457. [!code-csharp[SqlDataReader_Read Example#1](~/../sqlclient/doc/samples/SqlDataReader_Read.cs#1)]
  6458. ]]></format>
  6459. </remarks><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  6460. </member>
  6461. <member name="M:Microsoft.Data.SqlClient.SqlDataReader.ReadAsync(System.Threading.CancellationToken)">
  6462. <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.
  6463. 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>
  6464. <format type="text/markdown"><![CDATA[
  6465. ## Remarks
  6466. 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.
  6467. For more information, including code samples, about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](~/docs/framework/data/adonet/asynchronous-programming.md).
  6468. ]]></format>
  6469. </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.
  6470. <see langword="Context Connection=true" /> is specified in the connection string.</exception><exception cref="T:Microsoft.Data.SqlClient.SqlException">SQL Server returned an error while executing the command text.</exception>
  6471. </member>
  6472. <member name="T:Microsoft.Data.SqlClient.SqlDependency">
  6473. <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>
  6474. <format type="text/markdown"><![CDATA[
  6475. ## Remarks
  6476. <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.
  6477. 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).
  6478. > [!NOTE]
  6479. > <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.
  6480. For more information, see [Query Notifications in SQL Server](~/docs/framework/data/adonet/sql/query-notifications-in-sql-server.md) and [Building Notification Solutions](https://docs.microsoft.com/previous-versions/sql/sql-server-2005/ms171065(v%3dsql.90)).
  6481. > [!NOTE]
  6482. > The <xref:Microsoft.Data.SqlClient.SqlDependency.OnChange> event may be generated on a different thread from the thread that initiated command execution.
  6483. Query notifications are supported only for SELECT statements that meet a list of specific requirements.
  6484. ]]></format>
  6485. </remarks>
  6486. </member>
  6487. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor">
  6488. <summary>Creates a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlDependency" /> class with the default settings.</summary><remarks>
  6489. <format type="text/markdown"><![CDATA[
  6490. ## Remarks
  6491. 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.
  6492. 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).
  6493. ]]></format>
  6494. </remarks>
  6495. </member>
  6496. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor(Microsoft.Data.SqlClient.SqlCommand)">
  6497. <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>
  6498. <format type="text/markdown"><![CDATA[
  6499. ## Remarks
  6500. 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.
  6501. 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).
  6502. ]]></format>
  6503. </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>
  6504. </member>
  6505. <member name="M:Microsoft.Data.SqlClient.SqlDependency.#ctor(Microsoft.Data.SqlClient.SqlCommand,System.String,System.Int32)">
  6506. <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>
  6507. <format type="text/markdown"><![CDATA[
  6508. ## Remarks
  6509. 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).
  6510. ]]></format>
  6511. </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.
  6512. An attempt was made to create a **SqlDependency** instance from within SQLCLR.</exception>
  6513. </member>
  6514. <member name="P:Microsoft.Data.SqlClient.SqlDependency.HasChanges">
  6515. <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>
  6516. <format type="text/markdown"><![CDATA[
  6517. ## Remarks
  6518. 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.
  6519. 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.
  6520. ]]></format>
  6521. </remarks>
  6522. </member>
  6523. <member name="P:Microsoft.Data.SqlClient.SqlDependency.Id">
  6524. <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>
  6525. <format type="text/markdown"><![CDATA[
  6526. ## Remarks
  6527. The <xref:Microsoft.Data.SqlClient.SqlDependency.Id%2A> property is used to uniquely identify a given <xref:Microsoft.Data.SqlClient.SqlDependency> instance.
  6528. ]]></format>
  6529. </remarks>
  6530. </member>
  6531. <member name="E:Microsoft.Data.SqlClient.SqlDependency.OnChange">
  6532. <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>
  6533. <format type="text/markdown"><![CDATA[
  6534. ## Remarks
  6535. <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.
  6536. 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>.
  6537. ]]></format>
  6538. </remarks>
  6539. </member>
  6540. <member name="M:Microsoft.Data.SqlClient.SqlDependency.AddCommandDependency(Microsoft.Data.SqlClient.SqlCommand)">
  6541. <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>
  6542. <format type="text/markdown"><![CDATA[
  6543. ## Remarks
  6544. 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).
  6545. ]]></format>
  6546. </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>
  6547. </member>
  6548. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String)">
  6549. <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>
  6550. <see langword="true" /> if the listener initialized successfully; <see langword="false" /> if a compatible listener already exists.</returns><remarks>
  6551. <format type="text/markdown"><![CDATA[
  6552. ## Remarks
  6553. 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.
  6554. For additional remarks, see <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A>.
  6555. ]]></format>
  6556. </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.
  6557. 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.
  6558. Also, any underlying **SqlClient** exceptions.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />
  6559. </member>
  6560. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)">
  6561. <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>
  6562. <see langword="true" /> if the listener initialized successfully; <see langword="false" /> if a compatible listener already exists.</returns><remarks>
  6563. <format type="text/markdown"><![CDATA[
  6564. ## Remarks
  6565. 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.
  6566. 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.
  6567. For additional remarks, see <xref:Microsoft.Data.SqlClient.SqlDependency.Start%2A>.
  6568. ]]></format>
  6569. </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.
  6570. 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.
  6571. Also, any underlying **SqlClient** exceptions.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />
  6572. </member>
  6573. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Stop(System.String)">
  6574. <param name="connectionString">Connection string for the instance of SQL Server that was used in a previous <see cref="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String)" /> call.</param><summary>Stops a listener for a connection specified in a previous <see cref="o:Microsoft.Data.SqlClient.SqlDependency.Start" /> call.</summary><returns>
  6575. <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>
  6576. <format type="text/markdown"><![CDATA[
  6577. ## Remarks
  6578. 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.
  6579. ]]></format>
  6580. </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>
  6581. </member>
  6582. <member name="M:Microsoft.Data.SqlClient.SqlDependency.Stop(System.String,System.String)">
  6583. <param name="connectionString">Connection string for the instance of SQL Server that was used in a previous <see cref="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</param><param name="queue">The SQL Server Service Broker queue that was used in a previous <see cref="M:Microsoft.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</param><summary>Stops a listener for a connection specified in a previous <see cref="o:Microsoft.Data.SqlClient.SqlDependency.Start" /> call.</summary><returns>
  6584. <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>
  6585. <format type="text/markdown"><![CDATA[
  6586. ## Remarks
  6587. 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.
  6588. ]]></format>
  6589. </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>
  6590. </member>
  6591. <member name="T:Microsoft.Data.SqlClient.SqlError">
  6592. <summary>Collects information relevant to a warning or error returned by SQL Server.</summary><remarks>
  6593. <format type="text/markdown"><![CDATA[
  6594. ## Remarks
  6595. 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.
  6596. 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.
  6597. 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.
  6598. 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).
  6599. ## Examples
  6600. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6601. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  6602. ]]></format>
  6603. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlException" />
  6604. </member>
  6605. <member name="P:Microsoft.Data.SqlClient.SqlError.Class">
  6606. <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>
  6607. <format type="text/markdown"><![CDATA[
  6608. ## Remarks
  6609. 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.
  6610. 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.
  6611. 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).
  6612. ## Examples
  6613. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6614. [!code-csharp[SqlError_State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6615. ]]></format>
  6616. </remarks>
  6617. </member>
  6618. <member name="P:Microsoft.Data.SqlClient.SqlError.LineNumber">
  6619. <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>
  6620. <format type="text/markdown"><![CDATA[
  6621. ## Remarks
  6622. Line numbering starts at 1. If the value is 0, the line number is not applicable.
  6623. 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).
  6624. ## Examples
  6625. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6626. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6627. ]]></format>
  6628. </remarks>
  6629. </member>
  6630. <member name="P:Microsoft.Data.SqlClient.SqlError.Message">
  6631. <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>
  6632. <format type="text/markdown"><![CDATA[
  6633. ## Examples
  6634. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6635. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6636. ]]></format>
  6637. </remarks>
  6638. </member>
  6639. <member name="P:Microsoft.Data.SqlClient.SqlError.Number">
  6640. <summary>Gets a number that identifies the type of error.</summary><value>The number that identifies the type of error.</value><remarks>
  6641. <format type="text/markdown"><![CDATA[
  6642. ## Remarks
  6643. The following table describes the possible values for this property:
  6644. |Source of Error|SqlError.Number|SqlError.State|SqlException has inner Win32Exception (beginning with.NET Framework 4.5)|
  6645. |---------------------|---------------------|--------------------|--------------------------------------------------------------------------------|
  6646. |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|
  6647. |Connection timeout|-2|0|Yes (Number = 258)|
  6648. |Communication error (non-LocalDB)|Win32 error code|0|Yes (Number = Win32 error code)|
  6649. |Communication error (LocalDB)|Win32 error code|0|No|
  6650. |Encryption capability mismatch|20|0|No|
  6651. |Failed to start LocalDB|Win32 error code|0|No|
  6652. |Read-only routing failure|0|0|No|
  6653. |Server had severe error processing query|0|0|No|
  6654. |Processed cancellation while parsing results|0|0|No|
  6655. |Failed to create user instance|0|0|No|
  6656. 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).
  6657. ## Examples
  6658. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6659. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6660. ]]></format>
  6661. </remarks>
  6662. </member>
  6663. <member name="P:Microsoft.Data.SqlClient.SqlError.Procedure">
  6664. <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>
  6665. <format type="text/markdown"><![CDATA[
  6666. ## Examples
  6667. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6668. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6669. ]]></format>
  6670. </remarks>
  6671. </member>
  6672. <member name="P:Microsoft.Data.SqlClient.SqlError.Server">
  6673. <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>
  6674. <format type="text/markdown"><![CDATA[
  6675. ## Examples
  6676. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6677. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6678. ]]></format>
  6679. </remarks>
  6680. </member>
  6681. <member name="P:Microsoft.Data.SqlClient.SqlError.Source">
  6682. <summary>Gets the name of the provider that generated the error.</summary><value>The name of the provider that generated the error.</value><remarks>
  6683. <format type="text/markdown"><![CDATA[
  6684. ## Examples
  6685. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6686. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6687. ]]></format>
  6688. </remarks>
  6689. </member>
  6690. <member name="P:Microsoft.Data.SqlClient.SqlError.State">
  6691. <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>
  6692. <format type="text/markdown"><![CDATA[
  6693. ## Remarks
  6694. State is only set for errors that are received from the server.
  6695. For more information on errors generated by SQL Server, see [Understanding Database Engine Errors](https://msdn.microsoft.com/library/ms165761.aspx).
  6696. ## Examples
  6697. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6698. [!code-csharp[SqlError.State Example#1](~/../sqlclient/doc/samples/SqlError_State.cs#1)]
  6699. ]]></format>
  6700. </remarks>
  6701. </member>
  6702. <member name="M:Microsoft.Data.SqlClient.SqlError.ToString">
  6703. <summary>Gets the complete text of the error message.</summary><returns>The complete text of the error.</returns><remarks>
  6704. <format type="text/markdown"><![CDATA[
  6705. ## Remarks
  6706. The string is in the form "SqlError:", followed by the <xref:Microsoft.Data.SqlClient.SqlError.Message%2A>, and the stack trace. For example:
  6707. SqlError:UserId or Password not valid. \<stack trace>
  6708. ## Examples
  6709. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6710. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  6711. ]]></format>
  6712. </remarks>
  6713. </member>
  6714. <member name="T:Microsoft.Data.SqlClient.SqlErrorCollection">
  6715. <summary>Collects all errors generated by the .NET Framework Data Provider for SQL Server. This class cannot be inherited.</summary><remarks>
  6716. <format type="text/markdown"><![CDATA[
  6717. ## Remarks
  6718. 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.
  6719. ## Examples
  6720. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6721. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  6722. ]]></format>
  6723. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlError" /><altmember cref="T:Microsoft.Data.SqlClient.SqlException" />
  6724. </member>
  6725. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.Count">
  6726. <summary>Gets the number of errors in the collection.</summary><value>The total number of errors in the collection.</value><remarks>
  6727. <format type="text/markdown"><![CDATA[
  6728. ## Examples
  6729. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6730. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  6731. ]]></format>
  6732. </remarks>
  6733. </member>
  6734. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.Item(System.Int32)">
  6735. <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>
  6736. <format type="text/markdown"><![CDATA[
  6737. ## Examples
  6738. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6739. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  6740. ]]></format>
  6741. </remarks><exception cref="T:System.IndexOutOfRangeException">Index parameter is outside array bounds.</exception><altmember cref="P:Microsoft.Data.SqlClient.SqlErrorCollection.Count" />
  6742. </member>
  6743. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.System#Collections#ICollection#IsSynchronized">
  6744. <summary>For a description of this member, see <see cref="P:System.Collections.ICollection.IsSynchronized" />.</summary><value>
  6745. <see langword="true" /> if access to the <see cref="T:System.Collections.ICollection" /> is synchronized (thread safe); otherwise, <see langword="false" />.</value><remarks>
  6746. <format type="text/markdown"><![CDATA[
  6747. ## Remarks
  6748. 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.
  6749. ]]></format>
  6750. </remarks>
  6751. </member>
  6752. <member name="P:Microsoft.Data.SqlClient.SqlErrorCollection.System#Collections#ICollection#SyncRoot">
  6753. <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>
  6754. <format type="text/markdown"><![CDATA[
  6755. ## Remarks
  6756. 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.
  6757. ]]></format>
  6758. </remarks>
  6759. </member>
  6760. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.CopyTo(System.Array,System.Int32)">
  6761. <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>
  6762. </member>
  6763. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.CopyTo(Microsoft.Data.SqlClient.SqlError[],System.Int32)">
  6764. <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>
  6765. </member>
  6766. <member name="M:Microsoft.Data.SqlClient.SqlErrorCollection.GetEnumerator">
  6767. <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>
  6768. <format type="text/markdown"><![CDATA[
  6769. ## Remarks
  6770. Enumerators can be used to read the data in a collection, but they cannot be used to modify the underlying collection.
  6771. ]]></format>
  6772. </remarks>
  6773. </member>
  6774. <member name="T:Microsoft.Data.SqlClient.SqlException">
  6775. <summary>The exception that is thrown when SQL Server returns a warning or error. This class cannot be inherited.</summary><remarks>
  6776. <format type="text/markdown"><![CDATA[
  6777. ## Remarks
  6778. 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>.
  6779. 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.
  6780. 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.
  6781. 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.
  6782. 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.
  6783. Note that beginning with .NET Framework 4.5, <xref:Microsoft.Data.SqlClient.SqlException> can return an inner <xref:System.ComponentModel.Win32Exception>.
  6784. 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.
  6785. 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.
  6786. 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.
  6787. 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:
  6788. ```csharp
  6789. try {
  6790. // code here
  6791. }
  6792. catch (SqlException odbcEx) {
  6793. // Handle more specific SqlException exception here.
  6794. }
  6795. catch (Exception ex) {
  6796. // Handle generic ones here.
  6797. }
  6798. ```
  6799. Or:
  6800. ```csharp
  6801. try {
  6802. // code here
  6803. }
  6804. catch (Exception ex) {
  6805. if (ex is SqlException) {
  6806. // Handle more specific SqlException exception here.
  6807. }
  6808. else {
  6809. // Handle generic ones here.
  6810. }
  6811. }
  6812. ```
  6813. 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.
  6814. ## Examples
  6815. The following example generates a <xref:Microsoft.Data.SqlClient.SqlException> and then displays the exception.
  6816. [!code-csharp[SqlException_Errors1 Example#1](~/../sqlclient/doc/samples/SqlException_Errors1.cs#1)]
  6817. ]]></format>
  6818. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlError" /><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" />
  6819. </member>
  6820. <member name="P:Microsoft.Data.SqlClient.SqlException.Class">
  6821. <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>
  6822. <format type="text/markdown"><![CDATA[
  6823. ## Remarks
  6824. 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.
  6825. 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.
  6826. For information about the warning and informational messages sent by SQL Server, see the Troubleshooting section of the SQL Server documentation.
  6827. 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.
  6828. ## Examples
  6829. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6830. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6831. ]]></format>
  6832. </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" />
  6833. </member>
  6834. <member name="P:Microsoft.Data.SqlClient.SqlException.ClientConnectionId">
  6835. <summary>Represents the client connection ID. For more information, see <see href="https://docs.microsoft.com/dotnet/framework/data/adonet/data-tracing">Data Tracing in ADO.NET</see>.</summary><value>The client connection ID.</value><remarks>
  6836. <format type="text/markdown"><![CDATA[
  6837. ## Remarks
  6838. For a code sample, see <xref:Microsoft.Data.SqlClient.SqlException.ToString%2A>.
  6839. ]]></format>
  6840. </remarks>
  6841. </member>
  6842. <member name="P:Microsoft.Data.SqlClient.SqlException.Errors">
  6843. <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>
  6844. <format type="text/markdown"><![CDATA[
  6845. ## Remarks
  6846. The <xref:Microsoft.Data.SqlClient.SqlErrorCollection> class always contains at least one instance of the <xref:Microsoft.Data.SqlClient.SqlError> class.
  6847. 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).
  6848. ## Examples
  6849. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6850. [!code-csharp[SqlError_ToString Example#1](~/../sqlclient/doc/samples/SqlError_ToString.cs#1)]
  6851. ]]></format>
  6852. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlErrorCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlError" />
  6853. </member>
  6854. <member name="P:Microsoft.Data.SqlClient.SqlException.LineNumber">
  6855. <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>
  6856. <format type="text/markdown"><![CDATA[
  6857. ## Remarks
  6858. The line numbering starts at 1; if 0 is returned, the line number is not applicable.
  6859. 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.
  6860. ## Examples
  6861. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6862. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6863. ]]></format>
  6864. </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" />
  6865. </member>
  6866. <member name="P:Microsoft.Data.SqlClient.SqlException.Number">
  6867. <summary>Gets a number that identifies the type of error.</summary><value>The number that identifies the type of error.</value><remarks>
  6868. <format type="text/markdown"><![CDATA[
  6869. ## Remarks
  6870. This is a wrapper for the <xref:Microsoft.Data.SqlClient.SqlError.Number%2A> property of the first <xref:Microsoft.Data.SqlClient.SqlError> in the <xref:Microsoft.Data.SqlClient.SqlException.Errors%2A> property. For more information on SQL Server engine errors, see [Database Engine Events and Errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
  6871. ## Examples
  6872. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6873. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6874. ]]></format>
  6875. </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" />
  6876. </member>
  6877. <member name="P:Microsoft.Data.SqlClient.SqlException.Procedure">
  6878. <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>
  6879. <format type="text/markdown"><![CDATA[
  6880. ## Remarks
  6881. 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.
  6882. ## Examples
  6883. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6884. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6885. ]]></format>
  6886. </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" />
  6887. </member>
  6888. <member name="P:Microsoft.Data.SqlClient.SqlException.Server">
  6889. <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>
  6890. <format type="text/markdown"><![CDATA[
  6891. ## Remarks
  6892. 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.
  6893. ## Examples
  6894. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6895. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6896. ]]></format>
  6897. </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" />
  6898. </member>
  6899. <member name="P:Microsoft.Data.SqlClient.SqlException.Source">
  6900. <summary>Gets the name of the provider that generated the error.</summary><value>The name of the provider that generated the error.</value><remarks>
  6901. <format type="text/markdown"><![CDATA[
  6902. ## Remarks
  6903. 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.
  6904. ## Examples
  6905. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6906. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6907. ]]></format>
  6908. </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" />
  6909. </member>
  6910. <member name="P:Microsoft.Data.SqlClient.SqlException.State">
  6911. <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>
  6912. <format type="text/markdown"><![CDATA[
  6913. ## Remarks
  6914. 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.
  6915. ## Examples
  6916. The following example displays each <xref:Microsoft.Data.SqlClient.SqlError> within the <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection.
  6917. [!code-csharp[SqlException_Errors2 Example#1](~/../sqlclient/doc/samples/SqlException_Errors2.cs#1)]
  6918. ]]></format>
  6919. </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" />
  6920. </member>
  6921. <member name="M:Microsoft.Data.SqlClient.SqlException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
  6922. <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>
  6923. <format type="text/markdown"><![CDATA[
  6924. ## Remarks
  6925. `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.
  6926. ]]></format>
  6927. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="si" /> parameter is a null reference (<see langword="Nothing" /> in Visual Basic).</exception>
  6928. </member>
  6929. <member name="M:Microsoft.Data.SqlClient.SqlException.ToString">
  6930. <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>
  6931. <format type="text/markdown"><![CDATA[
  6932. ## Examples
  6933. 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:
  6934. ```csharp
  6935. using Microsoft.Data.SqlClient;
  6936. using System;
  6937. public class A {
  6938. public static void Main() {
  6939. SqlConnection connection = new SqlConnection();
  6940. connection.ConnectionString = "Data Source=a_valid_server;Initial Catalog=Northwinda;Integrated Security=true";
  6941. try {
  6942. connection.Open();
  6943. }
  6944. catch (SqlException p) {
  6945. Console.WriteLine("{0}", p.ClientConnectionId);
  6946. Console.WriteLine("{0}", p.ToString());
  6947. }
  6948. connection.Close();
  6949. }
  6950. }
  6951. ```
  6952. The following Visual Basic sample is functionally equivalent to the previous (C#) sample:
  6953. ```vb
  6954. Imports Microsoft.Data.SqlClient
  6955. Imports System
  6956. Module Module1
  6957. Sub Main()
  6958. Dim connection As New SqlConnection()
  6959. connection.ConnectionString = "Data Source=a_valid_server;Initial Catalog=Northwinda;Integrated Security=true"
  6960. Try
  6961. connection.Open()
  6962. Catch p As SqlException
  6963. Console.WriteLine("{0}", p.ClientConnectionId)
  6964. Console.WriteLine("{0}", p.ToString())
  6965. End Try
  6966. connection.Close()
  6967. End Sub
  6968. End Module
  6969. ```
  6970. ]]></format>
  6971. </remarks>
  6972. </member>
  6973. <member name="T:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs">
  6974. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlConnection.InfoMessage" /> event.</summary><remarks>
  6975. <format type="text/markdown"><![CDATA[
  6976. ## Remarks
  6977. The <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event contains a <xref:Microsoft.Data.SqlClient.SqlErrorCollection> collection which contains the warnings sent from the server.
  6978. An <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event is generated when a SQL Server message with a severity level of 10 or less occurs.
  6979. ]]></format>
  6980. </remarks>
  6981. </member>
  6982. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Errors">
  6983. <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>
  6984. </member>
  6985. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Message">
  6986. <summary>Gets the full text of the error sent from the database.</summary><value>The full text of the error.</value><remarks>
  6987. <format type="text/markdown"><![CDATA[
  6988. ## Remarks
  6989. 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.
  6990. ]]></format>
  6991. </remarks>
  6992. </member>
  6993. <member name="P:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.Source">
  6994. <summary>Gets the name of the object that generated the error.</summary><value>The name of the object that generated the error.</value><remarks>
  6995. <format type="text/markdown"><![CDATA[
  6996. ## Remarks
  6997. 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.
  6998. ]]></format>
  6999. </remarks>
  7000. </member>
  7001. <member name="M:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs.ToString">
  7002. <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>
  7003. </member>
  7004. <member name="T:Microsoft.Data.SqlClient.SqlInfoMessageEventHandler">
  7005. <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>
  7006. <format type="text/markdown"><![CDATA[
  7007. ## Remarks
  7008. When you create a <xref:Microsoft.Data.SqlClient.SqlInfoMessageEventArgs> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
  7009. ]]></format>
  7010. </remarks>
  7011. </member>
  7012. <member name="T:Microsoft.Data.SqlClient.SqlNotificationEventArgs">
  7013. <summary>Represents the set of arguments passed to the notification event handler.</summary><remarks>To be added.</remarks>
  7014. </member>
  7015. <member name="M:Microsoft.Data.SqlClient.SqlNotificationEventArgs.#ctor(Microsoft.Data.SqlClient.SqlNotificationType,Microsoft.Data.SqlClient.SqlNotificationInfo,Microsoft.Data.SqlClient.SqlNotificationSource)">
  7016. <param name="type">
  7017. <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">
  7018. <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">
  7019. <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>
  7020. </member>
  7021. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Info">
  7022. <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>
  7023. <format type="text/markdown"><![CDATA[
  7024. ## Remarks
  7025. This event may occur because the data in the store actually changed, or the notification is no longer valid (for example, it timed out).
  7026. ]]></format>
  7027. </remarks>
  7028. </member>
  7029. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Source">
  7030. <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>
  7031. </member>
  7032. <member name="P:Microsoft.Data.SqlClient.SqlNotificationEventArgs.Type">
  7033. <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>
  7034. </member>
  7035. <member name="T:Microsoft.Data.SqlClient.SqlNotificationInfo">
  7036. <summary>This enumeration provides additional information about the different notifications that can be received by the dependency event handler.</summary><remarks>
  7037. <format type="text/markdown"><![CDATA[
  7038. ## Remarks
  7039. The <xref:Microsoft.Data.SqlClient.SqlNotificationInfo> enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class.
  7040. ]]></format>
  7041. </remarks>
  7042. </member>
  7043. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.AlreadyChanged">
  7044. <summary>The <see langword="SqlDependency" /> object already fired, and new commands cannot be added to it.</summary>
  7045. </member>
  7046. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Alter">
  7047. <summary>An underlying server object related to the query was modified.</summary>
  7048. </member>
  7049. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Delete">
  7050. <summary>Data was changed by a DELETE statement.</summary>
  7051. </member>
  7052. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Drop">
  7053. <summary>An underlying object related to the query was dropped.</summary>
  7054. </member>
  7055. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Error">
  7056. <summary>An internal server error occurred.</summary>
  7057. </member>
  7058. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Expired">
  7059. <summary>The <see langword="SqlDependency" /> object has expired.</summary>
  7060. </member>
  7061. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Insert">
  7062. <summary>Data was changed by an INSERT statement.</summary>
  7063. </member>
  7064. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Invalid">
  7065. <summary>A statement was provided that cannot be notified (for example, an UPDATE statement).</summary>
  7066. </member>
  7067. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Isolation">
  7068. <summary>The statement was executed under an isolation mode that was not valid (for example, Snapshot).</summary>
  7069. </member>
  7070. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Merge">
  7071. <summary>Used to distinguish the server-side cause for a query notification firing.</summary>
  7072. </member>
  7073. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Options">
  7074. <summary>The SET options were not set appropriately at subscription time.</summary>
  7075. </member>
  7076. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.PreviousFire">
  7077. <summary>A previous statement has caused query notifications to fire under the current transaction.</summary>
  7078. </member>
  7079. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Query">
  7080. <summary>A SELECT statement that cannot be notified or was provided.</summary>
  7081. </member>
  7082. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Resource">
  7083. <summary>Fires as a result of server resource pressure.</summary>
  7084. </member>
  7085. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Restart">
  7086. <summary>The server was restarted (notifications are sent during restart.).</summary>
  7087. </member>
  7088. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.TemplateLimit">
  7089. <summary>The subscribing query causes the number of templates on one of the target tables to exceed the maximum allowable limit.</summary>
  7090. </member>
  7091. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Truncate">
  7092. <summary>One or more tables were truncated.</summary>
  7093. </member>
  7094. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Unknown">
  7095. <summary>Used when the info option sent by the server was not recognized by the client.</summary>
  7096. </member>
  7097. <member name="F:Microsoft.Data.SqlClient.SqlNotificationInfo.Update">
  7098. <summary>Data was changed by an UPDATE statement.</summary>
  7099. </member>
  7100. <member name="T:Microsoft.Data.SqlClient.SqlNotificationSource">
  7101. <summary>Indicates the source of the notification received by the dependency event handler.</summary><remarks>
  7102. <format type="text/markdown"><![CDATA[
  7103. ## Remarks
  7104. The `SqlNotificationSource` enumeration is referenced by an instance of the <xref:Microsoft.Data.SqlClient.SqlNotificationEventArgs> class.
  7105. 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).
  7106. ]]></format>
  7107. </remarks>
  7108. </member>
  7109. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Client">
  7110. <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>
  7111. </member>
  7112. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Data">
  7113. <summary>Data has changed; for example, an insert, update, delete, or truncate operation occurred.</summary>
  7114. </member>
  7115. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Database">
  7116. <summary>The database state changed; for example, the database related to the query was dropped or detached.</summary>
  7117. </member>
  7118. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Environment">
  7119. <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>
  7120. </member>
  7121. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Execution">
  7122. <summary>A run-time error occurred during execution.</summary>
  7123. </member>
  7124. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Object">
  7125. <summary>A database object changed; for example, an underlying object related to the query was dropped or modified.</summary>
  7126. </member>
  7127. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Owner">
  7128. <summary>Internal only; not intended to be used in your code.</summary>
  7129. </member>
  7130. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Statement">
  7131. <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>
  7132. </member>
  7133. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.System">
  7134. <summary>A system-related event occurred. For example, there was an internal error, the server was restarted, or resource pressure caused the invalidation.</summary>
  7135. </member>
  7136. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Timeout">
  7137. <summary>The subscription time-out expired.</summary>
  7138. </member>
  7139. <member name="F:Microsoft.Data.SqlClient.SqlNotificationSource.Unknown">
  7140. <summary>Used when the source option sent by the server was not recognized by the client.</summary>
  7141. </member>
  7142. <member name="T:Microsoft.Data.SqlClient.SqlNotificationType">
  7143. <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>
  7144. <format type="text/markdown"><![CDATA[
  7145. ## Remarks
  7146. 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.
  7147. ]]></format>
  7148. </remarks>
  7149. </member>
  7150. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Change">
  7151. <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>
  7152. </member>
  7153. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Subscribe">
  7154. <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>
  7155. </member>
  7156. <member name="F:Microsoft.Data.SqlClient.SqlNotificationType.Unknown">
  7157. <summary>Used when the type option sent by the server was not recognized by the client.</summary>
  7158. </member>
  7159. <member name="T:Microsoft.Data.SqlClient.SqlParameter">
  7160. <summary>Represents a parameter to a <see cref="T:Microsoft.Data.SqlClient.SqlCommand" /> and optionally its mapping to <see cref="T:System.Data.DataSet" /> columns. This class cannot be inherited. For more information on parameters, see [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).</summary><remarks>
  7161. <format type="text/markdown"><![CDATA[
  7162. ## Remarks
  7163. Parameter names are not case sensitive.
  7164. > [!NOTE]
  7165. > Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.
  7166. For more information, along with additional sample code demonstrating how to use parameters, see [Commands and Parameters](~/docs/framework/data/adonet/commands-and-parameters.md).
  7167. ## Examples
  7168. The following example creates multiple instances of <xref:Microsoft.Data.SqlClient.SqlParameter> through the <xref:Microsoft.Data.SqlClient.SqlParameterCollection> collection within the <xref:Microsoft.Data.SqlClient.SqlDataAdapter>. These parameters are used to select data from the data source and put the data in the <xref:System.Data.DataSet>. This example assumes that a <xref:System.Data.DataSet> and a <xref:Microsoft.Data.SqlClient.SqlDataAdapter> have already been created by using the appropriate schema, commands, and connection. For more information and additional examples on using parameters, see [Retrieving and Modifying Data in ADO.NET](~/docs/framework/data/adonet/retrieving-and-modifying-data.md) and [Configuring Parameters and Parameter Data Types](~/docs/framework/data/adonet/configuring-parameters-and-parameter-data-types.md).
  7169. [!code-csharp[SqlParameterCollection_Add6](~/../sqlclient/doc/samples/SqlParameterCollection_Add6.cs#1)]
  7170. ]]></format>
  7171. </remarks><altmember cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /><altmember cref="T:Microsoft.Data.SqlClient.SqlCommand" />
  7172. </member>
  7173. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor">
  7174. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class.</summary><remarks>
  7175. <format type="text/markdown"><![CDATA[
  7176. ## Examples
  7177. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7178. [!code-csharp[SqlParameter_SqlParameter Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter.cs#1)]
  7179. ]]></format>
  7180. </remarks>
  7181. </member>
  7182. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType)">
  7183. <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>
  7184. <format type="text/markdown"><![CDATA[
  7185. ## Remarks
  7186. The data type and, if appropriate, **Size** and <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> are inferred from the value of the `dbType` parameter.
  7187. ## Examples
  7188. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7189. [!code-csharp[SqlParameter_SqlParameter2 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter2.cs#1)]
  7190. ]]></format>
  7191. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7192. </member>
  7193. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32)">
  7194. <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>
  7195. <format type="text/markdown"><![CDATA[
  7196. ## Remarks
  7197. The **Size** is inferred from the value of the `dbType` parameter if it is not explicitly set in the `size` parameter.
  7198. ## Examples
  7199. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7200. [!code-csharp[SqlParameter_SqlParameter4 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter4.cs#1)]
  7201. ]]></format>
  7202. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7203. </member>
  7204. <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)">
  7205. <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">
  7206. <see langword="true" /> if the value of the field can be null; otherwise, <see langword="false" />.</param><param name="precision">The total number of digits to the left and right of the decimal point to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="scale">The total number of decimal places to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><param name="sourceVersion">One of the <see cref="T:System.Data.DataRowVersion" /> values.</param><param name="value">An <see cref="T:System.Object" /> that is the value of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name, the type of the parameter, the size of the parameter, a <see cref="T:System.Data.ParameterDirection" />, the precision of the parameter, the scale of the parameter, the source column, a <see cref="T:System.Data.DataRowVersion" /> to use, and the value of the parameter.</summary><remarks>
  7207. <format type="text/markdown"><![CDATA[
  7208. ## Remarks
  7209. 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.
  7210. ## Examples
  7211. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7212. [!code-csharp[SqlParameter_SqlParameter1 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter1.cs#1)]
  7213. ]]></format>
  7214. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7215. </member>
  7216. <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)">
  7217. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The length of the parameter.</param><param name="direction">One of the <see cref="T:System.Data.ParameterDirection" /> values.</param><param name="precision">The total number of digits to the left and right of the decimal point to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="scale">The total number of decimal places to which <see cref="P:Microsoft.Data.SqlClient.SqlParameter.Value" /> is resolved.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><param name="sourceVersion">One of the <see cref="T:System.Data.DataRowVersion" /> values.</param><param name="sourceColumnNullMapping">
  7218. <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>
  7219. <format type="text/markdown"><![CDATA[
  7220. ## Remarks
  7221. 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.
  7222. ]]></format>
  7223. </remarks>
  7224. </member>
  7225. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Data.SqlDbType,System.Int32,System.String)">
  7226. <param name="parameterName">The name of the parameter to map.</param><param name="dbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The length of the parameter.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> class that uses the parameter name, the <see cref="T:System.Data.SqlDbType" />, the size, and the source column name.</summary><remarks>
  7227. <format type="text/markdown"><![CDATA[
  7228. ## Remarks
  7229. The **Size** is inferred from the value of the `dbType` parameter if it is not explicitly set in the `size` parameter.
  7230. ## Examples
  7231. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7232. [!code-csharp[SqlParameter_SqlParameter5 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter5.cs#1)]
  7233. ]]></format>
  7234. </remarks><exception cref="T:System.ArgumentException">The value supplied in the <paramref name="dbType" /> parameter is an invalid back-end data type.</exception>
  7235. </member>
  7236. <member name="M:Microsoft.Data.SqlClient.SqlParameter.#ctor(System.String,System.Object)">
  7237. <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>
  7238. <format type="text/markdown"><![CDATA[
  7239. ## Remarks
  7240. 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>.
  7241. 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.
  7242. ```csharp
  7243. Parameter = new SqlParameter("@pname", (object)0);
  7244. ```
  7245. 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.
  7246. ## Examples
  7247. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7248. [!code-csharp[SqlParameter_SqlParameter6 Example#1](~/../sqlclient/doc/samples/SqlParameter_SqlParameter6.cs#1)]
  7249. ]]></format>
  7250. </remarks>
  7251. </member>
  7252. <member name="P:Microsoft.Data.SqlClient.SqlParameter.CompareInfo">
  7253. <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>
  7254. </member>
  7255. <member name="P:Microsoft.Data.SqlClient.SqlParameter.DbType">
  7256. <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>
  7257. <format type="text/markdown"><![CDATA[
  7258. ## Remarks
  7259. 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>.
  7260. For a list of the supported data types, see the appropriate <xref:System.Data.SqlDbType> member. For more information, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md).
  7261. ## Examples
  7262. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7263. [!code-csharp[SqlParameter_IsNullable Example#1](~/../sqlclient/doc/samples/SqlParameter_IsNullable.cs#1)]
  7264. ]]></format>
  7265. </remarks>
  7266. </member>
  7267. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Direction">
  7268. <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>
  7269. <format type="text/markdown"><![CDATA[
  7270. ## Remarks
  7271. 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.
  7272. `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>.
  7273. ## Examples
  7274. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7275. [Commands and Parameters](~/docs/framework/data/adonet/commands-and-parameters.md)
  7276. [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md)
  7277. [SQL Server and ADO.NET](~/docs/framework/data/adonet/sql/index.md)
  7278. ]]></format>
  7279. </remarks><exception cref="T:System.ArgumentException">The property was not set to one of the valid <see cref="T:System.Data.ParameterDirection" /> values.</exception>
  7280. </member>
  7281. <member name="P:Microsoft.Data.SqlClient.SqlParameter.IsNullable">
  7282. <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>
  7283. <see langword="true" /> if null values are accepted; otherwise, <see langword="false" />. The default is <see langword="false" />.</value><remarks>
  7284. <format type="text/markdown"><![CDATA[
  7285. ## Remarks
  7286. Null values are handled using the <xref:System.DBNull> class.
  7287. ## Examples
  7288. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7289. [!code-csharp[SqlParameter#2](~/../sqlclient/doc/samples/SqlParameter.cs#2)]
  7290. ]]></format>
  7291. </remarks>
  7292. </member>
  7293. <member name="P:Microsoft.Data.SqlClient.SqlParameter.LocaleId">
  7294. <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>
  7295. <format type="text/markdown"><![CDATA[
  7296. ## Remarks
  7297. 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.
  7298. ```csharp
  7299. static void CreateSqlParameterLocaleId(){
  7300. SqlParameter parameter = new SqlParameter("pName", SqlDbType.VarChar);
  7301. parameter.LocaleId = 1033; // English - United States
  7302. }
  7303. ```
  7304. ]]></format>
  7305. </remarks>
  7306. </member>
  7307. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Offset">
  7308. <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>
  7309. <format type="text/markdown"><![CDATA[
  7310. ## Remarks
  7311. 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.
  7312. `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.
  7313. ## Examples
  7314. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7315. [!code-csharp[SqlParameter#3](~/../sqlclient/doc/samples/SqlParameter.cs#3)]
  7316. ]]></format>
  7317. </remarks>
  7318. </member>
  7319. <member name="P:Microsoft.Data.SqlClient.SqlParameter.ParameterName">
  7320. <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>
  7321. <format type="text/markdown"><![CDATA[
  7322. ## Remarks
  7323. 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.
  7324. ## Examples
  7325. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7326. [!code-csharp[SqlParameter_ParameterName Example#1](~/../sqlclient/doc/samples/SqlParameter_ParameterName.cs#1)]
  7327. ]]></format>
  7328. </remarks>
  7329. </member>
  7330. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Precision">
  7331. <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>
  7332. <format type="text/markdown"><![CDATA[
  7333. ## Remarks
  7334. The <xref:Microsoft.Data.SqlClient.SqlParameter.Precision%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
  7335. 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.
  7336. > [!NOTE]
  7337. > 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.
  7338. > [!NOTE]
  7339. > 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.
  7340. ## Examples
  7341. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7342. [!code-csharp[SqlParameter_Precision Example#1](~/../sqlclient/doc/samples/SqlParameter_Precision.cs#1)]
  7343. ]]></format>
  7344. </remarks>
  7345. </member>
  7346. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Scale">
  7347. <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>
  7348. <format type="text/markdown"><![CDATA[
  7349. ## Remarks
  7350. The <xref:Microsoft.Data.SqlClient.SqlParameter.Scale%2A> property is used by parameters that have a <xref:System.Data.SqlDbType> of `Decimal`.
  7351. > [!WARNING]
  7352. > 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).
  7353. 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.
  7354. > [!NOTE]
  7355. > 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.
  7356. > [!NOTE]
  7357. > .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.
  7358. ## Examples
  7359. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7360. [!code-csharp[SqlParameter#4](~/../sqlclient/doc/samples/SqlParameter.cs#4)]
  7361. ]]></format>
  7362. </remarks>
  7363. </member>
  7364. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Size">
  7365. <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>
  7366. <format type="text/markdown"><![CDATA[
  7367. ## Remarks
  7368. Return values are not affected by this property; return parameters from stored procedures are always fixed-size integers.
  7369. 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.
  7370. 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.
  7371. 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.
  7372. 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.
  7373. If not explicitly set, the size is inferred from the actual size of the specified parameter value.
  7374. If the fractional part of the parameter value is greater than the size, then the value will be truncated to match the size.
  7375. 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.
  7376. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  7377. ## Examples
  7378. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7379. [!code-csharp[SqlParameter#5](~/../sqlclient/doc/samples/SqlParameter.cs#5)]
  7380. ]]></format>
  7381. </remarks>
  7382. </member>
  7383. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn">
  7384. <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>
  7385. <format type="text/markdown"><![CDATA[
  7386. ## Remarks
  7387. 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.
  7388. For more information about how to use the <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumn%2A> property, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md) and [Updating Data Sources with DataAdapters](~/docs/framework/data/adonet/updating-data-sources-with-dataadapters.md).
  7389. ## Examples
  7390. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7391. [!code-csharp[SqlParameter#6](~/../sqlclient/doc/samples/SqlParameter.cs#6)]
  7392. ]]></format>
  7393. </remarks>
  7394. </member>
  7395. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping">
  7396. <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>
  7397. <see langword="true" /> if the source column is nullable; <see langword="false" /> if it is not.</value><remarks>
  7398. <format type="text/markdown"><![CDATA[
  7399. ## Remarks
  7400. <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>.
  7401. <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):
  7402. ```
  7403. ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR
  7404. (FieldName = @Original_FieldName))
  7405. ```
  7406. If <xref:Microsoft.Data.SqlClient.SqlParameter.SourceColumnNullMapping%2A> for the field is false, <xref:Microsoft.Data.SqlClient.SqlCommandBuilder> generates the following WHERE clause:
  7407. ```
  7408. FieldName = @OriginalFieldName
  7409. ```
  7410. 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.
  7411. ]]></format>
  7412. </remarks>
  7413. </member>
  7414. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SourceVersion">
  7415. <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>
  7416. <format type="text/markdown"><![CDATA[
  7417. ## Remarks
  7418. 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.
  7419. ## Examples
  7420. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7421. [!code-csharp[SqlParameter#7](~/../sqlclient/doc/samples/SqlParameter.cs#7)]
  7422. ]]></format>
  7423. </remarks>
  7424. </member>
  7425. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SqlDbType">
  7426. <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>
  7427. <format type="text/markdown"><![CDATA[
  7428. ## Remarks
  7429. 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>.
  7430. For a list of the supported data types, see the appropriate <xref:System.Data.SqlDbType> member. For more information, see [DataAdapter Parameters](~/docs/framework/data/adonet/dataadapter-parameters.md).
  7431. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  7432. ]]></format>
  7433. </remarks>
  7434. </member>
  7435. <member name="P:Microsoft.Data.SqlClient.SqlParameter.SqlValue">
  7436. <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>
  7437. <format type="text/markdown"><![CDATA[
  7438. ## Remarks
  7439. 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.
  7440. 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.
  7441. 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.
  7442. 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>.
  7443. The <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType> property is overwritten by `SqlDataAdapter.UpdateCommand`.
  7444. Use the <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A?displayProperty=nameWithType> property to return parameter values as common language runtime (CLR) types.
  7445. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  7446. ]]></format>
  7447. </remarks>
  7448. </member>
  7449. <member name="P:Microsoft.Data.SqlClient.SqlParameter.TypeName">
  7450. <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>
  7451. </member>
  7452. <member name="P:Microsoft.Data.SqlClient.SqlParameter.UdtTypeName">
  7453. <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>
  7454. <format type="text/markdown"><![CDATA[
  7455. ## Remarks
  7456. For a sample demonstrating <xref:Microsoft.Data.SqlClient.SqlParameter.UdtTypeName%2A>, see [Retrieving UDT Data](https://msdn.microsoft.com/library/ms131080.aspx).
  7457. ]]></format>
  7458. </remarks>
  7459. </member>
  7460. <member name="P:Microsoft.Data.SqlClient.SqlParameter.Value">
  7461. <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>
  7462. <format type="text/markdown"><![CDATA[
  7463. ## Remarks
  7464. 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.
  7465. 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.
  7466. An exception is thrown if non-Unicode XML data is passed as a string.
  7467. 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.
  7468. 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.
  7469. The <xref:Microsoft.Data.SqlClient.SqlParameter.Value%2A> property is overwritten by `SqlDataAdapter.UpdateCommand`.
  7470. For information about streaming, see [SqlClient Streaming Support](~/docs/framework/data/adonet/sqlclient-streaming-support.md).
  7471. ## Examples
  7472. The following example creates a <xref:Microsoft.Data.SqlClient.SqlParameter> and sets some of its properties.
  7473. [!code-csharp[SqlParameter#8](~/../sqlclient/doc/samples/SqlParameter.cs#8)]
  7474. ]]></format>
  7475. </remarks>
  7476. </member>
  7477. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionDatabase">
  7478. <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>
  7479. <format type="text/markdown"><![CDATA[
  7480. ## Remarks
  7481. 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.
  7482. ]]></format>
  7483. </remarks>
  7484. </member>
  7485. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionName">
  7486. <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>
  7487. <format type="text/markdown"><![CDATA[
  7488. ## Remarks
  7489. 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.
  7490. ]]></format>
  7491. </remarks>
  7492. </member>
  7493. <member name="P:Microsoft.Data.SqlClient.SqlParameter.XmlSchemaCollectionOwningSchema">
  7494. <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>
  7495. <format type="text/markdown"><![CDATA[
  7496. ## Remarks
  7497. 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.
  7498. ]]></format>
  7499. </remarks>
  7500. </member>
  7501. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ResetDbType">
  7502. <summary>Resets the type associated with this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  7503. <format type="text/markdown"><![CDATA[
  7504. ## Remarks
  7505. 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>.
  7506. ]]></format>
  7507. </remarks>
  7508. </member>
  7509. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ResetSqlDbType">
  7510. <summary>Resets the type associated with this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" />.</summary><remarks>
  7511. <format type="text/markdown"><![CDATA[
  7512. ## Remarks
  7513. 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>.
  7514. ]]></format>
  7515. </remarks>
  7516. </member>
  7517. <member name="M:Microsoft.Data.SqlClient.SqlParameter.ToString">
  7518. <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>
  7519. </member>
  7520. <member name="T:Microsoft.Data.SqlClient.SqlParameterCollection">
  7521. <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>
  7522. <format type="text/markdown"><![CDATA[
  7523. ## Remarks
  7524. 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.
  7525. For more information with additional sample code demonstrating how to use parameters, see [Commands and Parameters](~/docs/framework/data/adonet/commands-and-parameters.md).
  7526. ## Examples
  7527. 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.
  7528. [!code-csharp[SqlParameterCollection_Add6 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add6.cs#1)]
  7529. ]]></format>
  7530. </remarks>
  7531. </member>
  7532. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Count">
  7533. <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>
  7534. </member>
  7535. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsFixedSize">
  7536. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> has a fixed size.</summary><value>
  7537. <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>
  7538. </member>
  7539. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.IsReadOnly">
  7540. <summary>Gets a value that indicates whether the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> is read-only.</summary><value>
  7541. <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>
  7542. </member>
  7543. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Item(System.Int32)">
  7544. <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>
  7545. <format type="text/markdown"><![CDATA[
  7546. ## Examples
  7547. 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.
  7548. [!code-csharp[SqlParameterCollection_Count Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Count.cs#1)]
  7549. ]]></format>
  7550. </remarks><exception cref="T:System.IndexOutOfRangeException">The specified index does not exist.</exception>
  7551. </member>
  7552. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.Item(System.String)">
  7553. <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>
  7554. <format type="text/markdown"><![CDATA[
  7555. ## Remarks
  7556. 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.
  7557. ]]></format>
  7558. </remarks><exception cref="T:System.IndexOutOfRangeException">The specified <paramref name="parameterName" /> is not valid.</exception>
  7559. </member>
  7560. <member name="P:Microsoft.Data.SqlClient.SqlParameterCollection.SyncRoot">
  7561. <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>
  7562. </member>
  7563. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(Microsoft.Data.SqlClient.SqlParameter)">
  7564. <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>
  7565. <format type="text/markdown"><![CDATA[
  7566. ## Examples
  7567. [!code-csharp[SqlParameterCollection_Add Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add.cs#1)]
  7568. ]]></format>
  7569. </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>
  7570. </member>
  7571. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.Object)">
  7572. <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>
  7573. </member>
  7574. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType)">
  7575. <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>
  7576. <format type="text/markdown"><![CDATA[
  7577. ## Examples
  7578. [!code-csharp[SqlParameterCollection_Add3 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add3.cs#1)]
  7579. ]]></format>
  7580. </remarks>
  7581. </member>
  7582. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType,System.Int32)">
  7583. <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>
  7584. <format type="text/markdown"><![CDATA[
  7585. ## Remarks
  7586. This overload is useful when you are adding a parameter of a variable-length data type such as `varchar` or `binary`.
  7587. ## Examples
  7588. [!code-csharp[SqlParameterCollection_Add1 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add1.cs#1)]
  7589. ]]></format>
  7590. </remarks>
  7591. </member>
  7592. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Add(System.String,System.Data.SqlDbType,System.Int32,System.String)">
  7593. <param name="parameterName">The name of the parameter.</param><param name="sqlDbType">One of the <see cref="T:System.Data.SqlDbType" /> values.</param><param name="size">The column length.</param><param name="sourceColumn">The name of the source column (<see cref="P:Microsoft.Data.SqlClient.SqlParameter.SourceColumn" />) if this <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> is used in a call to <see cref="o:System.Data.Common.DbDataAdapter.Update" />.</param><summary>Adds a <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> to the <see cref="T:Microsoft.Data.SqlClient.SqlParameterCollection" /> with the parameter name, the data type, and the column length.</summary><returns>A new <see cref="T:Microsoft.Data.SqlClient.SqlParameter" /> object.</returns><remarks>
  7594. <format type="text/markdown"><![CDATA[
  7595. ## Examples
  7596. [!code-csharp[SqlParameterCollection_Add5 Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Add5.cs#1)]
  7597. ]]></format>
  7598. </remarks>
  7599. </member>
  7600. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddRange(Microsoft.Data.SqlClient.SqlParameter[])">
  7601. <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>
  7602. </member>
  7603. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddRange(System.Array)">
  7604. <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>
  7605. </member>
  7606. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.AddWithValue(System.String,System.Object)">
  7607. <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>
  7608. <format type="text/markdown"><![CDATA[
  7609. ## Remarks
  7610. <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.
  7611. 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.
  7612. ## Examples
  7613. The following example demonstrates how to use the `AddWithValue` method.
  7614. [!code-csharp[SqlParameterCollection_AddWithValue#1](~/../sqlclient/doc/samples/SqlParameterCollection_AddWithValue.cs#1)]
  7615. ]]></format>
  7616. </remarks>
  7617. </member>
  7618. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Clear">
  7619. <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>
  7620. </member>
  7621. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(Microsoft.Data.SqlClient.SqlParameter)">
  7622. <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>
  7623. <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>
  7624. </member>
  7625. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(System.Object)">
  7626. <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>
  7627. <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>
  7628. </member>
  7629. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Contains(System.String)">
  7630. <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>
  7631. <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>
  7632. </member>
  7633. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.CopyTo(System.Array,System.Int32)">
  7634. <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>
  7635. </member>
  7636. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.CopyTo(Microsoft.Data.SqlClient.SqlParameter[],System.Int32)">
  7637. <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>
  7638. </member>
  7639. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetEnumerator">
  7640. <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>
  7641. </member>
  7642. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetParameter(System.Int32)">
  7643. <param name="index">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  7644. </member>
  7645. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.GetParameter(System.String)">
  7646. <param name="parameterName">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  7647. </member>
  7648. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(Microsoft.Data.SqlClient.SqlParameter)">
  7649. <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>
  7650. </member>
  7651. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(System.Object)">
  7652. <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>
  7653. </member>
  7654. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.IndexOf(System.String)">
  7655. <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>
  7656. </member>
  7657. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Insert(System.Int32,Microsoft.Data.SqlClient.SqlParameter)">
  7658. <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>
  7659. </member>
  7660. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Insert(System.Int32,System.Object)">
  7661. <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>
  7662. </member>
  7663. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Remove(Microsoft.Data.SqlClient.SqlParameter)">
  7664. <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>
  7665. <format type="text/markdown"><![CDATA[
  7666. ## Examples
  7667. 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>.
  7668. [!code-csharp[SqlParameterCollection_Remove Example#1](~/../sqlclient/doc/samples/SqlParameterCollection_Remove.cs#1)]
  7669. ]]></format>
  7670. </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>
  7671. </member>
  7672. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.Remove(System.Object)">
  7673. <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>
  7674. </member>
  7675. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.RemoveAt(System.Int32)">
  7676. <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>
  7677. </member>
  7678. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.RemoveAt(System.String)">
  7679. <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>
  7680. </member>
  7681. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.SetParameter(System.Int32,System.Data.Common.DbParameter)">
  7682. <param name="index">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  7683. </member>
  7684. <member name="M:Microsoft.Data.SqlClient.SqlParameterCollection.SetParameter(System.String,System.Data.Common.DbParameter)">
  7685. <param name="parameterName">To be added.</param><param name="value">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks>
  7686. </member>
  7687. <member name="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs">
  7688. <summary>Represents the set of arguments passed to the <see cref="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventHandler" />.</summary><remarks>To be added.</remarks>
  7689. </member>
  7690. <member name="M:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.#ctor(System.Int64)">
  7691. <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>
  7692. <format type="text/markdown"><![CDATA[
  7693. ## Remarks
  7694. The value in the `rowsCopied` parameter is reset on each call to any one of the `SqlBulkCopy.WriteToServer` methods.
  7695. ]]></format>
  7696. </remarks>
  7697. </member>
  7698. <member name="P:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.Abort">
  7699. <summary>Gets or sets a value that indicates whether the bulk copy operation should be aborted.</summary><value>
  7700. <see langword="true" /> if the bulk copy operation should be aborted; otherwise <see langword="false" />.</value><remarks>
  7701. <format type="text/markdown"><![CDATA[
  7702. ## Remarks
  7703. 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.
  7704. 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.
  7705. 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.
  7706. ]]></format>
  7707. </remarks>
  7708. </member>
  7709. <member name="P:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.RowsCopied">
  7710. <summary>Gets a value that returns the number of rows copied during the current bulk copy operation.</summary><value>
  7711. <see langword="int" /> that returns the number of rows copied.</value><remarks>
  7712. <format type="text/markdown"><![CDATA[
  7713. ## Remarks
  7714. The value in the <xref:Microsoft.Data.SqlClient.SqlRowsCopiedEventArgs.RowsCopied%2A> property is reset on each call to any of the `SqlBulkCopy.WriteToServer` methods.
  7715. ]]></format>
  7716. </remarks>
  7717. </member>
  7718. <member name="T:Microsoft.Data.SqlClient.SqlRowsCopiedEventHandler">
  7719. <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>
  7720. </member>
  7721. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs">
  7722. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated" /> event.</summary><remarks>
  7723. <format type="text/markdown"><![CDATA[
  7724. ## Remarks
  7725. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event is raised when an <xref:System.Data.Common.DbDataAdapter.Update%2A> to a row is completed.
  7726. 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:
  7727. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  7728. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  7729. 3. The command executes.
  7730. 4. If the command is set to `FirstReturnedRecord`, and the first returned result is placed in the <xref:System.Data.DataRow>.
  7731. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  7732. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  7733. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  7734. ## Examples
  7735. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  7736. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  7737. Event Arguments: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 status=0)
  7738. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  7739. Event Arguments: (command=Microsoft.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  7740. [!code-csharp[SqlDataAdapter_RowUpdated Example#1](~/../sqlclient/doc/samples/SqlDataAdapter_RowUpdated.cs#1)]
  7741. ]]></format>
  7742. </remarks>
  7743. </member>
  7744. <member name="M:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs.#ctor(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  7745. <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>
  7746. </member>
  7747. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs.Command">
  7748. <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>
  7749. </member>
  7750. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatedEventHandler">
  7751. <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>
  7752. <format type="text/markdown"><![CDATA[
  7753. ## Remarks
  7754. 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.
  7755. When you create a <xref:Microsoft.Data.SqlClient.SqlRowUpdatedEventArgs> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
  7756. ]]></format>
  7757. </remarks>
  7758. </member>
  7759. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs">
  7760. <summary>Provides data for the <see cref="E:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating" /> event.</summary><remarks>
  7761. <format type="text/markdown"><![CDATA[
  7762. ## Remarks
  7763. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event is raised before an <xref:System.Data.Common.DbDataAdapter.Update%2A> to a row.
  7764. 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:
  7765. 1. The values in the <xref:System.Data.DataRow> are moved to the parameter values.
  7766. 2. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdating%2A> event is raised.
  7767. 3. The command executes.
  7768. 4. If the command is set to `FirstReturnedRecord`, and the first returned result is placed in the <xref:System.Data.DataRow>.
  7769. 5. If there are output parameters, they are placed in the <xref:System.Data.DataRow>.
  7770. 6. The <xref:System.Data.Common.DbDataAdapter.OnRowUpdated%2A> event is raised.
  7771. 7. <xref:System.Data.DataRow.AcceptChanges%2A> is called.
  7772. ## Examples
  7773. The following example shows how to use both the <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> and <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> events.
  7774. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdating> event returns this output:
  7775. event args: (command=Microsoft.Data.SqlClient.SQLCommand commandType=2 status=0)
  7776. The <xref:Microsoft.Data.SqlClient.SqlDataAdapter.RowUpdated> event returns this output:
  7777. event args: (command=Microsoft.Data.SqlClient.SQLCommand commandType=2 recordsAffected=1 row=System.Data.DataRow[37] status=0)
  7778. [!code-csharp[SqlRowUpdatingEventArgs Example#1](~/../sqlclient/doc/samples/SqlRowUpdatingEventArgs.cs#1)]
  7779. ]]></format>
  7780. </remarks>
  7781. </member>
  7782. <member name="M:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.#ctor(System.Data.DataRow,System.Data.IDbCommand,System.Data.StatementType,System.Data.Common.DataTableMapping)">
  7783. <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>
  7784. </member>
  7785. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.BaseCommand">
  7786. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  7787. </member>
  7788. <member name="P:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs.Command">
  7789. <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>
  7790. </member>
  7791. <member name="T:Microsoft.Data.SqlClient.SqlRowUpdatingEventHandler">
  7792. <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>
  7793. <format type="text/markdown"><![CDATA[
  7794. ## Remarks
  7795. 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.
  7796. 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.
  7797. When you create a <xref:Microsoft.Data.SqlClient.SqlRowUpdatingEventArgs> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see [Handling and Raising Events](~/docs/standard/events/index.md).
  7798. ]]></format>
  7799. </remarks>
  7800. </member>
  7801. <member name="T:Microsoft.Data.SqlClient.SqlTransaction">
  7802. <summary>Represents a Transact-SQL transaction to be made in a SQL Server database. This class cannot be inherited.</summary><remarks>
  7803. <format type="text/markdown"><![CDATA[
  7804. ## Remarks
  7805. 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.
  7806. > [!NOTE]
  7807. > `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.
  7808. 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).
  7809. ## Examples
  7810. 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.
  7811. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  7812. ]]></format>
  7813. </remarks>
  7814. </member>
  7815. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.Connection">
  7816. <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>
  7817. <format type="text/markdown"><![CDATA[
  7818. ## Remarks
  7819. 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>.
  7820. ]]></format>
  7821. </remarks>
  7822. </member>
  7823. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.DbConnection">
  7824. <summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks>
  7825. </member>
  7826. <member name="P:Microsoft.Data.SqlClient.SqlTransaction.IsolationLevel">
  7827. <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>
  7828. <format type="text/markdown"><![CDATA[
  7829. ## Remarks
  7830. Parallel transactions are not supported. Therefore, the <xref:System.Data.IsolationLevel> applies to the whole transaction.
  7831. For more information on SQL Server isolation levels, see [Transaction Isolation Levels](/sql/t-sql/language-elements/transaction-isolation-levels).
  7832. ]]></format>
  7833. </remarks>
  7834. </member>
  7835. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Commit">
  7836. <summary>Commits the database transaction.</summary><remarks>
  7837. <format type="text/markdown"><![CDATA[
  7838. ## Remarks
  7839. 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).
  7840. > [!NOTE]
  7841. > `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.
  7842. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  7843. ## Examples
  7844. 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.
  7845. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  7846. ]]></format>
  7847. </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.
  7848. -or-
  7849. The connection is broken.</exception>
  7850. </member>
  7851. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Dispose(System.Boolean)">
  7852. <param name="disposing"><see langword="true" /> to release managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param><summary>Releases the unmanaged resources used and optionally releases the managed resources.</summary><remarks>
  7853. <format type="text/markdown"><![CDATA[
  7854. ## Remarks
  7855. This method calls <xref:System.Data.Common.DbTransaction.Dispose%2A>.
  7856. ]]></format>
  7857. </remarks>
  7858. </member>
  7859. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Rollback">
  7860. <summary>Rolls back a transaction from a pending state.</summary>
  7861. </member>
  7862. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Rollback(System.String)">
  7863. <summary>Rolls back a transaction from a pending state.</summary><remarks>
  7864. <format type="text/markdown"><![CDATA[
  7865. ## Remarks
  7866. 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)
  7867. ](/sql/t-sql/language-elements/rollback-transaction-transact-sql).
  7868. 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.
  7869. > [!NOTE]
  7870. > `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.
  7871. For more information on SQL Server transactions, see [Transactions (Transact-SQL)](/sql/t-sql/language-elements/transactions-transact-sql).
  7872. ## Examples
  7873. 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.
  7874. [!code-csharp[SqlConnection_BeginTransaction Example#1](~/../sqlclient/doc/samples/SqlConnection_BeginTransaction.cs#1)]
  7875. ]]></format>
  7876. </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.
  7877. -or-
  7878. The connection is broken.</exception>
  7879. </member>
  7880. <member name="M:Microsoft.Data.SqlClient.SqlTransaction.Save(System.String)">
  7881. <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>
  7882. <format type="text/markdown"><![CDATA[
  7883. ## Remarks
  7884. <xref:Microsoft.Data.SqlClient.SqlTransaction.Save%2A> method is equivalent to the Transact-SQL SAVE TRANSACTION statement.
  7885. 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.
  7886. 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.
  7887. ]]></format>
  7888. </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.
  7889. -or-
  7890. The connection is broken.</exception>
  7891. </member>
  7892. <member name="T:Microsoft.Data.SqlClient.Server.DataAccessKind">
  7893. <summary>Describes the type of access to user data for a user-defined method or function.</summary><remarks>
  7894. <format type="text/markdown"><![CDATA[
  7895. ## Remarks
  7896. Describes the type of access to user data for a user-defined method or function.
  7897. This enumeration is used in <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> and <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute> to indicate whether the method or function uses ADO.NET to connect back to the database using the "context connection."
  7898. Note that methods and functions are not allowed to make changes to the database, so the options for this enumeration are `None` (meaning no data-access performed by the method or function) and `Read` (meaning that the method or function perform read-only data-access operations, such as executing SELECT statements).
  7899. ]]></format>
  7900. </remarks>
  7901. </member>
  7902. <member name="F:Microsoft.Data.SqlClient.Server.DataAccessKind.None">
  7903. <summary>The method or function does not access user data.</summary>
  7904. </member>
  7905. <member name="F:Microsoft.Data.SqlClient.Server.DataAccessKind.Read">
  7906. <summary>The method or function reads user data.</summary>
  7907. </member>
  7908. <member name="T:Microsoft.Data.SqlClient.Server.Format">
  7909. <summary>Used by <see cref="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute" /> and <see cref="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute" /> to indicate the serialization format of a user-defined type (UDT) or aggregate.</summary><remarks>
  7910. <format type="text/markdown"><![CDATA[
  7911. ## Remarks
  7912. This enumeration is used by <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute> and <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute> to indicate the serialization format of a user-defined type (UDT) or aggregate. Use of the `Native` and `UserDefined` enumeration members has special requirements.
  7913. - `Format.Native`
  7914. The requirements for the `Format.Native` format are:
  7915. - The <xref:System.Runtime.InteropServices.StructLayoutAttribute> with a <xref:System.Runtime.InteropServices.StructLayoutAttribute.Value> property value of <xref:System.Runtime.InteropServices.LayoutKind.Sequential?displayProperty=nameWithType> must be applied to the aggregate or UDT if it is defined in a class and not a structure. This controls the physical layout of the data fields and is used to force the members to be laid out sequentially in the order they appear. SQL Server uses this attribute to determine the field order for UDTs with multiple fields.
  7916. - The type must contain at least one member (serialized values cannot be zero bytes in size).
  7917. - All the fields of the aggregate must be *blittable*; that is, they must have a common representation in both managed and unmanaged memory and not require special handling by the interop marshaler.
  7918. - All the fields of the UDT should be of one of the following types that can be serialized: `bool`, `byte`, `sbyte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `float`, `double`, <xref:System.Data.SqlTypes.SqlByte>, <xref:System.Data.SqlTypes.SqlInt16>, <xref:System.Data.SqlTypes.SqlInt32>, <xref:System.Data.SqlTypes.SqlInt64>, <xref:System.Data.SqlTypes.SqlDateTime>, <xref:System.Data.SqlTypes.SqlSingle>, <xref:System.Data.SqlTypes.SqlDouble>, <xref:System.Data.SqlTypes.SqlMoney>, or other value types defined by the user that contain fields of one of these types.
  7919. - The aggregate must not specify a value for `MaxByteSize`.
  7920. - The aggregate must not have any [NonSerialized] fields.
  7921. - Fields must not be marked as an explicit layout (with a <xref:System.Runtime.InteropServices.StructLayoutAttribute.Value?displayProperty=nameWithType> of <xref:System.Runtime.InteropServices.LayoutKind.Explicit?displayProperty=nameWithType>).
  7922. - `Format.UserDefined`
  7923. The requirements for the `Format.UserDefined` format are:
  7924. - The aggregate must specify a value for `MaxByteSize`.
  7925. - Specify the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A?displayProperty=nameWithType> attribute property. The default value is `false`.
  7926. - If you omit any field in the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A?displayProperty=nameWithType> or <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write%2A?displayProperty=nameWithType> methods, the state of that field is not serialized.
  7927. ## Examples
  7928. The following example shows the `UserDefinedType` attribute of the Point UDT. The UDT is byte-ordered, is named "Point", has a validation method named "ValidatePoint", and uses the native serialization format.
  7929. [!code-csharp[SqlUserDefinedType Example#1](~/../sqlclient/doc/samples/SqlUserDefinedType.cs#1)]
  7930. ]]></format>
  7931. </remarks>
  7932. </member>
  7933. <member name="F:Microsoft.Data.SqlClient.Server.Format.Unknown">
  7934. <summary>The serialization format is unknown.</summary>
  7935. </member>
  7936. <member name="F:Microsoft.Data.SqlClient.Server.Format.Native">
  7937. <summary>This serialization format uses a very simple algorithm that enables SQL Server to store an efficient representation of the UDT on disk. Types marked for <see langword="Native" /> serialization can only have value types (structs in Microsoft Visual C# and structures in Microsoft Visual Basic .NET) as members. Members of reference types (such as classes in Visual C# and Visual Basic), either user-defined or those existing in .NET class libraries (such as <see cref="T:System.String" />), are not supported.</summary>
  7938. </member>
  7939. <member name="F:Microsoft.Data.SqlClient.Server.Format.UserDefined">
  7940. <summary>This serialization format gives the developer full control over the binary format through the <see cref="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write(System.IO.BinaryWriter)" /> and <see cref="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read(System.IO.BinaryReader)" /> methods.</summary>
  7941. </member>
  7942. <member name="T:Microsoft.Data.SqlClient.Server.IBinarySerialize">
  7943. <summary>Provides custom implementation for user-defined type (UDT) and user-defined aggregate serialization and deserialization.</summary><remarks>
  7944. <format type="text/markdown"><![CDATA[
  7945. ## Remarks
  7946. User-defined types (UDTs) and user-defined aggregates are required to define a storage format, which can be either <xref:Microsoft.Data.SqlClient.Server.Format>.`Native` or <xref:Microsoft.Data.SqlClient.Server.Format>.`UserDefined`.
  7947. <xref:Microsoft.Data.SqlClient.Server.Format>.`Native` allows SQL Server to handle serialization and deserialization automatically, but the format has restrictions on the kind of types it can handle. <xref:Microsoft.Data.SqlClient.Server.Format>.`UserDefined` allows user-defined types and aggregates to handle their own serialization. User-defined types and aggregates must be marked with <xref:Microsoft.Data.SqlClient.Server.Format>.`UserDefined` in the `SqlUserDefinedType` or `SqlUserDefinedAggregate` attribute, and must implement the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize> interface.
  7948. Note that even with custom serialization, the total size of each instance must be under the maximum allowed limit, currently 8000 bytes.
  7949. ]]></format>
  7950. </remarks>
  7951. </member>
  7952. <member name="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read(System.IO.BinaryReader)">
  7953. <param name="r">The <see cref="T:System.IO.BinaryReader" /> stream from which the object is deserialized.</param><summary>Generates a user-defined type (UDT) or user-defined aggregate from its binary form.</summary><remarks>
  7954. <format type="text/markdown"><![CDATA[
  7955. ## Remarks
  7956. The <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A> method must reconstitute your object using the information written by the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write%2A> method.
  7957. ## Examples
  7958. The following example shows the implementation of the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A> method of a UDT, which uses a <xref:System.IO.BinaryReader> to de-serialize a previously persisted UDT. This example assumes that the UDT has two data properties: `StringValue` and `DoubleValue`.
  7959. [!code-csharp[IBinarySerialize Samples#1](~/../sqlclient/doc/samples/IBinarySerialize.cs#1)]
  7960. ]]></format>
  7961. </remarks>
  7962. </member>
  7963. <member name="M:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write(System.IO.BinaryWriter)">
  7964. <param name="w">The <see cref="T:System.IO.BinaryWriter" /> stream to which the UDT or user-defined aggregate is serialized.</param><summary>Converts a user-defined type (UDT) or user-defined aggregate into its binary format so that it may be persisted.</summary><remarks>
  7965. <format type="text/markdown"><![CDATA[
  7966. ## Remarks
  7967. Write sufficient information to the binary stream to allow the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Read%2A> method to reconstitute your UDT or user-defined aggregate.
  7968. ## Examples
  7969. The following example shows the implementation of the <xref:Microsoft.Data.SqlClient.Server.IBinarySerialize.Write%2A> method of a UDT, which uses a <xref:System.IO.BinaryWriter> to serialize the UDT in the user-defined binary format. The purpose of the null character padding is to ensure that the string value is completely separated from the double value, so that one UDT is compared to another in Transact-SQL code, string bytes are compared to string bytes and double bytes are compared to double bytes.
  7970. [!code-csharp[IBinarySerialize Samples#2](~/../sqlclient/doc/samples/IBinarySerialize.cs#2)]
  7971. ]]></format>
  7972. </remarks>
  7973. </member>
  7974. <member name="T:Microsoft.Data.SqlClient.Server.InvalidUdtException">
  7975. <summary>Thrown when SQL Server or the ADO.NET <see cref="N:Microsoft.Data.SqlClient" /> provider detects an invalid user-defined type (UDT).</summary><remarks>To be added.</remarks>
  7976. </member>
  7977. <member name="T:Microsoft.Data.SqlClient.Server.SqlDataRecord">
  7978. <summary>Represents a single row of data and its metadata. This class cannot be inherited.</summary><remarks>
  7979. <format type="text/markdown"><![CDATA[
  7980. ## Remarks
  7981. This class is used together with <xref:Microsoft.SqlServer.Server.SqlPipe> to send result sets to the client from managed code stored-procedures.
  7982. 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.
  7983. ## Examples
  7984. 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.
  7985. [!code-csharp[SqlDataRecord Samples#1](~/../sqlclient/doc/samples/SqlDataRecord.cs#1)]
  7986. ]]></format>
  7987. </remarks>
  7988. </member>
  7989. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.#ctor(Microsoft.Data.SqlClient.Server.SqlMetaData[])">
  7990. <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>
  7991. <format type="text/markdown"><![CDATA[
  7992. ## Examples
  7993. 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.
  7994. [!code-csharp[SqlDataRecord Samples#2](~/../sqlclient/doc/samples/SqlDataRecord.cs#2)]
  7995. ]]></format>
  7996. </remarks><exception cref="T:System.ArgumentNullException">The <paramref name="metaData" /> is <see langword="null" />.</exception>
  7997. </member>
  7998. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.FieldCount">
  7999. <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>
  8000. </member>
  8001. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.Item(System.Int32)">
  8002. <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>
  8003. <format type="text/markdown"><![CDATA[
  8004. ## Remarks
  8005. For columns with null value, <xref:System.DBNull.Value> is returned.
  8006. ]]></format>
  8007. </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>
  8008. </member>
  8009. <member name="P:Microsoft.Data.SqlClient.Server.SqlDataRecord.Item(System.String)">
  8010. <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>
  8011. <format type="text/markdown"><![CDATA[
  8012. ## Remarks
  8013. For columns with null value, <xref:System.DBNull.Value> is returned.
  8014. ]]></format>
  8015. </remarks>
  8016. </member>
  8017. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBoolean(System.Int32)">
  8018. <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>
  8019. </member>
  8020. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetByte(System.Int32)">
  8021. <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>
  8022. </member>
  8023. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  8024. <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>
  8025. <format type="text/markdown"><![CDATA[
  8026. ## Remarks
  8027. 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.
  8028. 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.
  8029. ]]></format>
  8030. </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>
  8031. </member>
  8032. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChar(System.Int32)">
  8033. <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>
  8034. </member>
  8035. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  8036. <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>
  8037. <format type="text/markdown"><![CDATA[
  8038. ## Remarks
  8039. 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.
  8040. 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.
  8041. ]]></format>
  8042. </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>
  8043. </member>
  8044. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.System#Data#IDataRecord#GetData(System.Int32)">
  8045. <param name="ordinal">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks>
  8046. </member>
  8047. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDataTypeName(System.Int32)">
  8048. <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>
  8049. <format type="text/markdown"><![CDATA[
  8050. ## Remarks
  8051. 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.
  8052. ]]></format>
  8053. </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>
  8054. </member>
  8055. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDateTime(System.Int32)">
  8056. <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>
  8057. </member>
  8058. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDateTimeOffset(System.Int32)">
  8059. <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>
  8060. </member>
  8061. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDecimal(System.Int32)">
  8062. <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>
  8063. </member>
  8064. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetDouble(System.Int32)">
  8065. <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>
  8066. </member>
  8067. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetFieldType(System.Int32)">
  8068. <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>
  8069. </member>
  8070. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetFloat(System.Int32)">
  8071. <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>
  8072. </member>
  8073. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetGuid(System.Int32)">
  8074. <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>
  8075. </member>
  8076. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt16(System.Int32)">
  8077. <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>
  8078. </member>
  8079. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt32(System.Int32)">
  8080. <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>
  8081. </member>
  8082. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetInt64(System.Int32)">
  8083. <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>
  8084. </member>
  8085. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetName(System.Int32)">
  8086. <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>
  8087. </member>
  8088. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetOrdinal(System.String)">
  8089. <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">
  8090. <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>
  8091. </member>
  8092. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBinary(System.Int32)">
  8093. <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>
  8094. </member>
  8095. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBoolean(System.Int32)">
  8096. <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>
  8097. </member>
  8098. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlByte(System.Int32)">
  8099. <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>
  8100. </member>
  8101. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlBytes(System.Int32)">
  8102. <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>
  8103. </member>
  8104. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlChars(System.Int32)">
  8105. <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>
  8106. </member>
  8107. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDateTime(System.Int32)">
  8108. <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>
  8109. </member>
  8110. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDecimal(System.Int32)">
  8111. <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>
  8112. </member>
  8113. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlDouble(System.Int32)">
  8114. <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>
  8115. </member>
  8116. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlFieldType(System.Int32)">
  8117. <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>
  8118. </member>
  8119. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlGuid(System.Int32)">
  8120. <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>
  8121. </member>
  8122. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt16(System.Int32)">
  8123. <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>
  8124. </member>
  8125. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt32(System.Int32)">
  8126. <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>
  8127. </member>
  8128. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlInt64(System.Int32)">
  8129. <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>
  8130. </member>
  8131. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlMetaData(System.Int32)">
  8132. <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>
  8133. </member>
  8134. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlMoney(System.Int32)">
  8135. <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>
  8136. </member>
  8137. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlSingle(System.Int32)">
  8138. <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>
  8139. </member>
  8140. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlString(System.Int32)">
  8141. <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>
  8142. </member>
  8143. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlValue(System.Int32)">
  8144. <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>
  8145. <format type="text/markdown"><![CDATA[
  8146. ## Remarks
  8147. For null values, a SQL Server type instance is returned where the <xref:System.Data.SqlTypes.INullable.IsNull%2A> property is true.
  8148. ]]></format>
  8149. </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" />
  8150. </member>
  8151. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlValues(System.Object[])">
  8152. <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>
  8153. <format type="text/markdown"><![CDATA[
  8154. ## Remarks
  8155. 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.
  8156. 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.
  8157. ]]></format>
  8158. </remarks><exception cref="T:System.ArgumentNullException">
  8159. <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" />
  8160. </member>
  8161. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetSqlXml(System.Int32)">
  8162. <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>
  8163. </member>
  8164. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetString(System.Int32)">
  8165. <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>
  8166. </member>
  8167. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetTimeSpan(System.Int32)">
  8168. <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>
  8169. </member>
  8170. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetValue(System.Int32)">
  8171. <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>
  8172. <format type="text/markdown"><![CDATA[
  8173. ## Remarks
  8174. For columns with null value, <xref:System.DBNull.Value> is returned.
  8175. ]]></format>
  8176. </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>
  8177. </member>
  8178. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.GetValues(System.Object[])">
  8179. <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>
  8180. <format type="text/markdown"><![CDATA[
  8181. ## Remarks
  8182. 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.
  8183. 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.
  8184. ]]></format>
  8185. </remarks><exception cref="T:System.ArgumentNullException">
  8186. <paramref name="values" /> is <see langword="null" />.</exception><exception cref="T:System.InvalidCastException">There is a type mismatch.</exception>
  8187. </member>
  8188. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.IsDBNull(System.Int32)">
  8189. <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>
  8190. <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>
  8191. </member>
  8192. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetBoolean(System.Int32,System.Boolean)">
  8193. <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>
  8194. </member>
  8195. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetByte(System.Int32,System.Byte)">
  8196. <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>
  8197. </member>
  8198. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetBytes(System.Int32,System.Int64,System.Byte[],System.Int32,System.Int32)">
  8199. <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>
  8200. </member>
  8201. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetChar(System.Int32,System.Char)">
  8202. <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>
  8203. </member>
  8204. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetChars(System.Int32,System.Int64,System.Char[],System.Int32,System.Int32)">
  8205. <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>
  8206. </member>
  8207. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDateTime(System.Int32,System.DateTime)">
  8208. <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>
  8209. </member>
  8210. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDateTimeOffset(System.Int32,System.DateTimeOffset)">
  8211. <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>
  8212. </member>
  8213. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDBNull(System.Int32)">
  8214. <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>
  8215. </member>
  8216. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDecimal(System.Int32,System.Decimal)">
  8217. <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>
  8218. </member>
  8219. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetDouble(System.Int32,System.Double)">
  8220. <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>
  8221. </member>
  8222. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetFloat(System.Int32,System.Single)">
  8223. <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>
  8224. </member>
  8225. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetGuid(System.Int32,System.Guid)">
  8226. <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>
  8227. </member>
  8228. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt16(System.Int32,System.Int16)">
  8229. <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>
  8230. </member>
  8231. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt32(System.Int32,System.Int32)">
  8232. <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>
  8233. </member>
  8234. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetInt64(System.Int32,System.Int64)">
  8235. <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>
  8236. </member>
  8237. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBinary(System.Int32,System.Data.SqlTypes.SqlBinary)">
  8238. <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>
  8239. </member>
  8240. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBoolean(System.Int32,System.Data.SqlTypes.SqlBoolean)">
  8241. <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>
  8242. </member>
  8243. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlByte(System.Int32,System.Data.SqlTypes.SqlByte)">
  8244. <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>
  8245. </member>
  8246. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlBytes(System.Int32,System.Data.SqlTypes.SqlBytes)">
  8247. <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>
  8248. </member>
  8249. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlChars(System.Int32,System.Data.SqlTypes.SqlChars)">
  8250. <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>
  8251. </member>
  8252. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDateTime(System.Int32,System.Data.SqlTypes.SqlDateTime)">
  8253. <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>
  8254. </member>
  8255. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDecimal(System.Int32,System.Data.SqlTypes.SqlDecimal)">
  8256. <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>
  8257. </member>
  8258. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlDouble(System.Int32,System.Data.SqlTypes.SqlDouble)">
  8259. <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>
  8260. </member>
  8261. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlGuid(System.Int32,System.Data.SqlTypes.SqlGuid)">
  8262. <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>
  8263. </member>
  8264. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt16(System.Int32,System.Data.SqlTypes.SqlInt16)">
  8265. <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>
  8266. </member>
  8267. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt32(System.Int32,System.Data.SqlTypes.SqlInt32)">
  8268. <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>
  8269. </member>
  8270. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlInt64(System.Int32,System.Data.SqlTypes.SqlInt64)">
  8271. <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>
  8272. </member>
  8273. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlMoney(System.Int32,System.Data.SqlTypes.SqlMoney)">
  8274. <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>
  8275. </member>
  8276. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlSingle(System.Int32,System.Data.SqlTypes.SqlSingle)">
  8277. <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>
  8278. </member>
  8279. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlString(System.Int32,System.Data.SqlTypes.SqlString)">
  8280. <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>
  8281. </member>
  8282. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetSqlXml(System.Int32,System.Data.SqlTypes.SqlXml)">
  8283. <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>
  8284. </member>
  8285. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetString(System.Int32,System.String)">
  8286. <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>
  8287. </member>
  8288. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetTimeSpan(System.Int32,System.TimeSpan)">
  8289. <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>
  8290. </member>
  8291. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetValue(System.Int32,System.Object)">
  8292. <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>
  8293. <format type="text/markdown"><![CDATA[
  8294. ## Remarks
  8295. `value` is a SQL type boxed as a <xref:System.Object> instance.
  8296. ]]></format>
  8297. </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>
  8298. </member>
  8299. <member name="M:Microsoft.Data.SqlClient.Server.SqlDataRecord.SetValues(System.Object[])">
  8300. <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>
  8301. <format type="text/markdown"><![CDATA[
  8302. ## Remarks
  8303. The length of values must match the number of columns in the <xref:Microsoft.Data.SqlClient.Server.SqlDataRecord> instance.
  8304. ]]></format>
  8305. </remarks><exception cref="T:System.ArgumentNullException">
  8306. <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>
  8307. </member>
  8308. <member name="T:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute">
  8309. <summary>Used to mark a method definition of a user-defined aggregate as a function in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server.</summary><remarks>
  8310. <format type="text/markdown"><![CDATA[
  8311. ## Examples
  8312. The following example shows an aggregate function that returns a list of files in the specified directory path.
  8313. [!code-csharp[SqlFunctionAttribute Sample#1](~/../sqlclient/doc/samples/SqlFunctionAttribute.cs#1)]
  8314. ]]></format>
  8315. </remarks>
  8316. </member>
  8317. <member name="M:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.#ctor">
  8318. <summary>An optional attribute on a user-defined aggregate, used to indicate that the method should be registered in SQL Server as a function. Also used to set the <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.FillRowMethodName" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsPrecise" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.Name" />, <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.SystemDataAccess" />, and <see cref="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.TableDefinition" /> properties of the function attribute.</summary><remarks>To be added.</remarks>
  8319. </member>
  8320. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic">
  8321. <summary>Indicates whether the user-defined function is deterministic.</summary><value>
  8322. <see langword="true" /> if the function is deterministic; otherwise <see langword="false" />.</value><remarks>
  8323. <format type="text/markdown"><![CDATA[
  8324. ## Remarks
  8325. A user-defined function is said to be deterministic if it always produces the same output values given the same input values and the same database state.
  8326. The <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic%2A> property is also useful for indexing the result of the function in the form of indexed computed columns and indexed views. If this property is not specified, the function is assumed to be non-deterministic.
  8327. Functions that access local data can be deterministic. The data access characteristic is captured separately by the <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess%2A> and <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.SystemDataAccess%2A> properties.
  8328. Note that data access to remote servers (for example, using a <xref:Microsoft.Data.SqlClient.SqlConnection> to connect to another SQL Server instance) is available in user-defined functions. However, you must still honor the <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsDeterministic%2A> declaration. If the common language runtime (CLR) function is marked as deterministic, it should not cause side-effects in the remote server. While side-effects against the context connection are restricted, SQL Server will not enforce the restriction for side-effects over remote connections.
  8329. The default value of this attribute is `false`.
  8330. Do not mark a function as deterministic if the function does not always produce the same output values, given the same input values and the same database state. Marking a function as deterministic when the function is not truly deterministic can result in corrupted indexed views and computed columns.
  8331. ]]></format>
  8332. </remarks>
  8333. </member>
  8334. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess">
  8335. <summary>Indicates whether the function involves access to user data stored in the local instance of SQL Server.</summary><value>
  8336. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="None" />: Does not access data. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="Read" />: Only reads user data.</value><remarks>
  8337. <format type="text/markdown"><![CDATA[
  8338. ## Remarks
  8339. The default is <xref:Microsoft.Data.SqlClient.Server.DataAccessKind.None>.<xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.DataAccess%2A> is also required when connecting to remote servers if transactions integration is required (the default).
  8340. If a Transact-SQL query is executed from inside a table-valued function (TVF), the <xref:Microsoft.Data.SqlClient.Server.DataAccessKind.Read> property should be set.
  8341. ]]></format>
  8342. </remarks>
  8343. </member>
  8344. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.SystemDataAccess">
  8345. <summary>Indicates whether the function requires access to data stored in the system catalogs or virtual system tables of SQL Server.</summary><value>
  8346. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="None" />: Does not access system data. <see cref="T:Microsoft.Data.SqlClient.Server.DataAccessKind" />.<see langword="Read" />: Only reads system data.</value><remarks>
  8347. <format type="text/markdown"><![CDATA[
  8348. ## Remarks
  8349. The default is <xref:Microsoft.Data.SqlClient.Server.SystemDataAccessKind.None>.
  8350. ]]></format>
  8351. </remarks>
  8352. </member>
  8353. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.IsPrecise">
  8354. <summary>Indicates whether the function involves imprecise computations, such as floating point operations.</summary><value>
  8355. <see langword="true" /> if the function involves precise computations; otherwise <see langword="false" />.</value><remarks>
  8356. <format type="text/markdown"><![CDATA[
  8357. ## Remarks
  8358. Precision of a function is one of the properties used to determine if computed columns that use this function can be indexed.
  8359. The default value of this attribute is `false`.
  8360. ]]></format>
  8361. </remarks>
  8362. </member>
  8363. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.Name">
  8364. <summary>The name under which the function should be registered in SQL Server.</summary><value>A <see cref="T:System.String" /> value representing the name under which the function should be registered.</value><remarks>
  8365. <format type="text/markdown"><![CDATA[
  8366. ## Remarks
  8367. This attribute is used only by Microsoft Visual Studio to automatically register the specified method as a user-defined function. It is not used by SQL Server.
  8368. Thee following example specifies that the user-defined function is referenced using the name `sp_scalarFunc`.
  8369. ## Examples
  8370. [!code-csharp[SqlFunction#10](~/../sqlclient/doc/samples/SqlFunction.cs#10)]
  8371. ]]></format>
  8372. </remarks>
  8373. </member>
  8374. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.TableDefinition">
  8375. <summary>A string that represents the table definition of the results, if the method is used as a table-valued function (TVF).</summary><value>A <see cref="T:System.String" /> value representing the table definition of the results.</value><remarks>
  8376. <format type="text/markdown"><![CDATA[
  8377. ## Remarks
  8378. This attribute is used only by Microsoft Visual Studio to automatically register the specified method as a TVF. It is not used by SQL Server.
  8379. The following example specifies that the user-defined function is referenced using the name `sp_tableFunc`. The `TableDefinition` property has the value `letter nchar(1)`.
  8380. ## Examples
  8381. [!code-csharp[SqlFunction#11](~/../sqlclient/doc/samples/SqlFunction.cs#11)]
  8382. ]]></format>
  8383. </remarks>
  8384. </member>
  8385. <member name="P:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute.FillRowMethodName">
  8386. <summary>The name of a method in the same class which is used to fill a row of data in the table returned by the table-valued function.</summary><value>A <see cref="T:System.String" /> value representing the name of a method in the same class which is used to fill a row of data in the table returned by the table-valued function.</value>
  8387. </member>
  8388. <member name="T:Microsoft.Data.SqlClient.Server.SqlMetaData">
  8389. <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>
  8390. <format type="text/markdown"><![CDATA[
  8391. ## Examples
  8392. 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.
  8393. [!code-csharp[SqlMetaData Samples#1](~/../sqlclient/doc/samples/SqlMetaData.cs#1)]
  8394. ]]></format>
  8395. </remarks>
  8396. </member>
  8397. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType)">
  8398. <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>
  8399. <format type="text/markdown"><![CDATA[
  8400. ## Remarks
  8401. 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`.
  8402. 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`):
  8403. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  8404. |---------------|--------------------|---------------|-----------|------------|---------------------|
  8405. |`Bit`|1|1|0|0|None|
  8406. |`BigInt`|8|19|0|0|None|
  8407. |`DateTime`|8|23|3|0|None|
  8408. |`Decimal`|9|18|0|0|None|
  8409. |`Float`|8|53|0|0|None|
  8410. |`Int`|4|10|0|0|None|
  8411. |`Money`|8|19|4|0|None|
  8412. |`Numeric`|9|18|0|0|None|
  8413. |`SmallDateTime`|4|16|0|0|None|
  8414. |`SmallInt`|2|5|0|0|None|
  8415. |`SmallMoney`|4|10|4|0|None|
  8416. |`TimeStamp`|8|0|0|0|None|
  8417. |`TinyInt`|1|3|0|0|None|
  8418. |`UniqueIdentifier`|16|0|0|0|None|
  8419. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8420. ## Examples
  8421. 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`.
  8422. [!code-csharp[SqlMetaData Samples#3](~/../sqlclient/doc/samples/SqlMetaData.cs#3)]
  8423. ]]></format>
  8424. </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>
  8425. </member>
  8426. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Boolean,System.Boolean,Microsoft.Data.SqlClient.SortOrder,System.Int32)">
  8427. <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>
  8428. <format type="text/markdown"><![CDATA[
  8429. ## Remarks
  8430. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8431. ]]></format>
  8432. </remarks>
  8433. </member>
  8434. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Byte,System.Byte)">
  8435. <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>
  8436. <format type="text/markdown"><![CDATA[
  8437. ## Remarks
  8438. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `Decimal`.
  8439. 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`):
  8440. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  8441. |---------------|--------------------|---------------|-----------|------------|---------------------|
  8442. |Decimal|9|18|0|0|None|
  8443. ]]></format>
  8444. </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>
  8445. </member>
  8446. <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)">
  8447. <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>
  8448. <format type="text/markdown"><![CDATA[
  8449. ## Remarks
  8450. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8451. ]]></format>
  8452. </remarks>
  8453. </member>
  8454. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64)">
  8455. <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>
  8456. <format type="text/markdown"><![CDATA[
  8457. ## Remarks
  8458. Only the following are allowed to be passed to the constructor as `dbType`: `Binary`, `Char`, `Image`, `NChar`, `Ntext`, `NVarChar`, `Text`, `VarBinary`, `VarChar`.
  8459. 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`.
  8460. 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.
  8461. 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`):
  8462. |SqlDbType|Precision|Scale|Locale|Compare options|
  8463. |---------------|---------------|-----------|------------|---------------------|
  8464. |Binary|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8465. |Char|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8466. |Image|0|0|0|None|
  8467. |NChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8468. |NText|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8469. |NVarChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8470. |Text|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8471. |VarBinary|0|0||IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8472. |VarChar|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8473. ## Examples
  8474. 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.
  8475. [!code-csharp[SqlMetaData Samples#2](~/../sqlclient/doc/samples/SqlMetaData.cs#2)]
  8476. ]]></format>
  8477. </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>
  8478. </member>
  8479. <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)">
  8480. <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>
  8481. <format type="text/markdown"><![CDATA[
  8482. ## Remarks
  8483. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8484. ]]></format>
  8485. </remarks>
  8486. </member>
  8487. <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)">
  8488. <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>
  8489. <format type="text/markdown"><![CDATA[
  8490. ## Remarks
  8491. 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`.
  8492. 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`):
  8493. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  8494. |---------------|--------------------|---------------|-----------|------------|---------------------|
  8495. |`BigInt`|8|19|0|0|None|
  8496. |`Bit`|1|1|0|0|None|
  8497. |`DateTime`|8|23|3|0|None|
  8498. |`Decimal`|9|18|0|0|None|
  8499. |`Float`|8|53|0|0|None|
  8500. |`Image`|Max (-1)|0|0|0|None|
  8501. |`Int`|4|10|0|0|None|
  8502. |`Money`|8|19|4|0|None|
  8503. |`Ntext`|Max (-1)|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8504. |`Real`|4|24|0|0|None|
  8505. |`Row`|\<number of columns>|0|0|0|None|
  8506. |`SmallDateTime`|4|16|0|0|None|
  8507. |`SmallInt`|2|5|0|0|None|
  8508. |`SmallMoney`|4|10|4|0|None|
  8509. |`Text`|Max (-1)|0|0|\<thread>|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8510. |`TimeStamp`|8|0|0|0|None|
  8511. |`TinyInt`|1|3|0|0|None|
  8512. |`UniqueIdentifier`|16|0|0|0|None|
  8513. |`UDT`|\<Max length of the type> or -1|0|0|0|None|
  8514. |`Variant`|8016|0|0|0|None|
  8515. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8516. ]]></format>
  8517. </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>
  8518. </member>
  8519. <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)">
  8520. <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>
  8521. <format type="text/markdown"><![CDATA[
  8522. ## Remarks
  8523. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8524. ]]></format>
  8525. </remarks>
  8526. </member>
  8527. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Int64,System.Int64,System.Data.SqlTypes.SqlCompareOptions)">
  8528. <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>
  8529. <format type="text/markdown"><![CDATA[
  8530. ## Remarks
  8531. Only the following are allowed to be passed to the constructor as `dbType`: `Char`, `NChar`, `Ntext`, `NVarChar`, `Text`, `VarChar`.
  8532. Only a `maxLength` specification of <xref:Microsoft.Data.SqlClient.Server.SqlMetaData.Max%2A>, or -1, is allowed for a `dbType` of `Text` or `NText`.
  8533. 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.
  8534. 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`):
  8535. |SqlDbType|Precision|Scale|
  8536. |---------------|---------------|-----------|
  8537. |`Char`|0|0|
  8538. |`NChar`|0|0|
  8539. |`NText`|0|0|
  8540. |`NVarChar`|0|0|
  8541. |`Text`|0|0|
  8542. |`VarChar`|0|0|
  8543. ]]></format>
  8544. </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>
  8545. </member>
  8546. <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)">
  8547. <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>
  8548. <format type="text/markdown"><![CDATA[
  8549. ## Remarks
  8550. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8551. ]]></format>
  8552. </remarks>
  8553. </member>
  8554. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.String,System.String,System.String)">
  8555. <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>
  8556. <format type="text/markdown"><![CDATA[
  8557. ## Remarks
  8558. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `Xml`.
  8559. The following are the default values assigned to `dbType`, depending on the `SqlDbType`:
  8560. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  8561. |---------------|--------------------|---------------|-----------|------------|---------------------|
  8562. |`Xml`|Max (-1)|0|0|0|IgnoreCase, IgnoreKanaType, IgnoreWidth|
  8563. ]]></format>
  8564. </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>
  8565. </member>
  8566. <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)">
  8567. <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>
  8568. <format type="text/markdown"><![CDATA[
  8569. ## Remarks
  8570. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8571. ]]></format>
  8572. </remarks>
  8573. </member>
  8574. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type)">
  8575. <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>
  8576. <format type="text/markdown"><![CDATA[
  8577. ## Remarks
  8578. Only the following `SqlDbType` is allowed to be passed to the constructor as `dbType`: `UDT`.
  8579. 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`):
  8580. |SqlDbType|Maximum length|Precision|Scale|Locale|Compare options|
  8581. |---------------|--------------------|---------------|-----------|------------|---------------------|
  8582. |UDT|\<Max length of the type> or -1|0|0|0|None|
  8583. ]]></format>
  8584. </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>
  8585. </member>
  8586. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.#ctor(System.String,System.Data.SqlDbType,System.Type,System.String)">
  8587. <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>
  8588. </member>
  8589. <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)">
  8590. <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>
  8591. <format type="text/markdown"><![CDATA[
  8592. ## Remarks
  8593. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8594. ]]></format>
  8595. </remarks>
  8596. </member>
  8597. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.CompareOptions">
  8598. <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>
  8599. </member>
  8600. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.DbType">
  8601. <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>
  8602. <format type="text/markdown"><![CDATA[
  8603. ## Remarks
  8604. The default type is <xref:System.Data.DbType>.`String`.
  8605. ]]></format>
  8606. </remarks>
  8607. </member>
  8608. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.IsUniqueKey">
  8609. <summary>Indicates if the column in the table-valued parameter is unique.</summary><value>A <see langword="Boolean" /> value.</value><remarks>
  8610. <format type="text/markdown"><![CDATA[
  8611. ## Remarks
  8612. The default is `FALSE`.
  8613. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  8614. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8615. ]]></format>
  8616. </remarks>
  8617. </member>
  8618. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.LocaleId">
  8619. <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>
  8620. <format type="text/markdown"><![CDATA[
  8621. ## Remarks
  8622. The default value is the current locale of the current thread for string-valued SqlDbTypes, and 0 for SqlDbTypes that do not support collation.
  8623. Returns 0 if the collation of the underlying column type is not defined.
  8624. ]]></format>
  8625. </remarks>
  8626. </member>
  8627. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Max">
  8628. <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>
  8629. <format type="text/markdown"><![CDATA[
  8630. ## Remarks
  8631. The default value is -1.
  8632. ]]></format>
  8633. </remarks>
  8634. </member>
  8635. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.MaxLength">
  8636. <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>
  8637. <format type="text/markdown"><![CDATA[
  8638. ## Remarks
  8639. 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.
  8640. For <xref:System.Data.DbType>.`Row` this returns the number of columns in the row metadata instance.
  8641. The default value is 0.
  8642. ]]></format>
  8643. </remarks>
  8644. </member>
  8645. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Name">
  8646. <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>
  8647. </member>
  8648. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Precision">
  8649. <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>
  8650. <format type="text/markdown"><![CDATA[
  8651. ## Remarks
  8652. Returns 0 if the precision of the underlying column type is not defined.
  8653. ]]></format>
  8654. </remarks>
  8655. </member>
  8656. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Scale">
  8657. <summary>Gets the scale of the column or parameter.</summary><value>The scale of the column or parameter.</value><remarks>
  8658. <format type="text/markdown"><![CDATA[
  8659. ## Remarks
  8660. Returns 0 if the scale of the underlying column type is not defined.
  8661. ]]></format>
  8662. </remarks>
  8663. </member>
  8664. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SortOrder">
  8665. <summary>Returns the sort order for a column.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.SortOrder" /> object.</value><remarks>
  8666. <format type="text/markdown"><![CDATA[
  8667. ## Remarks
  8668. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  8669. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8670. ]]></format>
  8671. </remarks>
  8672. </member>
  8673. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SortOrdinal">
  8674. <summary>Returns the ordinal of the sort column.</summary><value>The ordinal of the sort column.</value><remarks>
  8675. <format type="text/markdown"><![CDATA[
  8676. ## Remarks
  8677. The default is 1.
  8678. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  8679. For more information, see [Table-Valued Parameters](~/docs/framework/data/adonet/sql/table-valued-parameters.md).
  8680. ]]></format>
  8681. </remarks>
  8682. </member>
  8683. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.SqlDbType">
  8684. <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>
  8685. <format type="text/markdown"><![CDATA[
  8686. ## Remarks
  8687. The default value is `NVarChar`.
  8688. ]]></format>
  8689. </remarks>
  8690. </member>
  8691. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.Type">
  8692. <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>
  8693. <format type="text/markdown"><![CDATA[
  8694. ## Remarks
  8695. The default value is `null`.
  8696. 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.
  8697. ]]></format>
  8698. </remarks>
  8699. </member>
  8700. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.TypeName">
  8701. <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>
  8702. <format type="text/markdown"><![CDATA[
  8703. ## Remarks
  8704. The default value is `null`.
  8705. ]]></format>
  8706. </remarks>
  8707. </member>
  8708. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.UseServerDefault">
  8709. <summary>Reports whether this column should use the default server value.</summary><value>A <see langword="Boolean" /> value.</value><remarks>
  8710. <format type="text/markdown"><![CDATA[
  8711. ## Remarks
  8712. The default is `FALSE`.
  8713. This property can only be set in one of the <xref:Microsoft.Data.SqlClient.Server.SqlMetaData> constructors.
  8714. ]]></format>
  8715. </remarks>
  8716. </member>
  8717. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionDatabase">
  8718. <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>
  8719. <format type="text/markdown"><![CDATA[
  8720. ## Remarks
  8721. The default value is `null`.
  8722. 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.
  8723. ]]></format>
  8724. </remarks>
  8725. </member>
  8726. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionName">
  8727. <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>
  8728. <format type="text/markdown"><![CDATA[
  8729. ## Remarks
  8730. The default value is `null`.
  8731. 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`.
  8732. ]]></format>
  8733. </remarks>
  8734. </member>
  8735. <member name="P:Microsoft.Data.SqlClient.Server.SqlMetaData.XmlSchemaCollectionOwningSchema">
  8736. <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>
  8737. <format type="text/markdown"><![CDATA[
  8738. ## Remarks
  8739. The default value is `null`.
  8740. 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`.
  8741. ]]></format>
  8742. </remarks>
  8743. </member>
  8744. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Boolean)">
  8745. <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">
  8746. <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>
  8747. </member>
  8748. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Byte)">
  8749. <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">
  8750. <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>
  8751. </member>
  8752. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Byte[])">
  8753. <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">
  8754. <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>
  8755. </member>
  8756. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Char)">
  8757. <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">
  8758. <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>
  8759. </member>
  8760. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Char[])">
  8761. <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">
  8762. <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>
  8763. </member>
  8764. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBinary)">
  8765. <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">
  8766. <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>
  8767. </member>
  8768. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBoolean)">
  8769. <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">
  8770. <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>
  8771. </member>
  8772. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlByte)">
  8773. <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">
  8774. <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>
  8775. </member>
  8776. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlBytes)">
  8777. <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">
  8778. <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>
  8779. </member>
  8780. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlChars)">
  8781. <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">
  8782. <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>
  8783. </member>
  8784. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDateTime)">
  8785. <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">
  8786. <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>
  8787. </member>
  8788. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDecimal)">
  8789. <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">
  8790. <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>
  8791. </member>
  8792. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlDouble)">
  8793. <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">
  8794. <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>
  8795. </member>
  8796. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlGuid)">
  8797. <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">
  8798. <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>
  8799. </member>
  8800. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt16)">
  8801. <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">
  8802. <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>
  8803. </member>
  8804. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt32)">
  8805. <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">
  8806. <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>
  8807. </member>
  8808. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlInt64)">
  8809. <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">
  8810. <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>
  8811. </member>
  8812. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlMoney)">
  8813. <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">
  8814. <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>
  8815. </member>
  8816. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlSingle)">
  8817. <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">
  8818. <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>
  8819. </member>
  8820. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlString)">
  8821. <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">
  8822. <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>
  8823. </member>
  8824. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Data.SqlTypes.SqlXml)">
  8825. <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">
  8826. <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>
  8827. </member>
  8828. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.DateTime)">
  8829. <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">
  8830. <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>
  8831. </member>
  8832. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.DateTimeOffset)">
  8833. <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">
  8834. <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>
  8835. </member>
  8836. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Decimal)">
  8837. <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">
  8838. <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>
  8839. </member>
  8840. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Double)">
  8841. <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">
  8842. <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>
  8843. </member>
  8844. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Guid)">
  8845. <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">
  8846. <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>
  8847. </member>
  8848. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int16)">
  8849. <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">
  8850. <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>
  8851. </member>
  8852. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int32)">
  8853. <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">
  8854. <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>
  8855. </member>
  8856. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Int64)">
  8857. <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">
  8858. <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>
  8859. </member>
  8860. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Object)">
  8861. <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">
  8862. <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>
  8863. </member>
  8864. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.Single)">
  8865. <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">
  8866. <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>
  8867. </member>
  8868. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.String)">
  8869. <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">
  8870. <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>
  8871. </member>
  8872. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.Adjust(System.TimeSpan)">
  8873. <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">
  8874. <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>
  8875. </member>
  8876. <member name="M:Microsoft.Data.SqlClient.Server.SqlMetaData.InferFromValue(System.Object,System.String)">
  8877. <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>
  8878. </member>
  8879. <member name="T:Microsoft.Data.SqlClient.Server.SqlMethodAttribute">
  8880. <summary>Indicates the determinism and data access properties of a method or property on a user-defined type (UDT). The properties on the attribute reflect the physical characteristics that are used when the type is registered with SQL Server.</summary><remarks>
  8881. <format type="text/markdown"><![CDATA[
  8882. ## Remarks
  8883. For a property, the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> should be used on the setter or the getter directly.
  8884. <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> inherits from a <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute>, so <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> inherits the `FillRowMethodName` and `TableDefinition` fields from <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute>. Note that it is not possible to write a table-valued method, although the names of these fields might suggest that it is possible.
  8885. ## Examples
  8886. The following example shows a UDT method that is attributed to indicate that the method will not be invoked on null instances of the type, that the method will not change the state of the type, and that the method will not be called when `null` parameters are supplied to the method invocation.
  8887. [!code-csharp[SqlMethod Sample#1](~/../sqlclient/doc/samples/SqlMethod.cs#1)]
  8888. ]]></format>
  8889. </remarks>
  8890. </member>
  8891. <member name="M:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.#ctor">
  8892. <summary>An attribute on a user-defined type (UDT), used to indicate the determinism and data access properties of a method or a property on a UDT.</summary><remarks>To be added.</remarks>
  8893. </member>
  8894. <member name="P:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.OnNullCall">
  8895. <summary>Indicates whether the method on a user-defined type (UDT) is called when <see langword="null" /> input arguments are specified in the method invocation.</summary><value> <see langword="true" /> if the method is called when <see langword="null" /> input arguments are specified in the method invocation; <see langword="false" /> if the method returns a <see langword="null" /> value when any of its input parameters are <see langword="null" />. If the method cannot be invoked (because of an attribute on the method), the SQL Server <see langword="DbNull" /> is returned.</value><remarks>
  8896. <format type="text/markdown"><![CDATA[
  8897. ## Remarks
  8898. The default value of the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.OnNullCall%2A> property is `true`.
  8899. ]]></format>
  8900. </remarks>
  8901. </member>
  8902. <member name="P:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator">
  8903. <summary>Indicates whether a method on a user-defined type (UDT) is a mutator.</summary><value> <see langword="true" /> if the method is a mutator; otherwise <see langword="false" />.</value><remarks>
  8904. <format type="text/markdown"><![CDATA[
  8905. ## Remarks
  8906. If the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> property is set to `true` and the return type of the method is `void`, SQL Server marks the method as a mutator. A mutator method is one that causes a state change in the UDT instance. Mutator methods can be called in assignment statements or data modification statements, but cannot be used in queries. If a method is marked as a mutator but does not return void, then CREATE TYPE does not fail with an error. Even though a returned value other than `void` does not raise an error, the returned value is not accessible and cannot be used.
  8907. The default value of the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> property is `false`.
  8908. A property can be a mutator if <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> is used on the setter and <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> is set to `true`. However, a property setter is implicitly treated as a mutator, so it is not necessary to set the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.IsMutator%2A> property of the <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> to `true`.
  8909. ]]></format>
  8910. </remarks>
  8911. </member>
  8912. <member name="P:Microsoft.Data.SqlClient.Server.SqlMethodAttribute.InvokeIfReceiverIsNull">
  8913. <summary>Indicates whether SQL Server should invoke the method on null instances.</summary><value> <see langword="true" /> if SQL Server should invoke the method on null instances; otherwise, <see langword="false" />. If the method cannot be invoked (because of an attribute on the method), the SQL Server <see langword="DbNull" /> is returned.</value><remarks>
  8914. <format type="text/markdown"><![CDATA[
  8915. ## Remarks
  8916. The default value of the `InvokeIfReceiverIsNull` property is `false`. That is, the method is not invoked on a null instance. If `InvokeIfReceiverIsNull` is `true`, the return value of the method depends upon its type. If the return type of the method is nullable, the distinguished null value for the type is returned. If the return type is non-nullable, the default CLR value for the type is returned. The default value for reference types is `null`. The default value for a value type is the value that is returned when you call the parameterless constructor for the type.
  8917. ]]></format>
  8918. </remarks>
  8919. </member>
  8920. <member name="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute">
  8921. <summary>Indicates that the type should be registered as a user-defined aggregate. The properties on the attribute reflect the physical attributes used when the type is registered with SQL Server. This class cannot be inherited.</summary><remarks>
  8922. <format type="text/markdown"><![CDATA[
  8923. ## Remarks
  8924. SQL Server creates a user-defined aggregate that is bound to the class definition that has the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute> custom attribute. Every user-defined aggregate must be annotated with this attribute.
  8925. See "CLR User-Defined Aggregates" in SQL Server 2005 Books Online for more information on user-defined aggregates and examples.
  8926. ## Examples
  8927. The following example shows the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute> attribute for a user-defined aggregate. The aggregate uses custom serialization, has a maximum size of 8000 bytes when serialized, and is invariant to nulls, duplicates, and order.
  8928. [!code-csharp[SqlUserDefinedAggregate Sample#1](~/../sqlclient/doc/samples/SqlUserDefinedAggregate.cs#1)]
  8929. ]]></format>
  8930. </remarks>
  8931. </member>
  8932. <member name="F:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSizeValue">
  8933. <summary>The maximum size, in bytes, required to store the state of this aggregate instance during computation.</summary><remarks>
  8934. <format type="text/markdown"><![CDATA[
  8935. ## Remarks
  8936. An <xref:System.Int32> value representing the maximum size of the aggregate instance.
  8937. ]]></format>
  8938. </remarks>
  8939. </member>
  8940. <member name="M:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.#ctor(Microsoft.Data.SqlClient.Server.Format)">
  8941. <param name="format">One of the <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> values representing the serialization format of the aggregate.</param><summary>A required attribute on a user-defined aggregate, used to indicate that the given type is a user-defined aggregate and the storage format of the user-defined aggregate.</summary>
  8942. </member>
  8943. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize">
  8944. <summary>The maximum size, in bytes, of the aggregate instance.</summary><value>An <see cref="T:System.Int32" /> value representing the maximum size of the aggregate instance.</value><remarks>
  8945. <format type="text/markdown"><![CDATA[
  8946. ## Remarks
  8947. This property does not have to be specified for Native format serialization.
  8948. You must specify the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize%2A> property with the UserDefined serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  8949. The maximum allowed value for this property is specified by the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSizeValue> field.
  8950. The maximum size allowed is 2 gigabytes (GB). You can specify a number from 1 to 8000 bytes, or -1 to represent a value larger than 8000 bytes, up to 2 gigabytes.
  8951. For an aggregate with user-defined serialization specified, <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize%2A> refers to the total size of the serialized data. Consider an aggregate serializing a string of 10 characters (<xref:System.Char>). When the string is serialized using a <xref:System.IO.BinaryWriter>, the total size of the serialized string is 22 bytes: 2 bytes per Unicode UTF-16 character, multiplied by the maximum number of characters, plus 2 control bytes of overhead incurred from serializing a binary stream. So, when determining the value of <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.MaxByteSize%2A>, the total size of the serialized data must be considered: the size of the data serialized in binary form plus the overhead incurred by serialization.
  8952. ]]></format>
  8953. </remarks>
  8954. </member>
  8955. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsInvariantToDuplicates">
  8956. <summary>Indicates whether the aggregate is invariant to duplicates.</summary><value> <see langword="true" /> if the aggregate is invariant to duplicates; otherwise <see langword="false" />.</value><remarks>
  8957. <format type="text/markdown"><![CDATA[
  8958. ## Remarks
  8959. Used by the query processor, this property is `true` if the aggregate is invariant to duplicates. That is, the aggregate of S, {X} is the same as aggregate of S when X is already in S. For example, aggregate functions such as MIN and MAX satisfy this property, while SUM does not.
  8960. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects both the plan selected and the results returned by the query.
  8961. ]]></format>
  8962. </remarks>
  8963. </member>
  8964. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsInvariantToNulls">
  8965. <summary>Indicates whether the aggregate is invariant to nulls.</summary><value> <see langword="true" /> if the aggregate is invariant to nulls; otherwise <see langword="false" />.</value><remarks>
  8966. <format type="text/markdown"><![CDATA[
  8967. ## Remarks
  8968. Used by the query processor, this property is `true` if the aggregate is invariant to nulls. That is, the aggregate of S, {NULL} is the same as aggregate of S. For example, aggregate functions such as MIN and MAX satisfy this property, while COUNT(*) does not.
  8969. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects the plan selected and the results returned by the query.
  8970. ]]></format>
  8971. </remarks>
  8972. </member>
  8973. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsInvariantToOrder">
  8974. <summary>Indicates whether the aggregate is invariant to order.</summary><value> <see langword="true" /> if the aggregate is invariant to order; otherwise <see langword="false" />.</value><remarks>
  8975. <format type="text/markdown"><![CDATA[
  8976. ## Remarks
  8977. Reserved for future use. This property is not currently used by the query processor: order is currently not guaranteed.
  8978. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects the plan selected and the results returned by the query.
  8979. The default value for this property is `false`.
  8980. ]]></format>
  8981. </remarks>
  8982. </member>
  8983. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.IsNullIfEmpty">
  8984. <summary>Indicates whether the aggregate returns <see langword="null" /> if no values have been accumulated.</summary><value> <see langword="true" /> if the aggregate returns <see langword="null" /> if no values have been accumulated; otherwise <see langword="false" />.</value><remarks>
  8985. <format type="text/markdown"><![CDATA[
  8986. ## Remarks
  8987. Used by the query processor, this property is `true` if the aggregate returns `null` if no values have been accumulated.
  8988. Incorrectly setting this property can result in incorrect query results. This property is not an optimizer hint; it affects the plan selected and the results returned by the query.
  8989. ]]></format>
  8990. </remarks>
  8991. </member>
  8992. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.Format">
  8993. <summary>The serialization format as a <see cref="T:Microsoft.Data.SqlClient.Server.Format" />.</summary><value>A <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> representing the serialization format.</value><remarks>
  8994. <format type="text/markdown"><![CDATA[
  8995. ## Examples
  8996. [!code-csharp[SqlUserDefinedAggregate1#6](~/../sqlclient/doc/samples/SqlUserDefinedAggregate1.cs#6)]
  8997. ]]></format>
  8998. </remarks>
  8999. </member>
  9000. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedAggregateAttribute.Name">
  9001. <summary>The name of the aggregate.</summary><value>A <see cref="T:System.String" /> value representing the name of the aggregate.</value>
  9002. </member>
  9003. <member name="T:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute">
  9004. <summary>Used to mark a type definition in an assembly as a user-defined type (UDT) in SQL Server. The properties on the attribute reflect the physical characteristics used when the type is registered with SQL Server. This class cannot be inherited.</summary><remarks>
  9005. <format type="text/markdown"><![CDATA[
  9006. ## Remarks
  9007. SQL Server creates a user-defined type that is bound to the type definition that has the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute> custom attribute. Every UDT must be annotated with this attribute. See [CLR User-Defined Types](https://go.microsoft.com/fwlink/?LinkId=128028) for more information about UDTs, including an example of a UDT.
  9008. ## Examples
  9009. The following example shows the `UserDefinedType` attribute of the Point UDT. The UDT is byte-ordered, is named "Point", has a validation method named "ValidatePoint", and uses the native serialization format.
  9010. [!code-csharp[SqlUserDefinedType Example#1](~/../sqlclient/doc/samples/SqlUserDefinedType.cs#1)]
  9011. ]]></format>
  9012. </remarks>
  9013. </member>
  9014. <member name="M:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.#ctor(Microsoft.Data.SqlClient.Server.Format)">
  9015. <param name="format">One of the <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> values representing the serialization format of the type.</param><summary>A required attribute on a user-defined type (UDT), used to confirm that the given type is a UDT and to indicate the storage format of the UDT.</summary><remarks>
  9016. <format type="text/markdown"><![CDATA[
  9017. ## Remarks
  9018. The following example specifies that the `Format` of the user-defined type is `SerializedDataWithMetadata` and the `MaxByteSize` is 8000 bytes.
  9019. ## Examples
  9020. [!code-csharp[SqlUserDefinedType1#12](~/../sqlclient/doc/samples/SqlUserDefinedType1.cs#12)]
  9021. ]]></format>
  9022. </remarks>
  9023. </member>
  9024. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize">
  9025. <summary>The maximum size of the instance, in bytes.</summary><value>An <see cref="T:System.Int32" /> value representing the maximum size of the instance.</value><remarks>
  9026. <format type="text/markdown"><![CDATA[
  9027. ## Remarks
  9028. You must specify the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> property with the `UserDefined` serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9029. When connecting to SQL Server 2005 or earlier, <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> must be between 1 and 8000.
  9030. When connecting to SQL Server 2008 or later, set <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> between 1 and 8000, for a type whose instances are always 8,000 bytes or less. For types that can have instances larger than 8000, specify -1.
  9031. For a UDT with user-defined serialization specified, <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A> refers to the total size of the UDT in its serialized form as defined by the user. Consider a UDT with a property of a string of 10 characters (<xref:System.Char>). When the UDT is serialized using a <xref:System.IO.BinaryWriter>, the total size of the serialized string is 22 bytes: 2 bytes per Unicode UTF-16 character, multiplied by the maximum number of characters, plus 2 control bytes of overhead incurred from serializing a binary stream. So, when determining the value of <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A>, the total size of the serialized UDT must be considered: the size of the data serialized in binary form plus the overhead incurred by serialization.
  9032. This property should not be used with `Native` serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9033. ]]></format>
  9034. </remarks>
  9035. </member>
  9036. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsFixedLength">
  9037. <summary>Indicates whether all instances of this user-defined type are the same length.</summary><value>
  9038. <see langword="true" /> if all instances of this type are the same length; otherwise <see langword="false" />.
  9039. </value><remarks>
  9040. <format type="text/markdown"><![CDATA[
  9041. ## Remarks
  9042. If set to `true`, all instances of UDTs corresponding to this common language runtime (CLR) type must have a length in bytes exactly equal to <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.MaxByteSize%2A>. This attribute is only relevant for UDTs with `UserDefined` serialization <xref:Microsoft.Data.SqlClient.Server.Format>.
  9043. ]]></format>
  9044. </remarks>
  9045. </member>
  9046. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered">
  9047. <summary>Indicates whether the user-defined type is byte ordered.</summary><value>
  9048. <see langword="true" /> if the user-defined type is byte ordered; otherwise <see langword="false" /> .</value><remarks>
  9049. <format type="text/markdown"><![CDATA[
  9050. ## Remarks
  9051. When set to `true`, the <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A> property in effect guarantees that the serialized binary data can be used for semantic ordering of the information. Thus, each instance of a byte-ordered UDT object can only have one serialized representation. When a comparison operation is performed in SQL Server on the serialized bytes, its results should be the same as if the same comparison operation had taken place in managed code.
  9052. The following features are supported when <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A> is set to `true`:
  9053. - The ability to create indexes on columns of this type.
  9054. - The ability to create primary and foreign keys as well as CHECK and UNIQUE constraints on columns of this type.
  9055. - The ability to use Transact-SQL ORDER BY, GROUP BY, and PARTITION BY clauses. In these cases, the binary representation of the type is used to determine the order.
  9056. - The ability to use comparison operators in Transact-SQL statements.
  9057. - The ability to persist computed columns of this type.
  9058. Note that both the `Native` and `UserDefined` serialization formats support the following comparison operators when <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.IsByteOrdered%2A> is set to `true`:
  9059. - Equal to (=)
  9060. - Not equal to (!=)
  9061. - Greater than (>)
  9062. - Less than (\<)
  9063. - Greater than or equal to (>=)
  9064. - Less than or equal to (<=)
  9065. ]]></format>
  9066. </remarks>
  9067. </member>
  9068. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.Format">
  9069. <summary>The serialization format as a <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> .</summary><value>A <see cref="T:Microsoft.Data.SqlClient.Server.Format" /> value representing the serialization format.</value>
  9070. </member>
  9071. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.ValidationMethodName">
  9072. <summary>The name of the method used to validate instances of the user-defined type.</summary><value>A <see cref="T:System.String" /> representing the name of the method used to validate instances of the user-defined type.</value><remarks>
  9073. <format type="text/markdown"><![CDATA[
  9074. ## Remarks
  9075. The method specified by this attribute validates instances of the UDT when the UDT has been deserialized from a binary value that is not trusted.
  9076. ]]></format>
  9077. </remarks>
  9078. </member>
  9079. <member name="P:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.Name">
  9080. <summary>The SQL Server name of the user-defined type.</summary><value>A <see cref="T:System.String" /> value representing the SQL Server name of the user-defined type.</value><remarks>
  9081. <format type="text/markdown"><![CDATA[
  9082. ## Remarks
  9083. The <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute.Name%2A> property is not used within SQL Server, but is used by the Microsoft Visual Studio .NET Integrated Development Environment (IDE).
  9084. ]]></format>
  9085. </remarks>
  9086. </member>
  9087. <member name="T:Microsoft.Data.SqlClient.Server.SystemDataAccessKind">
  9088. <summary>Describes the type of access to system data for a user-defined method or function.</summary><remarks>
  9089. <format type="text/markdown"><![CDATA[
  9090. ## Remarks
  9091. Describes the type of access to system data for a user-defined method or function.
  9092. This enumeration is used in <xref:Microsoft.Data.SqlClient.Server.SqlMethodAttribute> and <xref:Microsoft.Data.SqlClient.Server.SqlFunctionAttribute> to indicate what type of access to system data the method or function has.
  9093. Note that methods and functions are not allowed to make changes to the database, so the options for this enumeration are `None` (meaning no data-access performed by the method or function) and `Read` (meaning that the method or function performs read-only data-access operations, such as executing SELECT statements).
  9094. ]]></format>
  9095. </remarks>
  9096. </member>
  9097. <member name="F:Microsoft.Data.SqlClient.Server.SystemDataAccessKind.None">
  9098. <summary>The method or function does not access system data.</summary>
  9099. </member>
  9100. <member name="F:Microsoft.Data.SqlClient.Server.SystemDataAccessKind.Read">
  9101. <summary>The method or function reads system data.</summary>
  9102. </member>
  9103. <member name="T:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity">
  9104. <summary>Represents the Data Classification Sensitivity Information for columns as configured in Database.</summary><remarks>To be added.</remarks>
  9105. </member>
  9106. <member name="M:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity.#ctor(System.Collections.Generic.IList{Microsoft.Data.SqlClient.DataClassification.SensitivityProperty})">
  9107. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity" /> class.</summary>
  9108. </member>
  9109. <member name="P:Microsoft.Data.SqlClient.DataClassification.ColumnSensitivity.SensitivityProperties">
  9110. <summary>Returns the list of sensitivity properties as received from Server for this 'ColumnSensitivity' information</summary><value>List of sensitivity properties.</value><remarks>To be added.</remarks>
  9111. </member>
  9112. <member name="T:Microsoft.Data.SqlClient.DataClassification.InformationType">
  9113. <summary>Represents the Data Classification Information Types as received from SQL Server for the active 'SqlDataReader'</summary><remarks>To be added.</remarks>
  9114. </member>
  9115. <member name="M:Microsoft.Data.SqlClient.DataClassification.InformationType.#ctor(System.String,System.String)">
  9116. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.InformationType" /> class.</summary>
  9117. </member>
  9118. <member name="P:Microsoft.Data.SqlClient.DataClassification.InformationType.Id">
  9119. <summary>Gets the ID for this 'InformationType' object</summary><value>ID of InformationType.</value><remarks>To be added.</remarks>
  9120. </member>
  9121. <member name="P:Microsoft.Data.SqlClient.DataClassification.InformationType.Name">
  9122. <summary>Gets the name for this 'InformationType' object</summary><value>Name of InformationType.</value><remarks>To be added.</remarks>
  9123. </member>
  9124. <member name="T:Microsoft.Data.SqlClient.DataClassification.Label">
  9125. <summary>Represents the Data Classification Labels as received from SQL Server for the active 'SqlDataReader'</summary><remarks>To be added.</remarks>
  9126. </member>
  9127. <member name="M:Microsoft.Data.SqlClient.DataClassification.Label.#ctor(System.String,System.String)">
  9128. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.Label" /> class.</summary>
  9129. </member>
  9130. <member name="P:Microsoft.Data.SqlClient.DataClassification.Label.Id">
  9131. <summary>Gets the ID for this 'Label' object</summary><value>ID of label.</value><remarks>To be added.</remarks>
  9132. </member>
  9133. <member name="P:Microsoft.Data.SqlClient.DataClassification.Label.Name">
  9134. <summary>Gets the name for this 'Label' object</summary><value>Name of label.</value><remarks>To be added.</remarks>
  9135. </member>
  9136. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification">
  9137. <summary>Provides the functionlity to retrieve Sensitivity Classification data as received from SQL Server for the active 'SqlDataReader'</summary><remarks>To be added.</remarks>
  9138. </member>
  9139. <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})">
  9140. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification" />
  9141. class.</summary>
  9142. </member>
  9143. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.ColumnSensitivities">
  9144. <summary>Returns the column sensitivity for this 'SensitivityClassification' Object</summary><value>List of column sensitivities.</value><remarks>To be added.</remarks>
  9145. </member>
  9146. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.InformationTypes">
  9147. <summary>Returns the information types collection for this 'SensitivityClassification' Object</summary><value>List of information types.</value><remarks>To be added.</remarks>
  9148. </member>
  9149. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityClassification.Labels">
  9150. <summary>Returns the labels collection for this 'SensitivityClassification' Object</summary><value>List of labels.</value><remarks>To be added.</remarks>
  9151. </member>
  9152. <member name="T:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty">
  9153. <summary>Represents the Data Classification Sensitivity Information for columns as configured in Database.</summary><remarks>To be added.</remarks>
  9154. </member>
  9155. <member name="M:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.#ctor(Microsoft.Data.SqlClient.DataClassification.Label,Microsoft.Data.SqlClient.DataClassification.InformationType)">
  9156. <summary>Initializes a new instance of the <see cref="T:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty" /> class.</summary>
  9157. </member>
  9158. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.InformationType">
  9159. <summary>Returns the information type for this 'SensitivityProperty' Object</summary><value>Information type for this SensitivityProperty.</value><remarks>To be added.</remarks>
  9160. </member>
  9161. <member name="P:Microsoft.Data.SqlClient.DataClassification.SensitivityProperty.Label">
  9162. <summary>Returns the label for this 'SensitivityProperty' Object</summary><value>Label for this SensitivityProperty.</value><remarks>To be added.</remarks>
  9163. </member>
  9164. </members>
  9165. </doc>