我的这个方法里
public string GetRS(string text2)
{
string picbody2=null;
private OleDbConnection ConBcc;//如果我设置该变量为private权限 则报错为“类、结构或接口方法必须有返回类型”类似的错误
private OleDbDataReader DtrBcc;
ConBcc=new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source="+HttpContext.Current.Server.MapPath(NInfo.ConnectionString));
OleDbCommand command2=new OleDbCommand(text2,ConBcc);
try
{
ConBcc.Open();
DtrBcc=command2.ExecuteReader(CommandBehavior.CloseConnection);
}
catch(Exception exception1)
{
DtrBcc.Close();
ConBcc.Close();
throw new Exception(exception2.ToString());
}
while(DtrBcc.Read())
{
picbody2=picbody2+"<TR><TD><a href="+DtrBcc["url"]+" target=_blank><span class=style1> ·"+DtrBcc["name"]+"</a></TD></TR>";
}
DtrBcc.Close();
ConBcc.Close();
return picbody2;
}
难道我不能给方法里的临时变量设置权限?