C# MS Access Database Tutorial 6 # Insert/Save data to database

C# MS Access Database Tutorial 6 # Insert/Save data to database


How to: Insert New Records into a Database
Database Access with Visual C#.NET
sql server - Insert Data into database in C#
How to insert Data to Ms SQL server 2008 using C#.net
.net - C# insert data into SQL table MS Access
Using Visual C# and SQL cannot insert data into table..‎
c# import data from text file into sql databse line by line‎
store xml in SQL Server 2008 from C# MS Access
Using SQL in C# - Cannot insert data into SQL table
visual C# - Could not Insert the data using VC# in MS Access
Add, save & retrieve data in SQL MS Access
insert data in sql 2005 from excel file through c# asp.net‎
insert data into SQL table from pre filled boxes in C# 4.0‎
insert into database unsing ado.net and C# MS Access
Insert DateTime into SQL Server using C#
Searches related to c# insert data into sql MS Access
c# insert data into sql table
c# insert data into sql server MS Access
inserting data into sql table MS Access
insert query MS Access
sql insert statement from another table
Closed Caption:

hello guys welcome once again in the
last video i have shown you how you can
open the second form when your
validation of user name and password is
connected when will you give or press
this login button so i give this
username admin and password
and when i click this it shows me first
of all user name and password is correct
and then it
the redirect us to the second form now
in this video I'm going to show you how
you can save your . ah using the second
form into your database right so let's
see how we can do it so i will go to the
second form right now it's a blank form
so what I'm going to do is I love take
three labels
one two and three in the second form and
let's see what we have in our database
and i will open this database first and
by the meantime i will add three text
boxes also here
so sort for the text boxes
one two and three and i will add our
button by using which people see why not
so let's see what we have in our
database and we open my doggies
this is our database so suppose I want
to save with some data into the database
for example right now i have 13
employees
I want to add one more employ or other
employees
14 15 with the help of for my tea shop
windows form application
so for this simple demo for saving i'm
going to use this column called first
name last name and maybe
so I'm going to say well these three
column data and rest of them will be the
same of procedure for simplicity i'm
going to take only 3 of the columns
first name last name and pain
so let's go to our home and I will
change
the text of these labels
post name
secondly boo text of the last name and
hard little bit and big
ok and i will change the name of this
text box first text box as the xt
underscore F name second xbox name as a
txt underscore order and name and third
text box name as txt underscore be okay
and i will also change the name of this
button as BTW and fund the schools feel
okay and i will also change the text of
this button as text of this button and
save . save dr.
ok so now we have these text boxes and
we have this button
so what we can do is I will just change
the font size of these so that we can
see them
select all go to ponch I 16
ok now we can see them
ok so we have a first name last name and
a column now we want to save a lot of so
i will just click the save data button
here and we go to the corner behind of
this sub
palm do so similar me as we have done
here in our first form when we have
created the connection with our first or
form to the access database we have
imported this using a you
namespace from for connecting to the
action start of the switches using
system.data thought well the DB i will
just copy this namespace and I'll go to
the board for this from - and i will
just paste this same namespace here also
using system . oledb right and i will
also create a connection in the second
form bit access database so similarly
what I have done in the first form
I've created this private 20 DB
connection is equal to Nu already weak
connection object so i will just copy
this and the same i will do it in the
second form so i will just go to this
um
forum to class and just inside this form
to class I will declare this connection
also but just private oledbconnection is
equal to no new oil DP
now i also need the connection string so
similarly what I have done in the first
form i have given this world
connection . connection string and our
connection string to the access database
I will just copy it and go to the second
poem and paste it in the constructor of
form
just below this initialize component if
you don't know how I have done that you
need to see my audio videos where I have
done all these things
ok now for example i want to open and
close the connection with the database
whatever I have done in the first video
I opened the the connection with the
database and i created a command and
then I executed it i can just copy the
score and i will also explain once again
don't go to the form ma to just select
the save data button
double click it and paste this code and
what this code is doing just its opening
the connection with the data where so
this connection is this object function
. open and then we create the command to
execute using this connection so i
created oledbcommand is going to know
you more Lady become and and then this
command connection is our connection
which we have created and then in this
line command . text this commander text
is a ready which we want to execute with
the database and for now I will be neat
disc ready and we will create are ready
new credit so i will just leave it as
the lengths just to double chords
and because we want to insert the data
in the database that this reader will be
on non credit
so when Ed be reader so this reader will
not come here
so what we are going to do is I will
show you in a moment
so in the first or in the earlier videos
i have shown you whenever you want to
select or whenever you want to execute
us select ready which will give you some
data you use execute to read so that
your doctor you can read but whenever
you want to use the insert update or
delete commands
they will not give you any data and
return so you will not will not read
anything you just need to execute the
credit so you just use this command
command . execute non-credit this is for
inserting updating and deleting data and
this
oledb data reader we don't need it
because we are not reading anything we
can just try it
command . execute non-credit right and
we will enclose this blue cord and dry
cat blog if any error chuckles that will
be attached right so i will use this and
similarly in the first video i'm showing
you how you can catch the exceptions
by using this ryan gage blogs and so if
you remember in the first video created
this code so we just copy this and paste
it to you right now I friend the
exception ago
you will see an error now we will write
the
ready to execute and to save the data in
the database so we write the credit the
credit will be in sort and what you want
to insert you want to insert into your
table so your table name is employed .
right
so I was right in sawed into my table
name which is employee doctor and then I
give what I have a problem I want to
insert to give this bracket and i'm
using the first name last name and the
columns right
so in this bracket i will write the name
of my first name last name and a column
me
this will be exactly the same as the
column name in the access database to
post name , the last name
copy and paste , the pig right so this
is the pay column name it is pain and
then just give the little Spacey and get
the right
what values you want to insert in these
three columns right
we then use
and in the bracket we will pass the
values values we are getting from these
three text boxes
one two three fine just select my first
text box
copy the name of this text box go to the
code and in the square d i will just
write
let me just to close this so we have the
space so i will write here
single coach first of all singing codes
and then in between a double quotes and
between these two plus
symbols and in here we will write our
code
this will be singing good people write
the name of bar text box for the first
name dot txt ride
so this will be like this then , i will
just copy this two pounds more ,
once again , and i just changed the
password or last name field which is
the name of my last name text boxes and
the name and the name of my be a text
box is text on the score p
ok so this quantity is like this
insert into your table name and then in
the bracket you want to give the name of
the columns in which you want to insert
the dog off so i'm inserting into first
name column last name column and P
column from my database who have been in
the name of those columns and then space
the values you want to enter into the
database so we'll use and in the bracket
just give
the values which you get from the text
boxes so first name
the sequence will be seen first name and
first name dot txt last name last name .
text then pay pay . text so it will be
like this and this is your quality and
then this pretty will be executed with
this command and if everything goes okay
I want to show some matches
so i will write
message box . show and i want to show .
are saved
ok so let's try and run the program but
first of all whenever you want to run
your program
just close your . of this or which you
have opened in this axis because you can
only make one connection with the
database
whenever you are using access database
so you need to close the access file
which you are using first right and i
will run the program and i will give the
user name and password
and and i will take this long and button
username and password is correct we
reach to the second pump and we want to
insert some data in the database
so let's insert some . off . the post
name is for example
programming like last name is knowledge
and pay for example forty dollar for
over and i will save the doctor then
click save . and you see if you see this
message . are saved
then you know that your daughter's saved
and no exception of good
now you go to your actions database
wherever your access our database
fine is you can open
sorry this is not be like this but
I will just open it and I open this
excess start of this open and you see
the new employers added here we just put
into a boy and the name is programming
and the the last name is knowledge and
the age is not the dollar for our once
again we close this database
once again i want to add some new data
so I
give programming for example 1 knowledge
one last name is program not only one
and the pay is what the five-dollar are
our save to see the exception
and what did save connection is not
closed right
we haven't closed the connection so
right now we need to close the
connection to see whenever you open the
connection you always need to close the
connection
otherwise it will give you a conflict so
just connection . closed
so this will ensure that you have closed
the connection and the now you can run
the program here
your username
password and you can just go here and
you can c programming 111 college 111
for example and three is fifteen dollar
curve of saved that I saved
open your database once again open and
open and you c programming 111 knowledge
111 and the key is fifty dollar for
power right you can also add one more
scene but they didn't give you an hour
why i will show you
- - and seventy save data that has saved
so in many cases when you open your
database in the access and whenever you
want to access the this with this also
that you get it give you an error
because access cannot make multiple
connections but because you're closing
the connection just after
opening it and the indicating your cord
and when you refresh the data you will
be able to see the starter here so it's
always a good practice to open and close
your connection
whenever you open your connection just
close your connection so that you only
have one connection at the time with the
database
so in this way you can save your data in
the database using your see shop windows
form application
I hope you have enjoyed this video
please rate comment subscribe and bye
for now

Video Length: 18:32
Uploaded By: ProgrammingKnowledge
View Count: 70,981

Related Software Products
VISUAL C# 2005 AND DATABASES
VISUAL C# 2005 AND DATABASES

Published By:
KIDware

Description:
VISUAL C# 2005 AND DATABASES is a tutorial that provides a detailed introduction to using Visual C# for accessing and maintaining databases for desktop applications. Topics covered include: database structure, database design, Visual C# 2005 project building, ADO .NET data objects (connection, data adapter, command, data table), data bound controls, proper interface design, structured query language (SQL), and database reports. Actual projects developed include a sales invoice system, a home ...


Related Videos
Connect to MySQL Database - Use Select, Insert, Update - C# C Sharp Visual Studio 2010
Connect to MySQL Database - Use Select, Insert, Update - C# C Sharp Visual Studio 2010

In this tutorial I show you how to connect to a mySQL database using C# and Visual Studio 2010. I also show you a few useful queries you can run: Select, Insert, and Update in order to use the data in the mySQL database. WEBSITE: http://www.Quack-Ware.com FORUMS http://www.Quack-Ware.com/forums/ FREE CODE SNIPPETS http://www.freecodesnippets.com hr / bClosed Caption:/b hey guys i got a few requests to ...
Video Length: 08:01
Uploaded By: QuackWare
View Count: 329,902

C# Tutorial 6:  Insert/Save data to database
C# Tutorial 6: Insert/Save data to database

How to: Insert New Records into a Database Database Access with Visual C#.NET sql server - Insert Data into database in C# How to insert Data to Ms SQL server 2008 using C#.net .net - C# insert data into SQL table Using Visual C# and SQL cannot insert data into table..‎ c# import data from text file into sql databse line by line‎ store xml in SQL Server 2008 from C# Using SQL in C# - Cannot insert data into SQL table visual C# - Could not Insert ...
Video Length: 13:48
Uploaded By: ProgrammingKnowledge
View Count: 229,941

C# MS Access Database Tutorial 2 # Create Login Form with Microsoft  Access Database
C# MS Access Database Tutorial 2 # Create Login Form with Microsoft Access Database

Login Program for C# with MS Access Database Access Login Database - Microsoft Access How To Make A MS Access Login Form How to create login form in Microsoft Access 2010, 2007 Visual C# - Login Form Tutorial Microsoft Access c# - How can I close a login form and show the main form Login Form using C# and SQL Microsoft Access C# Login Form with MS Access Login Form using c# and ms access as database..?‎ closing Login form after a successful ...
Video Length: 24:20
Uploaded By: ProgrammingKnowledge
View Count: 95,174

Form Login Visual C# Connect to a Database  SQL Server Part 1
Form Login Visual C# Connect to a Database SQL Server Part 1

Connecting to a SQL Server Express Database with C# .NET Login With Combobox
Video Length: 09:13
Uploaded By: Truong Quoc Tuan
View Count: 74,135

How to Connect to Database using C#.net sqlserver 2005
How to Connect to Database using C#.net sqlserver 2005

Using Visual Studio connect to database (sql server 2005)
Video Length: 13:04
Uploaded By: Targetj Solutions
View Count: 1,140

Copyright © 2025, Ivertech. All rights reserved.