50分!类的问题!请高手进来看看解决就给分!顶者有分不够加分!
public class aa
{
public string c1;
public string c2;
public string c3;
public string c4;
public string c5;
public string c6;
}
public static bool haha()
{
string PriceID = String.Empty;
SqlConnection con = showclass.datacon.AutoCon();
con.Open();
SqlCommand cmd = new SqlCommand( "cc_cc " + PriceID,con);
aa PV=new aa();
using(SqlDataReader sdr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
if(sdr.Read())
{
PV.c1 = sdr[ "auto_price "].ToString();
PV.c2 = sdr[ "auto_color "].ToString();
PV.c3 = sdr[ "user_dw "].ToString();
PV.c4 = sdr[ "user_tel "].ToString();
PV.c5 = sdr[ "AutoBrand "].ToString();
PV.c6 = sdr[ "AutoType "].ToString();
}
}
con.Close();
}
这个类那里写的不对!
然后在别的页面如何调用?
[解决办法]