28.3.08

Tìm hiểu về màn hình laptop

Nếu muốn mua máy tính xách tay nhưng không có nhiều kinh nghiệm về display thì những thông tin dưới đây có thể sẽ giúp ích cho bạn. Lời khuyên chung là cần tìm hiểu về điều kiện bảo hành với chấm màn hình của từng hãng.



Công nghệ được sử dụng phổ biến trong các dòng máy tính xách tay trên thị trường hiện nay là tinh thể lỏng (LCD - Liquid Crystal Display). Kích thước và độ phân giải là các yếu tố phân biệt giữa các sản phẩm. Độ phân giải trên LCD được xác định bằng các điểm chấm (pixel). Mỗi điểm được cấu thành bởi 3 chấm phụ: đỏ, xanh lá cây và xanh nước biển. 3 màu này kết hợp với nhau để tạo thành màu hoàn chỉnh cần hiển thị.

GNet Media

Ngày càng có nhiều người mua máy tính xách tay nhưng không phải ai cũng có

 
kinh nghiệm lựa chọn màn hình tốt. Ảnh: N.H.





Độ phân giải là một “thước đo” khả năng hiển thị. Ví dụ như một màn hình XGA 14.1” tiêu chuẩn sẽ có độ phân giải 1024 x 768. Trong đó, 1024 là số điểm chấm theo chiều ngang, 768 là số điểm chấm theo chiều dọc.



Với model SXGA 14.1” tiêu chuẩn thì độ phân giải là 1280 x 1024. Nếu một hình ảnh ở trên XGA có kích thước 20 x 10 pixel, thì trên SXGA, nó sẽ có kích thước tương đối nhỏ hơn, mặc dù số điểm chấm được sử dụng để hiển thị là như nhau. Điều này giúp cho SXGA hiển thị được nhiều hình ảnh hơn, tạo nên cảm giác “rộng hơn” so với XGA.



Hầu hết màn LCD hiện nay sử dụng công nghệ TFT (Thin-Film Transistor), hay còn gọi là hiển thị chủ động (active matrix display). Tên gọi này để phân biệt với hiển thị bị động (passive matrix display). Sản phẩm TFT sử dụng một bóng bán dẫn (transistor) riêng biệt tại mỗi điểm chấm phụ, được kích hoạt bởi dòng điện rất nhỏ, giúp tốc độ hiển thị màu nhanh hơn. Do đó, với màn hình hiển thị chủ động, các thay đổi về màu sắc hay hình ảnh sẽ chân thực và nhanh hơn nhiều so với các thiết bị bị động.



Nếu bóng bán dẫn nối tắt hoặc hở sẽ dẫn đến một điểm chấm không có khả năng hiển thị màu sắc bình thường, gọi là điểm chết (dead pixel) và nó có thể bị sáng, chỉ hiển thị một màu như màu đỏ, màu xanh, màu trắng hoặc mất hẳn, chỉ nhìn thấy màu đen.



Trong quá trình sản xuất, rất khó để có thể xác định một bóng bán dẫn bị hỏng hay không. Thường chỉ khi sản phẩm "đã ra lò" hoàn chỉnh người ta mới xác định được nó có điểm chết hay không. Nếu các nhà sản xuất LCD buộc phải loại bỏ thiết bị có điểm chết, dù chỉ là một điểm, chi phí chế tạo và giá bán của màn hình LCD có thể đã đội lên rất cao.



Vậy tiêu chuẩn của số điểm chết được chấp nhận với mỗi màn hình bao nhiêu là vừa? Câu hỏi này phụ thuộc vào mỗi nhà sản xuất riêng biệt. Ví dụ như với Apple, không có một câu trả lời cụ thể là bao nhiêu điểm chấm hỏng sẽ được bảo hành. Hoặc với Lenovo, số lượng này được quy định tùy theo loại màn hình được sử dụng, nhìn chung rơi vào khoảng 5 - 6 chấm.

Creating a SQL Server database programmatically using VB.NET

SQL not only let you select, add, and delete data from databases table, it also provides commands to manage databases. Using SQL statements you can create database objects programmatically such as a table, view, stored procedure, rule, index and so on. It also provides commands to alter a database and database schemas for example adding and deleting a column from a database table, adding some constraints to a column and so on. This example shows you how to create a new database table, add data to it, create a view of the data, alter database table and then delete the newly created table.


In this application, I'll create a SQL Server database, create a database table, add data to it, create database objects such as views, stored procedures, rules, and index and view data in the data grid using Sql data provider.


To test this application, create a Widows application add a data grid control and some button controls. You can even test code by adding only one button or one button for each activity. Our application form looks like Figure 1.


GNet Media

Figure 1. Creating a database and it's object application.


After adding controls, add the following variables in the beginning of the form class.


Private ConnectionString As String = "Integrated Security=SSPI;" + "Initial Catalog=;" + "Data Source=localhost;"

Private reader As SqlDataReader = Nothing

Private conn As SqlConnection = Nothing

Private cmd As SqlCommand = Nothing

Private AlterTableBtn As System.Windows.Forms.Button

Private sql As String = Nothing

Private CreateOthersBtn As System.Windows.Forms.Button

Private button1 As System.Windows.Forms.Button


First thing I'm going to do is create ExecuteSQLStmt method. This method executes a SQL statement against the SQL Sever database (mydb which I will create from my program) using Sql data providers using ExecuteNonQuery method. The ExecuteSQLStmt method is listed in Listing 1.


Private Sub ExecuteSQLStmt(ByVal sql As String)

' Open the connection

If conn.State = ConnectionState.Open Then

conn.Close()

End If

ConnectionString = "Integrated Security=SSPI;" + "Initial Catalog=mydb;" + "Data Source=localhost;"

conn.ConnectionString = ConnectionString

conn.Open()

cmd = New SqlCommand(sql, conn)

Try

cmd.ExecuteNonQuery()

Catch ae As SqlException

MessageBox.Show(ae.Message.ToString())

End Try

End Sub 'ExecuteSQLStmt


Listing 1. The ExecuteSQLStmt method.


After this I'm going to create a new SQL Server database. The CREATE DATABASE SQL statement creates a database. The syntax of CREATE DATABASE depends on the database you create. Depending on the database type, you can also set values of database size, growth and file name. Listing 2 creates a SQL Server database mydb and data files are stored in the C:\\mysql directory.


'This method creates a new SQL Server database

Private Sub CreateDBBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

' Create a connection

conn = New SqlConnection(ConnectionString)

' Open the connection

If conn.State <> ConnectionState.Open Then

conn.Open()

End If

Dim sql As String = "CREATE DATABASE mydb ON PRIMARY" + "(Name=test_data, filename = 'C:\mysql\mydb_data.mdf', size=3," + "maxsize=5, filegrowth=10%)log on" + "(name=mydbb_log, filename='C:\mysql\mydb_log.ldf',size=3," + "maxsize=20,filegrowth=1)"

ExecuteSQLStmt(sql)

End Sub 'CreateDBBtn_Click


Listing 2. Creating a SQL Server database.


Now next step is to create a table. You use CREATE TABLE SQL statement to create a table. In this statement you define the table and schema (table columns and their data types). Listing 3 creates a table myTable with four column listed in Table 1.


 



































Column Name Type Size Property
myId integer Primary Key
myName char 50 Allow Null
myAddress char 255 Allow Null
myBalance float 8 Allow Null


Table 1. New table myTable schema.


Private Sub CreateTableBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

' Open the connection

If conn.State = ConnectionState.Open Then

conn.Close()

End If

ConnectionString = "Integrated Security=SSPI;" + "Initial Catalog=mydb;" + "Data Source=localhost;"

conn.ConnectionString = ConnectionString

conn.Open()

sql = "CREATE TABLE myTable" + "(myId INTEGER CONSTRAINT PKeyMyId PRIMARY KEY," + "myName CHAR(50), myAddress CHAR(255), myBalance FLOAT)"

cmd = New SqlCommand(sql, conn)

Try

cmd.ExecuteNonQuery()

' Adding records the table

sql = "INSERT INTO myTable(myId, myName, myAddress, myBalance) " + "VALUES (1001, 'Puneet Nehra', 'A 449 Sect 19, DELHI', 23.98 ) "

cmd = New SqlCommand(sql, conn)

cmd.ExecuteNonQuery()

sql = "INSERT INTO myTable(myId, myName, myAddress, myBalance) " + "VALUES (1002, 'Anoop Singh', 'Lodi Road, DELHI', 353.64) "

cmd = New SqlCommand(sql, conn)

cmd.ExecuteNonQuery()

sql = "INSERT INTO myTable(myId, myName, myAddress, myBalance) " + "VALUES (1003, 'Rakesh M', 'Nag Chowk, Jabalpur M.P.', 43.43) "

cmd = New SqlCommand(sql, conn)

cmd.ExecuteNonQuery()

sql = "INSERT INTO myTable(myId, myName, myAddress, myBalance) " + "VALUES (1004, 'Madan Kesh', '4th Street, Lane 3, DELHI', 23.00) "

cmd = New SqlCommand(sql, conn)

cmd.ExecuteNonQuery()

Catch ae As SqlException

MessageBox.Show(ae.Message.ToString())

End Try

End Sub 'CreateTableBtn_Click 


Listing 4. Creating a database table.


As you can see from Listing 5, I also add data to the table using INSERT INTO SQL statement.


The CREATE PROCEDURE statement creates a stored procedure as you can see in Listing 10-18, I create a stored procedure myPoc which returs data result of SELECT myName and myAddress column.


Private Sub CreateSPBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

sql = "CREATE PROCEDURE myProc AS" + " SELECT myName, myAddress FROM myTable GO"

ExecuteSQLStmt(sql)

End Sub 'CreateSPBtn_Click


Listing 5. Creating a stored procedure programmatically.


Now I show you how to create views programmatically using CREATE VIEW SQL statement. As you can see from Listing 6, I create a view myView which is result of myName column rows from myTable.


Private Sub CreateViewBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

sql = "CREATE VIEW myView AS SELECT myName FROM myTable"

ExecuteSQLStmt(sql)

End Sub 'CreateViewBtn_Click


Listing 6. Creating a view using CREATE VIEW


The ALTER TABLE is a useful SQL statement if you need to change your database schema programmatically. The ALTER TABLE statement can be used to add and remove new columns to a table, changing column properties, data types and constraints. The Listing 7 show that I change the database schema of myTable by first change column data type range from 50 to 100 characters and by adding a new column newCol of TIMESTAMP type.  


Private Sub AlterTableBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

sql = "ALTER TABLE MyTable ALTER COLUMN" + "myName CHAR(100) NOT NULL"

ExecuteSQLStmt(sql)

End Sub 'AlterTableBtn_Click


Listing 7. Using ALTER TABLE to change a database schema programmatically.


The new table schema looks like Table 2. 


 









































Column Name Type Size Property
myId integer Primary Key
myName char 50 Allow Null
myAddress char 255 Allow Null
myBalance float 8 Allow Null
newCol timestamp 8 Allow Null


Table 2. MyTable after ALTER TABLE


You can also create other database object such as index, rule, and users. The code listed in Listing 8 creates one rule and index on myTable.


Note: Create Index can only create an index if you don't have an index on a table. Otherwise you will get an error message. 


Private Sub CreateOthersBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

sql = "CREATE UNIQUE CLUSTERED INDEX " + "myIdx ON myTable(myName)"

ExecuteSQLStmt(sql)

sql = "CREATE RULE myRule " + "AS @myBalance >= 32 AND @myBalance < 60"

ExecuteSQLStmt(sql)

End Sub 'CreateOthersBtn_Click


Listing 8. Creating rules and indexes using SQL statement.


The DROP TABLE command can be used to delete a table and its data permanently. The code listed in Listing 9 deletes myTable. 


Private Sub DropTableBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim sql As String = "DROP TABLE MyTable"

ExecuteSQLStmt(sql) '

End Sub 'DropTableBtn_Click


Listing 9. Deleting table using DROP TABLE.


Now next step is to view data from the table, view and stored procedure. The ViewDataBtn_Click method listed in Listing 10 shows the entire data from the table. The ViewSPBtn_Click and ViewViewBtn_Click methods view stored procedure and view data we have created earlier. As you can see using views and stored procedures work same as you use a SQL Statement. We have discussed working with Views and stored procedures in the beginning of this chapter. As you can see from Listing 10, 11, and 12, I view data from stored procedure and view.  


Private Sub ViewDataBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

'/ Open the connection

If conn.State = ConnectionState.Open Then

conn.Close()

End If

ConnectionString = "Integrated Security=SSPI;" + "Initial Catalog=mydb;" + "Data Source=localhost;"

conn.ConnectionString = ConnectionString

conn.Open()

' Create a data adapter

Dim da As New SqlDataAdapter("SELECT * FROM myTable", conn)

' Create DataSet, fill it and view in data grid

Dim ds As New DataSet("myTable")

da.Fill(ds, "myTable")

dataGrid1.DataSource = ds.Tables("myTable").DefaultView

End Sub 'ViewDataBtn_Click


Listing 10. Viewing data from a database table.



Private Sub ViewSPBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

'/ Open the connection

If conn.State = ConnectionState.Open Then

conn.Close()

End If

ConnectionString = "Integrated Security=SSPI;" + "Initial Catalog=mydb;" + "Data Source=localhost;"

conn.ConnectionString = ConnectionString

conn.Open()

' Create a data adapter

Dim da As New SqlDataAdapter("myProc", conn)

' Create DataSet, fill it and view in data grid

Dim ds As New DataSet("SP")

da.Fill(ds, "SP")

dataGrid1.DataSource = ds.DefaultViewManager

End Sub 'ViewSPBtn_Click


Listing 11.Using a stored procedure to view data from a table.


Private Sub ViewViewBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)

' Open the connection

If conn.State = ConnectionState.Open Then

conn.Close()

End If

ConnectionString = "Integrated Security=SSPI;" + "Initial Catalog=mydb;" + "Data Source=localhost;"

conn.ConnectionString = ConnectionString

conn.Open()

' Create a data adapter

Dim da As New SqlDataAdapter("SELECT * FROM myView", conn)

' Create DataSet, fill it and view in data grid

Dim ds As New DataSet

da.Fill(ds)

dataGrid1.DataSource = ds.DefaultViewManager

End Sub 'ViewViewBtn_Click


Listing 12.Using a view to view data from a table.


Finally, I create AppExit method which releases the connection and reader objects and I call them from the Dispose method as you can see in Listing 13. 


Protected Overrides Sub Dispose(ByVal disposing As Boolean)

AppExit()

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub 'Dispose

' Called when you are done with the applicaton

' Or from Close button

Private Sub AppExit()

If Not (reader Is Nothing) Then

reader.Close()

End If

If conn.State = ConnectionState.Open Then

conn.Close()

End If

End Sub 'AppExit


Listing 13. AppExit method


Summary



In this article, you saw how to create a new database and database objects including tables, stored procedures, views and alter tables. You also saw how to delete these object using SQL statements.

2.3.08

E-COMPANY (CÔNG TY ĐIỆN TỬ) MÔ HÌNH PHÁT TRIỂN CNTT CHO DOANH NGHIỆP


Tìm hiểu thông tin cơ bản về doanh nghiệp Các bước đầu tư CNTT trong doanh nghiệp Khái quát về doanh nghiệp điện tử (DNĐT) Lộ trình chuyển đổi và xây dựng DNĐT Mức độ sẵn sàng của doanh nghiệp Các chương trình trong xây dựng e-Company Lộ trình xây dựng e-Company

Tài liệu quản trị mạng máy tính,mạng LAN, mạng WAN ...



Hiện nay trên thế giới có nhiều dịch vụ dành cho việc chuyển thông tin từ khu vực này sang khu vực khác nhằm liên kết các mạng LAN của các khu vực khác nhau lại. Để có được liên kết này người ta thường sử dụng các dịch vụ của các mạng diện rộng. Hiện nay trong khi giao thức truyền thông cơ bản của LAN là Ethernet, Token Ring thì giao thức dùng để tương nối các LAN thông thường dựa trên chuẩn TCP/IP. Ngày nay khi các dạng kết nối có xu hướng ngày càng đa dạng và phân tán cho nên các mạng WAN đang thiên về truyền theo đơn vị tập tin thay vì truyền một lần xử lý

Những giải pháp CNTT cho quản lý tiền mặt, kinh doanh tiền gửi.

Ông Apurva Jain - Giám đốc kinh doanh khu vực Châu Á Thái Bình Dương - CashTech. Presentation on Remittance & Cash Management. Banking Day 2006. Bank services is becoming the hub of distribution financial chain

download