数据库读取问题
#region Using Directivesusing System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;
using System.Data;
#endregion
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
SqlConnection thisConnection = new SqlConnection(@"Server=(local)\sqlexpress;Integrated Security=True;" + "Database=master");
thisConnection.Open();
SqlCommand thisCommand = thisConnection.CreateCommand();
= "SELECT 姓名 from 学生档案";
SqlDataReader thisReader = thisCommand.ExecuteReader();
while (thisReader.Read())
{
Console.WriteLine("\t{0}\t{1}",thisReader["姓名"]);
}
thisReader.Close();
thisConnection.Close();
Console.Write("Program finished, press Enter/Return to continue:");
Console.ReadLine();
}
}
}
上述代码有什么问题吗?