Command Objects
|
Returns
|
O/p Type
|
Used
|
||
1
|
Execute Non Query
|
No Of Rows Effected
|
int
|
Insert, Update
|
|
2
|
ExecuteReader
|
SqlDataReader
|
SqlDataReader
|
Fetch Data
|
|
3
|
ExecuteScalar
|
First Col of First Row
|
int, string
|
Count(*)
|
|
4
|
SqlDataReader
|
||||
Features
|
|||||
Forward Read-only
|
|||||
Initiate only using ExecuteReader()
|
|||||
5
|
Dataset
|
||||
The DataSet represents
a complete set of data independent of actual DataSource
|
|||||
Interaction with
existing data sources is controlled through the DataAdapter
|
Thursday, 13 June 2013
Quick Reference to ADO.Net
Thursday, 28 February 2013
SQL Server Data Types and Their .NET Framework Equivalents
SQLServer datatype CLRdatatype(SQLServer) CLRdatatype(.NET Framework)
varbinary SqlBytes, SqlBinary Byte[]
binary SqlBytes, SqlBinary Byte[]
varbinary(1), binary(1) SqlBytes, SqlBinary byte, Byte[]
image None None
varchar None None
char None None
nvarchar(1), nchar(1) SqlChars, SqlString Char, String, Char[]
nvarchar SqlChars, SqlString String, Char[]
nchar SqlChars, SqlString String, Char[]
text None None
ntext None None
uniqueidentifier SqlGuid Guid
rowversion None Byte[]
bit SqlBoolean Boolean
tinyint SqlByte Byte
smallint SqlInt16 Int16
int SqlInt32 Int32
bigint SqlInt64 Int64
smallmoney SqlMoney Decimal
money SqlMoney Decimal
numeric SqlDecimal Decimal
decimal SqlDecimal Decimal
real SqlSingle Single
float SqlDouble Double
smalldatetime SqlDateTime DateTime
datetime SqlDateTime DateTime
sql_variant None Object
User-defined type(UDT) None user-defined type
table None None
cursor None None
timestamp None None
xml SqlXml None
Subscribe to:
Posts (Atom)