日期:2014-05-19  浏览次数:20544 次

进参问题!请高手来帮这看看!不够+分!顶这有分!
源码:
public   class   Autokan
{
public   string   KA3;
}
public   class   AutoJg
{
public   string   Jg;
}
public   class   LookedClass
{
public   static   Autokan   Saves(   string   pid   )
{
SqlConnection   con   =   showclass.datacon.AutoCon();
SqlCommand   cmd   =   new   SqlCommand( "Kan_GetList   "   +   pid,con);
con.Open();
Autokan   Kan   =   new   Autokan();
SqlDataReader   sdr   =   cmd.ExecuteReader();
if(   sdr.Read()   )
{
Kan.KA3   =   sdr[ "auto_price "].ToString();
}
sdr.Close();
con.Close();
return   Kan;
}
public   static   string   Jg()
{
SqlConnection   con   =   showclass.datacon.AutoCon();
SqlCommand   cmd   =   new   SqlCommand( "AutoPrice_JiaGe   "   +   JiaGe,con);
con.Open();
System.Text.StringBuilder   Jg   =   new   System.Text.StringBuilder();
SqlDataReader   sdr   =   cmd.ExecuteReader();
while(sdr.Read())
{
Jg.Append( " <table   cellpadding=0   cellspacing=0   class=kkkkkkkk> ");
Jg.Append( " <tr> ");
Jg.Append( " <td   width=25   align=center> <font   color=#FF8600> "+sdr[ "auto_price "].ToString()+ " </font> </td> ");
Jg.Append( " <td   width=140   align=left> "+sdr[ "autoBrand "].ToString()+sdr[ "autoType "].ToString()+ " </td> ");
Jg.Append( " </tr> ");
Jg.Append( " </table> ");
}
sdr.Close();
con.Close();
return   Jg.ToString();
}
}
存储过程:
CREATE   PROCEDURE   AutoPrice_JiaGe
@JiaGe   int
AS  
select   a.[PriceID],a.[AutoID],a.[auto_price],b.[autoBrand],b.[autoType]   from   AutoPrice   a,AutoInfo   b   where   auto_price   > @JiaGe-5   and   auto_price <@JiaGe+5   and   a.AutoID=b.AutoID
GO
======================
问:我怎样才能吧Kan.KA3   =   sdr[ "auto_price "].ToString();得来的数进参到
public   static   string   Jg()类中让他等于JiaGe它??
请大伙帮我看看吧!

------解决方案--------------------
没看懂……
------解决方案--------------------
public static string Jg()类中已经有方法取结果
JiaGe又是什么
看半天代码真痛苦,表述清楚一点嘛
------解决方案--------------------
waiting for csasp
------解决方案--------------------
帮顶了
------解决方案--------------------
帮顶了,在线关注
------解决方案--------------------
混乱啊
------解决方案--------------------
不大明白~

在Jg()中加?
JiaGe = LookedClass.Saves(pid)
------解决方案--------------------
看不懂 lz太高了
------解决方案--------------------
用拼音起的名还真不知道是什么意思,真佩服楼主