关于一个读取SQL数据库棘手的问题!求达人帮助!
错误 4
找不到类型或命名空间名称“sqlDataReader”(是否缺少 using 指令或程序集引用?) d:\My Documents\Visual Studio 2005\WebSites\WebSite6\Default.aspx.cs 35 9 d:\...\WebSite6\
这是我的原代码:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
public partial class _Default : System.Web.UI.Page
{
string zhumin = ConfigurationSettings.AppSettings[ "ConnectionString "].ToString();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
xiaozhu();
}
}
private void xiaozhu()
{
string cmdText = "select * from dbo.Employees ";
SqlConnection myConnection = new SqlConnection(zhumin);
SqlCommand myCommand = new SqlCommand(cmdText, myConnection);
myConnection.Open();
sqlDataReader dr = myCommand.ExecuteReader();
DataTable datatable = new DataTable();
datatable.Columns.Add( "EmployeeID ", typeof(int));
datatable.Columns.Add( "LastName ", typeof(nvarchar));
datatable.Columns.Add( "Address ", typeof(nvarchar));
while (dr.read())
{
DataRow row = dataTable.NewRow();
row[ "EmployeeID "] = dr[ "EmployeeID "].ToString();
row[ "LastName "] = dr[ "LastN