How do I define a data adapter?
The data adapter stores your command (query) and connection and using these connect to the database when asked, fetch the result of query and store it in the local dataset. The DataAdapter class (SqlDataAdapter, OracleDataAdapter, OleDbDataAdapter, OdbcDataAdapter) may be instantiated in three ways: 1. by supplying the command string (SQL Select command)...
What is a data reader?
The data reader is a component that reads the data from the database management system and provides it to the application. The data reader works in the connected manner; it reads a record from the DB, pass it to the application, then reads another and so ...
What is a database connection?
A database connection represents a communication channel between you application and database management system (DBMS). The application uses this connection to pass the commands and queries to the database and obtain the results of the operations from the databa...
What is a data adapter?
A data adapter is the component that exists between the local repository (dataset) and the physical database. It contains the four different commands (SELECT, INSERT, UPDATE and DELETE). It uses these commands to fetch the data from the DB and fill into the dataset and to perform updates done in the dataset to the physical database. It is the data...
What is a dataset?
A dataset is the local repository of the data used to store the tables and disconnected record set. When using disconnected architecture, all the updates are made locally to dataset and then the updates are performed to the database as a bat...
DataSet or DataReader ?
The data reader is more useful when you need to work with large number of tables, database in non-uniform pattern and you need not execute the large no. of queries on few particular table. When you need to work on fewer no. of tables and most of the time you need to execute queries on these fewer tables, you should go for the dataset. It also depends...
What's the difference between accessing data with dataset or data reader?
The dataset is generally used when you like to employ the disconnected architecture of the ADO.Net. It reads the data into the local memory buffer and perform the data operations (update, insert, delete) locally to this buffer. The data reader, on the other hand, is directly connected to the database management system. It passes all the queries to...
What does it mean by connected data access architecture of ADO.Net?
In the connected environment, it is your responsibility to open and close the database connection. You first establish the database connection, perform the interested operations to the database and when you are done, close the database connection. All the changes are done directly to the database and no local (memory) buffer is maintain...
What does it mean by disconnected data access architecture of ADO.Net?
ADO.Net introduces the concept of disconnected data architecture. In traditional data access components, you make a connection to the database system and then interact with it through SQL queries using the connection. The application stays connected to the DB system even when it is not using DB services. This commonly wastes the valuable and expensive...
Difference between value type and reference type ?
Many programming languages provide built-in data types such as integers and floating-point numbers. These are copied when they are passed in to arguments i.e. they are passed "By Value". In .NET terms, these are called Value Types". The RunTime supports two kinds of Value Types: 1 Built-in value types The .NET Framework defines built-in value types...
What is serialization in .NET and what are the ways to control serialization?
Serialization is the process of converting an object into a stream of bytes. On the other hand Deserialization is the process of creating an object from a stream of bytes. Serialization/Deserialization is used to transport or to persist objects. Serialization can be defined as the process of storing the state of an object to a storage medium. During...
ADD-INS For Microsoft - Excel using .Net
Step:1 :- CREATE THE C# PROJECT(Class lib Application)Step:2 :- Set the project properties Register for COM Interop to TRUE#region Using Directives //Using Interop servicesusing System;using System.Runtime.InteropServices;namespace NewAddInFunctionality{ [ClassInterface(ClassInterfaceType.AutoDual)] public class AddINFunctions { public...
Send Email using Gmail in ASP.Net
protected void btnSendEmail_Click(object sender, EventArgs e){ MailMessage mail = new MailMessage(); mail.To.Add("saurabhjnumca@gmail.com"); mail.To.Add("saurabh_singh_jnu06@yahoo.co.in"); mail.From = new MailAddress("sandeepjnumca@gmail.com"); mail.Subject = "HI this is a test mail for learners using .Net"; string Body = "Hi Friends, this mail...
SQL Tools(DROP , TRUNCATE)
DROP TABLE :-DROP TABLE table_nameDROP DATABASE :-DROP DATABASE database_nameTRUNCATE TABLE :-We use truncate statement if we want to delete the values of the table not the table itself. Like :-TRUNCATE TABLE table_nameDROP INDEX :-DROP INDEX table_name.index...
SQL Tools(Check , DEFAULT, CREATE INDEX)
Check :-CREATE TABLE SHIP_Orders( @O_ID INT NOT NULL, @ORDER_NAME VARCHAR(25), @ORDER_ADDRESS VARCHAR(45), CHECK(@O_ID>2))DEFAULT :-We can provide default values to the table like in the above table :-CREATE TABLE SHIP_ORDERS( @O_ID INT NOT NULL, @ORDER_NAME VARCHAR(25) DEFAULT 'SLITTING', @ORDER_ADDRESS VARCHAR(45)...
SQL Tools(Create DB, Create Table, UNION, UNION ALL, NOT NULL, UNIQUE, PRIMARY KEY, Foreign Key)
To Create Database :-CREATE DATABASE Db_NameTo Create Table :-CREATE TABLE Person( @ID INT NOT NULL, @Name VARCHAR(20), @ADDRESS VARCHAR(255) NOT NULL, @PS_NO SMALLINT, @FIRST_CHAR CHAR)if a column contains NOT NULL values then it means it does not allow the null values.Unique :- CREATE TABLE Person( @ID ...
SQL Tools( Count, MAX, MIN)
COUNT is a method which will count the total no of columns,total no of rows,total no of values.Like :-SELECT COUNT(Column_Name) FROM Table_NameThis will count total no of rows where First_Name is Saurabh.SELECT Count(*) FROM Table_Name WHERE First_Name = 'Saurabh'SELECT COUNT(First_Name) AS NoOfStudents FROM STUDENTSSTUDENTS is a Table_NameMax :-SELECT...
SQL Tools(SELECT INTO, INSERT INTO)
SQL SELECT INTO statement is used to select data from a SQL database table and to insert it to a different table at the same time.The general SQL SELECT INTO syntax looks like this:SELECT Column1, Column2, Column3, INTO Table2 FROM Table1This will create a Table2 same as Table1. SQL INSERT INTO :-1:- INSERT INTO Table1 VALUES (value1, value2, value3…)2:-...