How to get data from sql database to textbox directly in c# using connectionstring

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to my channel to blonde from this tutorial I will show how to get data from database into text box in c-sharp using connection string [Music] to get inside of it delete it you go to the link description box below okay this is the text box text change event I read the code to display that in the text box according to the ID that Xbox one yeah for ID now SQL connection corn equal to new SQL connection here I'll put my connection listing my connections thing is to get connecting just select the database my test DB and go to the property window just coffee the can select and coffee the connection string then just paste here okay now open the connection con dot open now write SQL come on to write SQL c'mon first of all at SQL command CMD equal to new SQL come on all right you come on double quotation and call the con conditioner sting the SQL command is simple select name my database column is ID name is I will get the text of name and age according to the ID so select name is from you certify our ID equal to a delta phi d a Delta Phi D is variable so the variable will take the data of textbox wand or text in that case at CMT dot for a meter start ed with value at that of ID IDs textbook swan dot tex noted that ID is integer type so i have to convert it to integer dot first text box one dot txt okay now SQL data Reader D equal to CM d dot executed reader okay when it will load specifically it should be you simulate execute reader and using SQL data later finally while da da treat oh sorry after I read mask put breaths okay now text box to dot text text back to for name to display that name in the technical to detect in that case da dot get value in there just put your index name in there zero index 0 dot twisting and tags box 3 for each is in there 1 noted that in the c-sharp language sheesh of dotnet index must start from zero ok da dot get value 1 1 is for is yes is now finally close the connection con dot close ok just debug yes put ID 1 ID michael 55 o input is teen was not in a correct format ID textbook swan is integer type so it cannot be blank at first egg at runtime okay in that case if I just add the port of if dr. Swann dot text initially the direction is a string so string type so Tigris on dot text not equal to blank then it will execute or nothing happened so if tables on door text not equal to blank now D back the L will not display one two three yes displayed for factly to his tom to get this voltage will go to the link description box below [Music]
Info
Channel: Swift Learn
Views: 89,580
Rating: undefined out of 5
Keywords: swift learn, how to display data in textbox from database in c#, display data from database in c#, get text directly from database, get text directly from database to textbox, how to display data from sql database to textbox using c#.net, get text in textbox c#, text box in c#, how to, get data from sql to textbox c#, get data in textbox from database c#, textbox text change event in c#, visual studio code
Id: Zgu_PF0tFf0
Channel Id: undefined
Length: 4min 36sec (276 seconds)
Published: Mon Feb 11 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.