Database connection basics
M.SarulathaAssistant ProfessorDept of CA,JJC.
ASP.Net has the ability to
work with a lot of data. The most common are Oracle and Microsoft SQL Server.
But with the rest of the database, the logic behind working with them all is
very similar.
In our example, we will
look at working with Microsoft SQL Server as our database. For learning
purposes, one can download and use Microsoft SQL Server Express Edition. This
free software is provided by Microsoft.
While working with details, the following concepts are
common to all details.
1. Connectivity - Working with data in a database, the
first obvious step is communication. Database connections usually have the
parameters specified below.
1. Database name or
Data Source - The first important parameter is the name of the data. Each
connection can work with one database at a time.
2.
Authentication Letters - The key feature that follows is 'username' and
'password'. This is used to establish a connection to the database.
3.
Optional parameters - You can specify optional limits on how .net should
handle database communication. For example, one can specify a parameter how
long a connection should last.
2. Selecting data from the database - Once the
connection is established, the data is downloaded from the database. ASP.Net
has the ability to execute a 'sql' command to select against data. The 'sql'
statement can be used to download data from a specific table in a database.
3. Data entry in the database - ASP.Net is
used to enter records in the database. The values per line that need to be
included in the database are specified in ASP.Net.
4. Updating database to the database - ASP.Net can
be used to update existing records in the database. New values can be
specified on ASP.Net for each line that needs to be updated in the database.
5. Deleting data from the database - ASP.Net can also
be used to delete records from the database. The code is written to remove a
particular line from the database.
Comments
Post a Comment