chào các bạn.mình có viết một trang web page để import dữ liệu excel vào trong DB SQL server 2005.
Đây là code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;//vao webstie, chon .net, them file system.core
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;//vào website, chọn .net tab, them System.Xml.Linq
using System.Data.SqlClient;
using System.Data.OleDb;

public partial class Quan_tri_QHKH_Man_hinh_QL_TTin_SDDV_importdl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}


protected void btnUpload_Click(object sender, EventArgs e)
{
string xConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Server.MapPath("ExcelImport.xls") + ";" + "Extended Properties=Excel 8.0;";


using (OleDbConnection connection = new OleDbConnection(xConnStr))
{
OleDbCommand command = new OleDbCommand("Select * FROM [Sheet1$]", connection);

connection.Open();
// Create DbDataReader to Data Worksheetusing ()
DbDataReader dr = command.ExecuteReader();
{
// SQL Server Connection String

string sqlConnectionString = DataAcess.GetConnectionString();
// Bulk Copy to SQL Serverusing ()
SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString);
{
bulkCopy.DestinationTableName = "ConsumerGRY_CAL";

bulkCopy.WriteToServer(dr);

}

}

}
}
}
Nó báo lỗi như thế này: Error 1 The type or namespace name 'DbDataReader' could not be found (are you missing a using directive or an assembly reference?)
và lỗi:Error 2 The best overloaded method match for 'System.Data.SqlClient.SqlBulkCopy.WriteToServer(S ystem.Data.IDataReader)' has some invalid arguments

Error 3 Argument '1': cannot convert from 'DbDataReader' to 'System.Data.IDataReader'

Bạn nào biết cách sữa mấy cái lỗi này giúp mình với