C# with PostgreSQL | Connection to Database | episode 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello guys welcome back to join coda today we talk about how to use programming language shop connect to progress db so we need to create a small project use visual studio 2019 so i hope you enjoy videos version of your tools that you can abuse 2010 or you you can test it go to create a new project and choose window form and create i will keep on my desktop and my project i put i dry c sharp connects with a progress xus okay now we got a new form and new projects so i rename this one to the main form and i don't need anything right now i just want to create the connection to show you how to connect or how is that actually now we have a program in c sub our project like this and we need to create the db and i have already liberty in his pockets db so we need to have connection to it and transfer that then or select or get there from pg to csup actually if we want to connect we need to has a servers ip sv ip and db name and users users and password pswd okay i hope you can clearly understand this so let's start and then i will rise one by one but firstly we need to install a packet or library npn gxul now i use version 5.0.4 so i will keep the link in this description below okay so let me copy this or i can open this one i will copy from this one and install to my project so if you use no get here and pass here in test so you will see the revlon is auto installed here np gsxul so let's start now i need a variable for assign connection str connection iris sorry the format we need we have servers equals and parts part is very important too and user's id user for login password and database name okay i hope you already installed a follow with what i saw you already so now i have a database already i start to connect directly and to put a biomat one by one example now i have a db joint coder here and the db is under the server's progress 13 so i can rename this one to a server yeah so i need to know this server can exit the localhost or ip which ip and port and username so i have localhost here and my vehicle base and pass here and i know my parts here is equal one one four time and my users i will i use progress okay i hope you can see this one and my password is love sorry i have semicolon here and my db i want to connect to joint orders so let me copy from that rest here okay now we have a string servers i'm going to visit the local and port and users for log into the database and password and database so let's start to create a small function for connect drivers and voice connection now i start to be in xql connection header is con and np key xul command i put vc md okay so now we need to assign or we need to create connection to the db we just declare like this we not just connect or we not yet assigned so i will post v discount as the new np connection and please come the connection 3 equals with str selection i write detail like this because i worry you can choose the sort or something but if you can write in a sort like copy here two into here also okay so this con dot open sorry yes vixx on open now i copy this one too here let to start to run and to test it works or not yes it's it's working now connection is can connect but we don't we don't know it can't get there or not or some we have permission to get the diaphragm databand we can test one more step so why i create here we need to use some command to get a data so i create one more function private or public yeah but please uh that i assigned the database and get that sorry together and like this and i will create the database and return easy okay here's i have actual string so let's start first i need to get connection start to connection again and okay if we already open here we need to check one more statement if this con dot punish the stats equal condition state that open we can open okay and we can start to create connection already and then we can create a comma to execute connection with connection we cmd dot connection a cloth reconnection yeah and free cmd sorry the dot command text equals actuals below okay and if i want to get the data back i need to read i need to declare a one most what i want is the director so np and gxuos 2 ql reader okay that editor is the os and equals we simply dot readers so we have connection we have executed us and we want to return to data tables after we have connection and we have assigned a query to command so we need a new variables data so on png xul readers the data i declare tr a course cmd dot execute leaders okay now after execute we can get a variable to here but i want to return to my data table in here so i put the data board dot lot from the os the dirty test okay now the t have letters okay can test from here and then we can create one what down here yes and i assign your name btls okay one more thing is i get data review into here rename is pg letters okay the name from here and then change value sorry okay double clicks and then we start to use get data so before you get let me checks a query i have that i have a table login let me check start from actual users it's cute okay i have to record right now so i will start to put it get that there and copy from this one yes in two years and can start to run to death inhale or not okay one more thing is because of it can return the data ball i can get data equals news data table yes and i put here equals okay double sorry dt get that dublicate if we get that time it will get into our data tables here dt so let to run and then click ok okay can nice okay we have missing one more thing is we can we are the league add variable but we not just declare so because new command okay okay let's run again and then click okay okay we can get data here so after that we can get a record into here mean connection and get data now is successfully okay now we can get data into the database so we can assign to the diagram view eg dot data source equals dt created us okay and start to run again when you click ok that that will be appear in yes okay now connection is successfully and get data is successfully okay i hope this step is you can understand and follow step by step thank you for watching and we will continue to the next step
Info
Channel: JoinCoder
Views: 529
Rating: undefined out of 5
Keywords: code, programmer, programming, life, Happy, funny code, CodeJoin, JoinCoder
Id: Tkfh-wWmgoc
Channel Id: undefined
Length: 15min 58sec (958 seconds)
Published: Fri May 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.