大家帮看看为什么我这个函数编译无法通过?
代码如下:
public string aa(string userid)//此处为出错行
{
string sqlstr;
sqlstr="select identified from Members where userid='"+userid+"'";
SqlConnection myconn=new SqlConnection(strconn);
SqlCommand mycmd=new SqlCommand(sqlstr,myconn);
try
{
myconn.Open();
SqlDataReader myreader=mycmd.ExecuteReader();
if(myreader.Read())
{
return myreader["identified"].ToString();
}
}
catch(System.Data.SqlClient.SqlException e)
{
throw new Exception(e.Message);
}
finally
{
myconn.Close();
mycmd.Dispose();
}
}
我想把它编译到dll文件里,但总是在这个函数的第一行出错,错误信息为:error CS0161