title
C# WPF Tutorial 11- Saving Data to Database from WPF Application
description
input validation before saving data into the database in wpf c# SQlite
Embedded database with saving feature on C# WPF SQlite.
★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ http://bit.ly/2vsuMaS ⚫️ http://bit.ly/2GOaeQB
Java Programming Course ➡️ http://bit.ly/2GEfQMf ⚫️ http://bit.ly/2Vvjy4a
Bash Shell Scripting Course ➡️ http://bit.ly/2DBVF0C ⚫️ http://bit.ly/2UM06vF
Linux Command Line Tutorials ➡️ http://bit.ly/2IXuil0 ⚫️ http://bit.ly/2IXukt8
C Programming Course ➡️ http://bit.ly/2GQCiD1 ⚫️ http://bit.ly/2ZGN6ej
C++ Programming Course ➡️ http://bit.ly/2V4oEVJ ⚫️ http://bit.ly/2XMvqMs
PHP Programming Course ➡️ http://bit.ly/2XP71WH ⚫️ http://bit.ly/2vs3od6
Android Development Course ➡️ http://bit.ly/2UHih5H ⚫️ http://bit.ly/2IMhVci
C# Programming Course ➡️ http://bit.ly/2Vr7HEl ⚫️ http://bit.ly/2W6RXTU
JavaFx Programming Course ➡️ http://bit.ly/2XMvZWA ⚫️ http://bit.ly/2V2CoAi
NodeJs Programming Course ➡️ http://bit.ly/2GPg7gA ⚫️ http://bit.ly/2GQYTQ2
Jenkins Course For Developers and DevOps ➡️ http://bit.ly/2Wd4l4W ⚫️ http://bit.ly/2J1B1ug
Scala Programming Tutorial Course ➡️ http://bit.ly/2PysyA4 ⚫️ http://bit.ly/2PCaVj2
Bootstrap Responsive Web Design Tutorial ➡️ http://bit.ly/2DFQ2yC ⚫️ http://bit.ly/2VoJWwH
MongoDB Tutorial Course ➡️ http://bit.ly/2LaCJfP ⚫️ http://bit.ly/2WaI7Ap
QT C++ GUI Tutorial For Beginners ➡️ http://bit.ly/2vwqHSZ
★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare - https://skillshare.eqcm.net/r1KEj
Data Science - http://bit.ly/2lD9h5L | http://bit.ly/2lI8wIl
Machine Learning - http://bit.ly/2WGGQpb | http://bit.ly/2GghLXX
Artificial Intelligence - http://bit.ly/2lYqaYx | http://bit.ly/2NmaPya
MERN Stack E-Degree Program - http://bit.ly/2kx2NFe | http://bit.ly/2lWj4no
DevOps E-degree - http://bit.ly/2k1PwUQ | http://bit.ly/2k8Ypfy
Data Analytics with R - http://bit.ly/2lBKqz8 | http://bit.ly/2lAjos3
AWS Certification Training - http://bit.ly/2kmLtTu | http://bit.ly/2lAkQL1
Projects in Java - http://bit.ly/2kzn25d | http://bit.ly/2lBMffs
Machine Learning With TensorFlow - http://bit.ly/2m1z3AF | http://bit.ly/2lBMhnA
Angular 8 - Complete Essential Guide - http://bit.ly/2lYvYRP
Kotlin Android Development Masterclass - http://bit.ly/2GcblsI
Learn iOS Programming Building Advance Projects - http://bit.ly/2kyX7ue
★★★ Follow ★★★
My Website - http://www.codebind.com
DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
WPF RichTextBox Content text image save to database - C# SQlite
Save and Retrieve images in WPF From Database SQlite
Using SQLite with .Net - C#
c# - How to Start with SQlite and .net 4.0?
c# - How to work with SQLite in WPF
c# - What's the best way to save data locally in a WPF
Add, Edit, Delete data in WPF 2010
how to generate Seriel number automatic in c# wpf
WPF Loading and Saving Image to SQL Database
Save and Retrieve images in SQL Server using WPF
detail
{'title': 'C# WPF Tutorial 11- Saving Data to Database from WPF Application', 'heatmap': [{'end': 312.999, 'start': 291.452, 'weight': 1}], 'summary': 'The tutorial covers setting up a login page and a second form in a wpf application, demonstrating how to save data in the database. it includes creating a connection, forming an insert query, and saving data into an sql database using c# and wpf.', 'chapters': [{'end': 120.837, 'segs': [{'end': 120.837, 'src': 'embed', 'start': 0.85, 'weight': 0, 'content': [{'end': 2.871, 'text': 'hello, guys, welcome once again.', 'start': 0.85, 'duration': 2.021}, {'end': 17.724, 'text': 'till now we have made in our WPF application a login page which looks like this, and when you enter username and password and press login,', 'start': 2.871, 'duration': 14.853}, {'end': 20.827, 'text': 'it says whether your username and password is correct.', 'start': 17.724, 'duration': 3.103}, {'end': 26.411, 'text': "and if it's correct, it opens the second form, which is blank right now.", 'start': 20.827, 'duration': 5.584}, {'end': 38.763, 'text': 'so in this video i will show you how to save data in the database in this second form.', 'start': 27.933, 'duration': 10.83}, {'end': 45.129, 'text': 'so i will use this form to save the data in the database.', 'start': 38.763, 'duration': 6.366}, {'end': 49.293, 'text': "so let's see how can i do this.", 'start': 45.129, 'duration': 4.164}, {'end': 66.076, 'text': 'so I have shown you in the previous videos that how can you make this second xaml file and I want to give the same appearance as my main window.', 'start': 49.293, 'duration': 16.783}, {'end': 80.096, 'text': 'so what I will do is in the second video I think I have shown you how to set the image background to your window.', 'start': 66.076, 'duration': 14.02}, {'end': 93.018, 'text': 'so go to that code in which you have set the image and just copy this image source and the source location,', 'start': 80.096, 'duration': 12.922}, {'end': 110.935, 'text': 'the whole code from here in the grid section, and then go to your second.xml file and go here in grid once again grid tag and paste it here,', 'start': 93.018, 'duration': 17.917}, {'end': 120.837, 'text': 'and once you paste this, your second.xml file will look same as your login page.', 'start': 110.935, 'duration': 9.902}], 'summary': 'The tutorial covers creating a login page and saving data in a database using a wpf application.', 'duration': 119.987, 'max_score': 0.85, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY850.jpg'}], 'start': 0.85, 'title': 'Saving data in wpf', 'summary': 'Demonstrates setting up a login page and a blank second form in a wpf application, and proceeds to show how to save data in the database using the second form.', 'chapters': [{'end': 120.837, 'start': 0.85, 'title': 'Wpf application: saving data in database', 'summary': 'Demonstrates setting up a login page and a blank second form in a wpf application, and proceeds to show how to save data in the database using the second form.', 'duration': 119.987, 'highlights': ['Setting up a login page with functionality to verify the username and password.', 'Transitioning to a second form upon successful login, which is currently blank.', 'Demonstrating how to set the appearance of the second form to match the main window using image background.', "Guiding on copying the image source and location code from the main window to the second form's grid section to achieve a consistent appearance."]}], 'duration': 119.987, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY850.jpg', 'highlights': ['Setting up a login page with functionality to verify the username and password.', 'Transitioning to a second form upon successful login, which is currently blank.', 'Demonstrating how to set the appearance of the second form to match the main window using image background.', "Guiding on copying the image source and location code from the main window to the second form's grid section to achieve a consistent appearance."]}, {'end': 451.381, 'segs': [{'end': 268.198, 'src': 'embed', 'start': 120.837, 'weight': 0, 'content': [{'end': 128.56, 'text': 'so this is setting your background now for saving the data in the database.', 'start': 120.837, 'duration': 7.723}, {'end': 134.582, 'text': 'I need some text boxes and the button.', 'start': 128.56, 'duration': 6.022}, {'end': 169.406, 'text': 'so I will take first of all from here text box one, two, three, four, four, okay, and I will take four labels also for employee ID, name,', 'start': 134.582, 'duration': 34.824}, {'end': 179.993, 'text': 'surname and age, and I want to assemble it in proper way.', 'start': 169.406, 'duration': 10.587}, {'end': 180.734, 'text': 'so like this.', 'start': 179.993, 'duration': 0.741}, {'end': 194.675, 'text': 'so now i assembled my labels and text boxes and i have given labels employee id or eid, name, surname and age.', 'start': 183.624, 'duration': 11.051}, {'end': 197.718, 'text': 'so you already know, i think, how to change.', 'start': 194.675, 'duration': 3.043}, {'end': 201.862, 'text': 'just go to the properties here and go to the content.', 'start': 197.718, 'duration': 4.144}, {'end': 207.307, 'text': 'just select your label and change the name or content from here.', 'start': 201.862, 'duration': 5.445}, {'end': 209.37, 'text': 'in a similar way.', 'start': 208.348, 'duration': 1.022}, {'end': 219.505, 'text': 'I have selected this text boxes and I change the text box name from here.', 'start': 209.37, 'duration': 10.135}, {'end': 224.007, 'text': 'so first text box name is employee id, eid text.', 'start': 219.505, 'duration': 4.502}, {'end': 228.108, 'text': 'second, text box name is name underscore text.', 'start': 224.007, 'duration': 4.101}, {'end': 232.969, 'text': 'third, text box name is surname, underscore text.', 'start': 228.108, 'duration': 4.861}, {'end': 239.15, 'text': 'and fourth text box name is age, underscore text.', 'start': 232.969, 'duration': 6.181}, {'end': 244.312, 'text': 'so four text boxes and four labels i have taken.', 'start': 239.15, 'duration': 5.162}, {'end': 268.198, 'text': 'now i will take a button and I will name this button as btn underscore save, and I will change its content also as save.', 'start': 244.312, 'duration': 23.886}], 'summary': 'Setting up data input interface with 4 text boxes, 4 labels, and a save button.', 'duration': 147.361, 'max_score': 120.837, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY120837.jpg'}, {'end': 378.068, 'src': 'heatmap', 'start': 291.452, 'weight': 1, 'content': [{'end': 304.576, 'text': 'So in my Escalite database I have these fields called EID, Name, Surname, Age, User Name and Password.', 'start': 291.452, 'duration': 13.124}, {'end': 312.999, 'text': 'So I have six fields but I want to just save four columns EID, Name, Surname and Age.', 'start': 305.937, 'duration': 7.062}, {'end': 317.761, 'text': 'So I choose these four columns from here.', 'start': 314.14, 'duration': 3.621}, {'end': 334.211, 'text': 'now I go to my program once again and I go to the main window and here I have written the connection to the Escalite database.', 'start': 319.907, 'duration': 14.304}, {'end': 335.651, 'text': 'so I go to the code.', 'start': 334.211, 'duration': 1.44}, {'end': 338.612, 'text': 'I just copy the code in order to save the time.', 'start': 335.651, 'duration': 2.961}, {'end': 344.153, 'text': 'so you need this system.data.escalite namespace.', 'start': 338.612, 'duration': 5.541}, {'end': 353.275, 'text': 'so just double click this save button and at the top just import this namespace system.data.escalite.', 'start': 344.153, 'duration': 9.122}, {'end': 368.961, 'text': 'Now, once again, go to your main xml file and here we have defined the connection to the database in the login page video.', 'start': 354.706, 'duration': 14.255}, {'end': 372.964, 'text': 'so i just copy this same code for the connection.', 'start': 368.961, 'duration': 4.003}, {'end': 378.068, 'text': 'our database name is database.dv and version of escalite is three.', 'start': 372.964, 'duration': 5.104}], 'summary': 'The transcript discusses modifying and connecting to an escalite database, specifying columns to save, and importing necessary namespaces.', 'duration': 72.131, 'max_score': 291.452, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY291452.jpg'}], 'start': 120.837, 'title': 'Database interface and data saving', 'summary': 'Covers setting up text boxes, labels, and a saving button for database data, and discusses connecting to a database using escalite and saving data by selecting specific columns.', 'chapters': [{'end': 268.198, 'start': 120.837, 'title': 'Setting data in database interface', 'summary': 'Covers the process of setting up text boxes, labels, and a button for saving data in a database, including creating and assembling text boxes and labels, and naming the button for saving.', 'duration': 147.361, 'highlights': ['The process involves creating and assembling four text boxes and labels for employee ID, name, surname, and age.', 'The method for changing the content of labels and text boxes involves accessing the properties and modifying the content, demonstrated by changing the label names and the text box names.', "The button for saving data is named 'btn_save' and its content is also changed to 'save'."]}, {'end': 451.381, 'start': 268.198, 'title': 'Connecting and saving data to database', 'summary': 'Discusses connecting to a database using escalite and saving data by selecting specific columns, along with importing necessary namespaces and reusing code to expedite the process.', 'duration': 183.183, 'highlights': ['The database contains six fields, but only four (EID, Name, Surname, Age) need to be saved, streamlining the process and reducing unnecessary data storage.', "The process involves importing the 'system.data.escalite' namespace, reusing code from the main window, and copying code from the login page to expedite the process, emphasizing efficiency and time-saving techniques."]}], 'duration': 330.544, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY120837.jpg', 'highlights': ['The process involves creating and assembling four text boxes and labels for employee ID, name, surname, and age.', 'The database contains six fields, but only four (EID, Name, Surname, Age) need to be saved, streamlining the process and reducing unnecessary data storage.', 'The method for changing the content of labels and text boxes involves accessing the properties and modifying the content, demonstrated by changing the label names and the text box names.', "The process involves importing the 'system.data.escalite' namespace, reusing code from the main window, and copying code from the login page to expedite the process, emphasizing efficiency and time-saving techniques.", "The button for saving data is named 'btn_save' and its content is also changed to 'save'."]}, {'end': 1087.088, 'segs': [{'end': 791.257, 'src': 'embed', 'start': 755.774, 'weight': 1, 'content': [{'end': 773.661, 'text': 'so our query basically looks like this i will break it into two parts so you can see this or i will leave it same.', 'start': 755.774, 'duration': 17.887}, {'end': 785.914, 'text': 'so i have written the query insert into employee id and the column name, eid name, surname and age, and then i pass the values for EID, name, surname.', 'start': 773.661, 'duration': 12.253}, {'end': 791.257, 'text': 'so write values and pass all the values from the text boxes.', 'start': 785.914, 'duration': 5.343}], 'summary': 'Query: insert into employee table with columns: eid, name, surname, and age, along with respective values.', 'duration': 35.483, 'max_score': 755.774, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY755774.jpg'}, {'end': 904.5, 'src': 'embed', 'start': 868.053, 'weight': 2, 'content': [{'end': 872.857, 'text': 'so I know that my data is saved into the database.', 'start': 868.053, 'duration': 4.804}, {'end': 878.002, 'text': 'okay, so write the query and write this code.', 'start': 872.857, 'duration': 5.145}, {'end': 884.649, 'text': 'if you want, you can pause the video and just write the code.', 'start': 878.002, 'duration': 6.647}, {'end': 899.604, 'text': 'one thing I also forgot once you open this connection, you must close the connection also, so the database is not busy with this connection.', 'start': 884.649, 'duration': 14.955}, {'end': 904.5, 'text': 'so once you open the connection, you just close the connection here.', 'start': 899.604, 'duration': 4.896}], 'summary': 'Data saved to database; close connection after opening.', 'duration': 36.447, 'max_score': 868.053, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY868053.jpg'}, {'end': 1081.012, 'src': 'embed', 'start': 1036.372, 'weight': 0, 'content': [{'end': 1039.836, 'text': 'it is saved in this database.', 'start': 1036.372, 'duration': 3.464}, {'end': 1042.319, 'text': 'one more data, if you want.', 'start': 1039.836, 'duration': 2.483}, {'end': 1059.236, 'text': 'you can add, for example, 5 and his name is any name and age.', 'start': 1042.319, 'duration': 16.917}, {'end': 1061.498, 'text': 'age is too much, okay.', 'start': 1059.236, 'duration': 2.262}, {'end': 1066.281, 'text': 'so we have employee id 5 also and save it.', 'start': 1061.498, 'duration': 4.783}, {'end': 1069.784, 'text': 'my data is saved and i refresh my database.', 'start': 1066.281, 'duration': 3.503}, {'end': 1074.587, 'text': 'go to structure once again and my data is here once again.', 'start': 1069.784, 'duration': 4.803}, {'end': 1081.012, 'text': 'so in this way you can save your data into the database using your wpf application.', 'start': 1074.587, 'duration': 6.425}], 'summary': 'Data is saved in the database, including an example with employee id 5 and age, demonstrating the process of saving data using a wpf application.', 'duration': 44.64, 'max_score': 1036.372, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY1036372.jpg'}], 'start': 453.2, 'title': 'Inserting and saving data in c# and wpf', 'summary': 'Discusses inserting data into a database using c#, including creating a connection and forming an insert query, and saving data into an sql database using a wpf application, covering the code writing process, opening and closing connections, and verifying the saved data.', 'chapters': [{'end': 829.965, 'start': 453.2, 'title': 'Insert data into database using c#', 'summary': 'Discusses the process of inserting data into a database using c#, including creating a connection, forming an insert query, and passing values from text boxes, ensuring the correctness of the query.', 'duration': 376.765, 'highlights': ['The chapter discusses the process of inserting data into a database using C#, including creating a connection, forming an insert query, and passing values from text boxes, ensuring the correctness of the query.', "The query includes the instruction to insert data into the 'employee ID' table, specifying the columns 'eid', 'name', 'surname', and 'age', and then passing the corresponding values from the text boxes.", 'The speaker demonstrates the process of dynamically forming the insert query by retrieving values from text boxes and constructing the query accordingly, ensuring accurate alignment between the column names and the input values.']}, {'end': 1087.088, 'start': 832.742, 'title': 'Wpf application data saving', 'summary': 'Covers the process of saving data into an sql database using a wpf application, including writing the code, opening and closing connections, adding new data, and verifying the saved data in the database.', 'duration': 254.346, 'highlights': ['The process of saving data into an SQL database using a WPF application The chapter provides a detailed guide on saving data into an SQL database using a WPF application.', 'Writing the code for saving data and displaying a message upon successful save The speaker demonstrates writing the code for saving data and displaying a message upon successful save in the form of a message box.', 'Importance of opening and closing database connections Emphasizes the necessity of opening and closing database connections to avoid keeping the database busy and ensure proper functionality.', 'Adding new data and verifying its presence in the database The process of adding new data, such as an employee ID, and verifying its successful addition in the SQL database is explained.']}], 'duration': 633.888, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/P1pBUGblPKY/pics/P1pBUGblPKY453200.jpg', 'highlights': ['The chapter provides a detailed guide on saving data into an SQL database using a WPF application.', 'The process of inserting data into a database using C#, including creating a connection, forming an insert query, and passing values from text boxes, is discussed.', 'Emphasizes the necessity of opening and closing database connections to avoid keeping the database busy and ensure proper functionality.', 'The speaker demonstrates the process of dynamically forming the insert query by retrieving values from text boxes and constructing the query accordingly.']}], 'highlights': ['The tutorial covers setting up a login page with functionality to verify the username and password.', 'The process involves creating and assembling four text boxes and labels for employee ID, name, surname, and age.', 'The chapter provides a detailed guide on saving data into an SQL database using a WPF application.', 'Transitioning to a second form upon successful login, which is currently blank.', 'The process of inserting data into a database using C#, including creating a connection, forming an insert query, and passing values from text boxes, is discussed.']}