VS 2008 Service pack 1 is needed .
Monday, December 28, 2009
Visual Studio 2005/2008/2010 Notes
1. VS 2008 does not support connecting to SQL Server 2008 initially .
Windows Server 2003 Notes
In win server 03 , some functions and services are not available after the system is installed, such as Internet Access , remote desktop , telnet and so on.
1. startup Telnet service( must be running Windows Server 2003 SP1. )
run-> cmd -> input : tlntsvr /service ( to install telnet service utility)
to do some settings: go->start -> administrative tools -> services -> found Telnet
( startup : automatic ; start service ; input telnet username and password ; OK)
Sunday, December 27, 2009
SQL Server 2008 Implementation and Maintenance (1)
1. Command-line utilities
Windows PowerShell -> SQL Server PowerShell
( Running cmdlet commands)
c:\ sqlps
PS SQLSERVER:\ get-command ( view all commands under the shell)
/*******************************************************/
use Tab key to input the complete command automatically
/*******************************************************/
PS SQLSERVER:\ get-help cmdName -detailed ( view the information about every command)
e.g. PS SQLSERVER:\get-help get-host -detailed
PS SQLSERVER:\get-help sqlserver | more ( view sql server information , more is UNIX-like command . Pipeline process is used , so that you view information page by page)
2. use stored procedure to configure SSMS(Master database)
sp_configure -> to config standard configuration parameters and advanced ones.
e.g. :
use master
go
exec sp_configure 'show advanced options' , 1 -- so that you can set advanced system parameters)
go
reconfigure
go
exec sp_configure -- to view the information of all parameters
3. View the information of database in a instance of SQL Server 08
Select name , database_id from sys.databases ;
Saturday, December 26, 2009
ADO.Net 2.0 Notes(part four)
Using Class DataSet to process data from database( offline data)
1. DataSet contains Class DataTable and Class DataRelation.
DataSet object can include more than one table . There is one relationship at least if two tables are contained in DataSet object .
2. DataTable contains DataRow , DataColumn and Constraint.
Friday, December 25, 2009
ADO.Net 2.0 Notes(part three)
Query of Database with SqlCommand class and SqlDataReader Class
1. create command
a. SqlCommand cmd = new SqlCommand()
cmd.Connection = cn; // cn is the instance of SqlConnection
cmd.CommandText = "SQL ... " ;
b. SqlCommand cmd ;
cmd = cn.createCommand() ;
cmd.CommandText = "SQL ..." ;
c. SqlCommand cmd = new SqlCommand( SQL , cn ) ;
2. SqlDataReader reader = cmd.ExecuteReader() ; ( cmd is the instance of SqlCommand class)
reader.read() ;
ADO.Net 2.0 Notes(part two)
Connection of database
SqlConnection class
-> connection string -> ConnectionStringBuilder class
1. connection pool ( about connection close() issues)
2. SqlConnection class -> create SqlCommand instance ( class SqlCommand)
SqlConnection class -> SqlTransaction
SqlConnection class -> getSchema information ( about architecture of the database )
e.g. cn.GetSchema()
2. methods of Class SqlConnection
BeginTransaction() ;
ChangeDatabase() ; --> like " use databasename" in SSMS
ADO.Net 2.0 Notes(part one)


the whole view:( Only for SQL Server 200X)
Section A :( Request of Connection )
1. Connection class ( SqlConnection, used to connect with database or data source)
Before connection , connection string is needed.
Class ConnectionStringBuilder -> connection string -> Class SqlConnection
e.g.
ConnectionStringBuilder strcon = new ConnectionStringBuilder() ;
strcon.DataSource = ...
strcon.IntegratedSecurity=True;
strcon.InitialCatalog= ...
SqlConnection cn = new SqlConnection( strcon ) ;
cn.open() ; ( or using(sqlConnection cn = new SqlConnection(strcon)){} )
...
cn.close() ;
==============
SqlConnection Class
1. ConnectionStringBuilder (create connectionString)
2. SqlTransaction Class
3. SqlDataAdapter Class
4. SqlCommand Class
===============
||
||
\/
2. Database Query( SqlCommand class and SqlDataReader , to query database or data source)
===================
SqlCommand class :
1. SqlParameter
2.SqlDataReader
===================
||
||
\/
3. Class SqlDataAdapter ( a bridge of online data and offline data )
connection -> SqlCommand->SqlDataReader ( an active connection with database )
/\
||
Class SqlDataAdapter
||
\/
Class DataSet ( Offline data manipulation )
Section B:( Offline data manipulation and processing)
1. Class DataSet
A=> Class DataTable(Class DataView) B=> Class DataColumn (Class DataRowView)
B=> Class DataRow
B=> Class Constraint
A=> Class DataRelation
Subscribe to:
Posts (Atom)