结构类型的赋值与调用问题
结构类型的赋值与调用问题
我定义了一个结构类型
public class memtype:System .Web .UI.Page
{
public struct _memtype
{
public string memtypes; //会员类型
public int xinx1; //购应信息数量
public int xinx2; //采购信息数量
public int xinx3; //代理信息数量
public int xinx4; //合作信息数量
public int xinx5; //招商信息数量
}
public memtype()
{
string sql = "select * from member_Competence where id= " + Session[ "levels "] + " ";
SqlDataReader reader = connstr.ExecuteReader(sql);
if (reader.Read())
{
_memtype me;
me.memtypes = reader[ "type "].ToString();
me.xinx1 = Convert.ToByte(reader[ "xinx1 "].ToString());
me.xinx2 = Convert.ToByte(reader[ "xinx2 "].ToString());
me.xinx3 = Convert.ToByte(reader[ "xinx3 "].ToString());
me.xinx4 = Convert.ToByte(reader[ "xinx4 "].ToString());
me.xinx5 = Convert.ToByte(reader[ "xinx5 "].ToS