我需要得到记录集中的一条记录
private void Page_Load(object sender,EventArgs E)
{
SqlConnection myConnection =
new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
string selectCmd = "select dept_id from dept where dept_name = '"+deptname+"'";
SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd,myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds,"dept");
DataView dv= new DataView(ds.Tables["Upload_AV"]); //使用DataView?
///从这里开始我应该怎样写代码呢?
///要求判断dept_id的返回值,
///如果为空,则该数据库中不存在该记录,可以插入
///如果不为空,则该数据库中存在该记录,提示重复。
}
但是DataView我查了半天帮助也不知道怎样才能够得到该记录。