已有的结构如下,后面的不知道如何下手了::::::::::::::CRUD,分页,定位,查找等功能怎么做呢?

郁闷中????

哪位大侠指点一下!!!!!!!!

using System;
using System.Diagnostics ;
using System.Collections ;
namespace    dhzWeb
{
 [Table("orderItem")]
 public class ORM_orderitem
 {

private int _lstId=0;
  [Column(437576597,"orderItem","int","lstId",4,0,2,10,0,true,false,"",true,false,"","")]
  public int  lstId
  {
   get { return _lstId;}
   set { _lstId=value;}
  }
  private int _proid=0;0
  [Column(437576597,"orderItem","int","proid",4,0,3,10,0,false,false,"",false,true,"proTab","proid")]
  public int  proid
  {
   get { return _proid;}
   set { _proid=value;}
  }
  private int _prosl=0;
  [Column(437576597,"orderItem","int","prosl",4,0,4,10,0,false,false,"",false,false,"","")]
  public int  prosl
  {
   get { return _prosl;}
   set { _prosl=value;}
  }
  private decimal _propri=0.0M;
  [Column(437576597,"orderItem","money","propri",8,4,5,19,4,false,false,"",false,false,"","")]
  public decimal  propri
  {
   get { return _propri;}
   set { _propri=value;}
  }
  private DateTime _lstdt=DateTime.Now;
  [Column(437576597,"orderItem","datetime","lstdt",8,3,6,23,3,false,false,"",false,false,"","")]
  public DateTime  lstdt
  {
   get { return _lstdt;}
   set { _lstdt=value;}
  }
  private string _desp="";
  [Column(437576597,"orderItem","ntext","desp",16,0,7,1073741823,0,false,true,"",false,false,"","")]
  public string  desp
  {
   get { return _desp;}
   set { _desp=value;}
  }
 }

[Table("orders")]
 public class ORM_orders
 {

private DateTime _orderDt=DateTime.Now;
  [Column(405576483,"orders","datetime","orderDt",8,3,2,23,3,false,false,"",false,false,"","")]
  public DateTime  orderDt
  {
   get { return _orderDt;}
   set { _orderDt=value;}
  }
  private byte _orderSt=0;
  [Column(405576483,"orders","tinyint","orderSt",1,0,3,3,0,false,false,"",false,false,"","")]
  public byte  orderSt
  {
   get { return _orderSt;}
   set { _orderSt=value;}
  }
  private int _userId=0;
  [Column(405576483,"orders","int","userId",4,0,4,10,0,false,false,"",false,true,"user","userid")]
  public int  userId
  {
   get { return _userId;}
   set { _userId=value;}
  }
 }

[Table("proTab")]
 public class ORM_protab
 {

private string _proName="";
  [Column(373576369,"proTab","varchar","proName",50,0,2,50,0,false,false,"名称",false,false,"","")]
  public string  proName
  {
   get { return _proName;}
   set { _proName=value;}
  }
  private int _proSL=0;
  [Column(373576369,"proTab","int","proSL",4,0,3,10,0,false,false,"数量",false,false,"","")]
  public int  proSL
  {
   get { return _proSL;}
   set { _proSL=value;}
  }
  private decimal _proPrice=0.0M;
  [Column(373576369,"proTab","money","proPrice",8,4,4,19,4,false,false,"价格",false,false,"","")]
  public decimal  proPrice
  {
   get { return _proPrice;}
   set { _proPrice=value;}
  }
  private bool _proSt=false;
  [Column(373576369,"proTab","bit","proSt",1,0,5,1,0,false,false,"状态",false,false,"","")]
  public bool  proSt
  {
   get { return _proSt;}
   set { _proSt=value;}
  }
  private DateTime _proDt=DateTime.Now;
  [Column(373576369,"proTab","datetime","proDt",8,3,6,23,3,false,false,"上传时间",false,false,"","")]
  public DateTime  proDt
  {
   get { return _proDt;}
   set { _proDt=value;}
  }
  private string _proDesp="";
  [Column(373576369,"proTab","ntext","proDesp",16,0,7,1073741823,0,false,true,"说明",false,false,"","")]
  public string  proDesp
  {
   get { return _proDesp;}
   set { _proDesp=value;}
  }
 }

[Table("user")]
 public class ORM_user
 {

private string _username="";
  [Column(469576711,"user","varchar","username",50,0,2,50,0,false,true,"",false,false,"","")]
  public string  username
  {
   get { return _username;}
   set { _username=value;}
  }
  private string _userpwd="";
  [Column(469576711,"user","varchar","userpwd",50,0,3,50,0,false,true,"",false,false,"","")]
  public string  userpwd
  {
   get { return _userpwd;}
   set { _userpwd=value;}
  }
  private string _userEmail="";
  [Column(469576711,"user","varchar","userEmail",50,0,4,50,0,false,true,"",false,false,"","")]
  public string  userEmail
  {
   get { return _userEmail;}
   set { _userEmail=value;}
  }
 }

[System.AttributeUsage(System.AttributeTargets.Class)]
 public sealed class    TableAttribute:System.Attribute
 {
  public TableAttribute(string tabName)
  {
   this.tabname=tabName;
  }
  private string tabname;
  public  string  TabName
  {
   get{ return this.tabname;}
   set { this.tabname=value;}
  }
 }

/---------------以上均为自动生成的------------------/

生成代码如下:

System.IO.TextReader tr=System.IO.File.OpenText(Server.MapPath("sql.txt"));
   IDataReader dr=dhzWeb.dhzSqlCnn.ExecSql(tr.ReadToEnd ());
   tr.Close ();
   int ks=dr.FieldCount ;
   TableRow tabrow=new TableRow();
   for(int i=0;i<ks;i++)
   {
    TableCell tc=new TableCell();
    Literal li=new Literal();
    li.Text=dr.GetName(i);
    tc.Controls.Add(li);
    tabrow.Cells.Add(tc);
   }
   if(System.IO.File.Exists(Server.MapPath("ORM.cs")))
     System.IO.File.Delete(Server.MapPath("ORM.cs"));
   System.IO.StreamWriter sw=System.IO.File.CreateText(Server.MapPath("ORM.cs"));
   sw.WriteLine("using System;/r/n");
      sw.WriteLine("namespace ORM.cs/r/n");
   sw.WriteLine("{/r/n");
   string preTabName="";
   string curTabName="";
   int colCnt=dr.FieldCount ;
   System.Collections.Hashtable hstab=new Hashtable();
   
   while(dr.Read ())
   {
   
      //取表名
       curTabName=dr[0].ToString ();
    if(hstab.ContainsKey(curTabName))
    {
                       /* ColumnAttribute(Int64 id,string tabName,string dbType ,string colName,int  length ,int xscale,
         int  colid,int isprec,int isScal,bool  isident ,bool allownull,string desp,
         bool  isPrimaryKey,bool isRefKey ,string refTab ,string refTabCol)*/
     string headstr="[Column({0},/"{1}/",/"{2}/",/"{3}/",{4},{5},"
         +"{6},{7},{8},{9},{10},/"{11}/","
                     +"{12},{13},/"{14}/",/"{15}/")]";
     object[]  args=new object[]{
      dr[0],
      dr[1],
      dr[2],
      dr[3],
      dr[4],
      dr[5],
      dr[6],
      dr[7],
      dr[8],
      dr[9].ToString ()=="0"?"false":"true",
      dr[10].ToString ()=="0"?"false":"true",
      dr[11],
      dr[12].ToString ()=="0"?"false":"true",
      dr[13].ToString ()=="0"?"false":"true",
      dr[14],
      dr[15]
        };
     byte[] img=new byte[]{0};
     string  nettp=dhzWeb.dhzSqlCnn.tpConvert()[args[2].ToString ()].ToString ();
     string defstr=dhzWeb.dhzSqlCnn.vpConvert()[args[2].ToString ()].ToString ();
     string  fdname="_"+args[3].ToString ();
     
     sw.WriteLine("/t/t"+string.Format("private {0} {1}={2};",nettp,fdname,defstr));
     sw.WriteLine("/t/t"+string.Format(headstr,args));
     sw.WriteLine("/t/t"+" public "+nettp+"  "+args[3].ToString ()+" {");
     sw.WriteLine("/t/t/t"+ " get { return "+fdname+";}");
     sw.WriteLine("/t/t/t"+ " set { "+fdname+"=value;}");
     sw.WriteLine("/t/t"+" }");

}
    else
    {
     if(hstab.Count>0)
     {
      sw.WriteLine("/t}/r/n");//结束前一个
     }
     hstab.Add(curTabName,dr[1].ToString ());
     sw.WriteLine("[Table(/""+dr[1].ToString ()+"/")]");
     sw.WriteLine("/t public class ORM_"+dr[1].ToString ().ToLower ()+"{/r/n");
    }
   
   }
   dr.Close();
   sw.WriteLine("/t} /r/n");

sw.WriteLine("}/r/n");
   sw.Flush ();
   sw.Close ();

其中用SQL取表属性的语名存放在sql.txt中,其内空如下:/

select tab.id,--表编号
tabName=tab.name,--表名
dbType=type.name , --数据类型
colName=col.name,--列名
col.length,--宽度
col.xscale ,--小数位数
col.colid ,--列序数
isprec=isnull(columnproperty(tab.id,col.name,'Precision'),0),--精度
isScal=isnull(columnproperty(tab.id,col.name,'scale'),0),--小数位数
isident=COLUMNPROPERTY ( tab.id , col.name , 'IsIdentity' ) ,--是否自增
allownull=COLUMNPROPERTY ( tab.id , col.name , 'AllowsNull' ) ,--允许为空
desp=isnull((select g.value  from sysproperties g where g.id=tab.id and g.smallid=col.colid),''),--说明信息
isPrimaryKey= case sign((select count(*) From(
                          select pkname= pk.name 
      from  sysobjects pk,sysindexkeys idx
             where pk.xtype='PK' and tab.xtype='u'
             and pk.parent_obj=tab.id
             and idx.id=tab.id
         
             and col.colid=idx.colid
                                 )
                           AS T)
                        ) when 1  then 1 else 0 end ,--是否主键
isRefKey=case sign(
               ( select count(*)  from (
    select  sonId=fkeyId ,parTab=obj2.name ,ref.fkey
    from sysobjects obj ,sysforeignkeys ref,sysobjects obj2,syscolumns col,syscolumns col1
    where obj.id=ref.fkeyid
        and col.colid=fkey  and col.id=ref.fkeyid
    and obj2.id=ref.rkeyid
    and  col1.colid=rkey and col1.id=ref.rkeyid
                               
    ) as  T2  Where T2.sonId=tab.Id and T2.fkey=col.colid)
   ) when 1 then 1 else 0 end,--取值是否要引用其它表
refTab= isnull( ( select parTab  from (
    select  sonId=fkeyId ,parTab=obj2.name ,ref.fkey
    from sysobjects obj ,sysforeignkeys ref,sysobjects obj2,syscolumns col,syscolumns col1
    where obj.id=ref.fkeyid
        and col.colid=fkey  and col.id=ref.fkeyid
    and obj2.id=ref.rkeyid
    and  col1.colid=rkey and col1.id=ref.rkeyid
                               
    ) as  T2  Where T2.sonId=tab.Id and T2.fkey=col.colid),''),---引用表名
refTabCol=isnull((select parTabCol from (
     select sonId=fkeyId ,parTabCol=col1.name,ref.fkey
    from sysobjects obj ,sysforeignkeys ref,sysobjects obj2,syscolumns col,syscolumns col1
    where obj.id=ref.fkeyid
        and col.colid=fkey  and col.id=ref.fkeyid
    and obj2.id=ref.rkeyid
    and  col1.colid=rkey and col1.id=ref.rkeyid
                               
    ) as  T2  Where T2.sonId=tab.Id and T2.fkey=col.colid),'')--引有列名

from syscolumns col ,sysobjects tab ,systypes type
where tab.xtype='U' and col.id=tab.id 
and type.xusertype=col.xusertype
and tab.name<>'dtproperties'
 
order by tab.name,col.colid

///---------------另有两个辅助的方法如下:--------------------

public sealed class  dhzSqlCnn
 {
  public static  SqlConnection SqlCnn()
  {
   return new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["DBConnString"]);
  }
  public static IDataReader  ExecSql(string sql)
  {

SqlConnection cnn=dhzSqlCnn.SqlCnn ();
   cnn.Open ();
   SqlCommand cmd=cnn.CreateCommand ();
   cmd.CommandText=sql;
   SqlDataReader dr=cmd.ExecuteReader(CommandBehavior.CloseConnection );
   return dr;

}
  private  static  Hashtable  dic;
  /// <summary>
  /// SQL数据类型与.net数据类型的转化
  /// </summary>
  /// <returns></returns>
  public static   Hashtable  tpConvert()
  {
   if(dhzWeb.dhzSqlCnn.dic==null)
   {
    dhzWeb.dhzSqlCnn.dic=new Hashtable ();
    dhzWeb.dhzSqlCnn.dic.Add("bigint","Int64");
    dhzWeb.dhzSqlCnn.dic.Add("binary","byte[]");
    dhzWeb.dhzSqlCnn.dic.Add("bit","bool");
    dhzWeb.dhzSqlCnn.dic.Add("char","string");

dhzWeb.dhzSqlCnn.dic.Add("nchar","string");
                dhzWeb.dhzSqlCnn.dic.Add("varchar","string");
    dhzWeb.dhzSqlCnn.dic.Add("nvarchar","string");
    dhzWeb.dhzSqlCnn.dic.Add("datetime","DateTime");

dhzWeb.dhzSqlCnn.dic.Add("int","int");
    dhzWeb.dhzSqlCnn.dic.Add("float","double");
    dhzWeb.dhzSqlCnn.dic.Add("money","decimal");
    dhzWeb.dhzSqlCnn.dic.Add("image","byte[]");

dhzWeb.dhzSqlCnn.dic.Add("real","System.Single");
    dhzWeb.dhzSqlCnn.dic.Add("smalldatetime","datetime");
    dhzWeb.dhzSqlCnn.dic.Add("smallint","short");
    dhzWeb.dhzSqlCnn.dic.Add("smallmoney","decimal");

dhzWeb.dhzSqlCnn.dic.Add("text","string");
    dhzWeb.dhzSqlCnn.dic.Add("ntext","string");
    dhzWeb.dhzSqlCnn.dic.Add("timestamp ","byte[]");
    dhzWeb.dhzSqlCnn.dic.Add("tinyint","byte");

dhzWeb.dhzSqlCnn.dic.Add("uniqueidentifier ","Guid");
    dhzWeb.dhzSqlCnn.dic.Add("varbinary ","byte[]");
    dhzWeb.dhzSqlCnn.dic.Add("variant ","Object");
    dhzWeb.dhzSqlCnn.dic.Add("decimal","decimal");
   }
   return dhzWeb.dhzSqlCnn.dic ;
  }
  private  static  Hashtable  vic;
  /// <summary>
  ///SQL数据类型对应的默认值
  /// </summary>
  /// <returns></returns>
  public static   Hashtable  vpConvert()
  {
   if(dhzWeb.dhzSqlCnn.vic==null)
   {
    dhzWeb.dhzSqlCnn.vic=new Hashtable ();
    dhzWeb.dhzSqlCnn.vic.Add("bigint","new byte[]{0}");
    dhzWeb.dhzSqlCnn.vic.Add("binary","new byte[]{0}");
    dhzWeb.dhzSqlCnn.vic.Add("bit","false");
    dhzWeb.dhzSqlCnn.vic.Add("char","/"/"");

dhzWeb.dhzSqlCnn.vic.Add("nchar","/"/"");
    dhzWeb.dhzSqlCnn.vic.Add("varchar","/"/"");
    dhzWeb.dhzSqlCnn.vic.Add("nvarchar","/"/"");
    dhzWeb.dhzSqlCnn.vic.Add("datetime","DateTime.Now");

dhzWeb.dhzSqlCnn.vic.Add("int","0");
    dhzWeb.dhzSqlCnn.vic.Add("float","0.0");
    dhzWeb.dhzSqlCnn.vic.Add("money","0.0M");
    dhzWeb.dhzSqlCnn.vic.Add("image","new byte[]{0}");

dhzWeb.dhzSqlCnn.vic.Add("real","0.0f");
    dhzWeb.dhzSqlCnn.vic.Add("smalldatetime","DateTime.Now");
    dhzWeb.dhzSqlCnn.vic.Add("smallint","0");
    dhzWeb.dhzSqlCnn.vic.Add("smallmoney","0.0M");

dhzWeb.dhzSqlCnn.vic.Add("text","/"/"");
    dhzWeb.dhzSqlCnn.vic.Add("ntext","/"/"");
    dhzWeb.dhzSqlCnn.vic.Add("timestamp ","new byte[]{0}");
    dhzWeb.dhzSqlCnn.vic.Add("tinyint","0");
                 
    dhzWeb.dhzSqlCnn.vic.Add("uniqueidentifier ","Guid.NewGuid()");
    dhzWeb.dhzSqlCnn.vic.Add("varbinary ","new byte[]");
    dhzWeb.dhzSqlCnn.vic.Add("variant ","new object()");
    dhzWeb.dhzSqlCnn.vic.Add("decimal","0.0M");
   }
   return dhzWeb.dhzSqlCnn.vic ;
  }
  private  static  Hashtable  tic;
  /// <summary>
  /// SQL数据类型对应的ADO.net的数据类型
  /// </summary>
  /// <returns></returns>
  public static   Hashtable  adConvert()
  {
   if(dhzWeb.dhzSqlCnn.tic==null)
   {
    dhzWeb.dhzSqlCnn.tic=new Hashtable ();
    dhzWeb.dhzSqlCnn.tic.Add("bigint", SqlDbType.BigInt);
    dhzWeb.dhzSqlCnn.tic.Add("binary",SqlDbType.Binary);
    dhzWeb.dhzSqlCnn.tic.Add("bit",SqlDbType.Bit);
    dhzWeb.dhzSqlCnn.tic.Add("char",SqlDbType.Char);

dhzWeb.dhzSqlCnn.tic.Add("nchar",SqlDbType.NChar);
    dhzWeb.dhzSqlCnn.tic.Add("varchar",SqlDbType.VarChar);
    dhzWeb.dhzSqlCnn.tic.Add("nvarchar",SqlDbType.NVarChar );
    dhzWeb.dhzSqlCnn.tic.Add("datetime",SqlDbType.DateTime);

dhzWeb.dhzSqlCnn.tic.Add("int",SqlDbType.Int );
    dhzWeb.dhzSqlCnn.tic.Add("float",SqlDbType.Float );
    dhzWeb.dhzSqlCnn.tic.Add("money",SqlDbType.Money);
    dhzWeb.dhzSqlCnn.tic.Add("image",SqlDbType.Image );

dhzWeb.dhzSqlCnn.tic.Add("real",SqlDbType.Real );
    dhzWeb.dhzSqlCnn.tic.Add("smalldatetime",SqlDbType.SmallDateTime);
    dhzWeb.dhzSqlCnn.tic.Add("smallint",SqlDbType.SmallInt);
    dhzWeb.dhzSqlCnn.tic.Add("smallmoney",SqlDbType.SmallMoney);

dhzWeb.dhzSqlCnn.tic.Add("text",SqlDbType.Text);
    dhzWeb.dhzSqlCnn.tic.Add("ntext",SqlDbType.NText);
    dhzWeb.dhzSqlCnn.tic.Add("timestamp ",SqlDbType.Timestamp);
    dhzWeb.dhzSqlCnn.tic.Add("tinyint",SqlDbType.TinyInt);

dhzWeb.dhzSqlCnn.tic.Add("uniqueidentifier ",SqlDbType.UniqueIdentifier);
    dhzWeb.dhzSqlCnn.tic.Add("varbinary ",SqlDbType.VarBinary);
    dhzWeb.dhzSqlCnn.tic.Add("variant ",SqlDbType.Variant);
    dhzWeb.dhzSqlCnn.tic.Add("decimal",SqlDbType.Decimal);
   }
   return dhzWeb.dhzSqlCnn.dic ;
  }
  private static    Hashtable sufTab;
  public static   Hashtable  sufEnc()
  {
   if(dhzWeb.dhzSqlCnn.sufTab==null)
   {
    dhzWeb.dhzSqlCnn.sufTab=new Hashtable();
    dhzWeb.dhzSqlCnn.sufTab.Add("long","l");
    dhzWeb.dhzSqlCnn.sufTab.Add("decimal","M");
    dhzWeb.dhzSqlCnn.sufTab.Add("float","f");
    dhzWeb.dhzSqlCnn.sufTab.Add("double","D");

}
   return dhzWeb.dhzSqlCnn.sufTab;
  }
 }

//----------列属性定义类---------------/
/*id tabName dbType colName length xscale colid isprec isScal isident allownull desp isPrimaryKey isRefKey refTab refTabCol */
 [System.AttributeUsage(System.AttributeTargets.Property)]
 public sealed class    ColumnAttribute:System.Attribute
 {
  /// <summary>
  /// 列属性
  /// </summary>
  /// <param name="id">表ID</param>
  /// <param name="tabName">表名</param>
  /// <param name="dbType">sql数据类型</param>
  /// <param name="colName">列名</param>
  /// <param name="length">宽度</param>
  /// <param name="xscale">小数位数</param>
  /// <param name="colid">列ID</param>
  /// <param name="isprec">精度</param>
  /// <param name="isScal">小数位数</param>
  /// <param name="isident">是否自增</param>
  /// <param name="allownull">允许空</param>
  /// <param name="desp">描述</param>
  /// <param name="isPrimaryKey">主键否</param>
  /// <param name="isRefKey">外键</param>
  /// <param name="refTab">外键表</param>
  /// <param name="refTabCol">外键列</param>
  /// <param name="defval">默认值</param>
  public   ColumnAttribute(Int64 id,string tabName,string dbType ,string colName,int  length ,int xscale,
   int  colid,int isprec,int isScal,bool  isident ,bool allownull,string desp,
   bool  isPrimaryKey,bool isRefKey ,string refTab ,string refTabCol)
  {
      this.id=id;
   this.tabName=tabName;
   this.dbType=dbType;
   this.colName=colName;
   this.length=length;
   this.xscale=xscale;
   this.colid=colid;
   this.isprec=isprec;
   this.isScal=isScal;
   this.isident=isident;
   this.allownull=allownull;
   this.desp=desp;
   this.isPrimaryKey=isPrimaryKey;
   this.isRefKey=isRefKey ;
   this.refTab=refTab ;
   this.refTabCol=refTabCol;

}
  private Int64 id;
  public  Int64  ID
  {
   get{ return id;}
   
  }
  private string tabName;
  public String TabName
  {
   get{ return this.tabName ;}
   set{ this.tabName=value;}
  }
  private string dbType ;
  public String SqlType
  {
   get{ return this.dbType ;}
   set{ this.dbType=value;}
  }
  private string colName;  
  public string  ColName
  {
   get{ return this.colName;}
   set{ this.colName=value;}
  }
  private int  length ; 
  public int  Length
  {
   get{ return this.length;}
   set{ this.length=value;}
  }
  private int xscale; 
  public int XScale
  {
   get{ return this.xscale ;}
   set{ this.xscale=value;}
  }
  private int  colid;  
  public int  ColId
  {
   get{ return this.colid ;}
   set{ this.colid=value;}
  }
  private int isprec; 
  public int  IsPrec
  {
   get{ return this.isprec ;}
   set{ this.isprec=value;}
  }
  private int isScal;
  public int IsScal
  {
   get{ return this.isScal;}
   set{ this.isScal=value;}
  }
  private bool  isident ;  
  public bool  IsIdent
  {
   get{ return this.isident;}
   set{ this.isident=value;}
  }
  private bool allownull;  
  public bool  AllowNull
  {
   get{ return this.allownull ;}
   set{ this.allownull=value;}
  }
  private string desp;  
  public string Desp
  {
   get{ return this.desp ;}
   set{ this.desp=value;}
  }
  private bool  isPrimaryKey;  
  public bool  IsPrimaryKey
  {
   get{ return this.isPrimaryKey;}
   set{ this.isPrimaryKey=value;}
  }
  private bool isRefKey ;  
  public  bool  IsRefkey
  {
   get{ return this.isRefKey;}
   set{ this.isRefKey=value;}
  }
  private string refTab ;  
  public string RefTab
  {
   get{ return this.refTab ;}
   set{ this.refTab=value;}
  }
  private string refTabCol ;  
  public string  RefTabCol
  {
   get{ return this.refTabCol;}
   set{ this.refTabCol=value;}
  }
  
    
 
 }
}

可是后面的CRUD,分页等功能怎么搞呢??????????????????

???????????????????

接口??

反射是一定要的。。。。。。。。

public static object  Create(Type rowType,object[] pkArgs)
  {
  
   object item=Activator.CreateInstance(rowType,false);
   //IDataReader dr=Get
   ORM.TableAttribute[] tabn=rowType.GetCustomAttributes(typeof(ORM.TableAttribute),false) as ORM.TableAttribute[];
   if(tabn==null)
    throw new Exception("没有实现Table属性");
   string sqltab=tabn[0].TabName ;
   IDataReader dr=null;//=getDataReader by  tabName and primarykey lst;
   foreach(MemberInfo mi in rowType.GetMembers())
   {
    Console.WriteLine("Membinfo!"+mi.Name);
   
    foreach(ColumnAttribute attr in mi.GetCustomAttributes(typeof(ORM.ColumnAttribute),false))
    {
     if(mi.MemberType==MemberTypes.Property)
     {
      Console.WriteLine("p:"+attr.ColName);
      Console.WriteLine("p:"+attr.Length);
      Console.WriteLine("p:"+attr.ColId);
      ((PropertyInfo)mi).SetValue(item,dr[attr.ColName],null);
     
     }
       
    }
   }
     
   return item ;
  }

哪位指点一下??

QQ:33349170

转载于:https://www.cnblogs.com/dhz123/archive/2005/09/15/2194352.html

怎么搞一个ORM出来用用呢???迷茫中相关推荐

  1. Linus Torvalds 谈居家办公:不要在家中重新搞一个办公室

    点击上方蓝色"程序猿DD",选择"设为星标" 回复"资源"获取独家整理的学习资料! 来源 | https://www.oschina.net ...

  2. Tensorflow搞一个聊天机器人

     Tensorflow搞一个聊天机器人 catalogue 0. 前言 1. 训练语料库 2. 数据预处理 3. 词汇转向量 4. 训练 5. 聊天机器人 - 验证效果 0. 前言 不是搞机器学习 ...

  3. [react] React为什么要搞一个Hooks?

    [react] React为什么要搞一个Hooks? 动机 Hook 解决了我们五年来编写和维护成千上万的组件时遇到的各种各样看起来不相关的问题.无论你正在学习 React,或每天使用,或者更愿尝试另 ...

  4. Cocos2dx游戏开发系列笔记8:开搞一个射击游戏《战神传说》//就个打飞机的

    2019独角兽企业重金招聘Python工程师标准>>> 又是一个愉快的夜晚 还是那张长长的工作桌 哲哲在左边做一个香云纱手包 骨头在这里噼里啪啦的解刨 pad里放着<赢在中国& ...

  5. 一个大二老学长的迷茫之路

    其实很早之前就想写这篇文章了,无奈肚子里没啥墨水.今天还是想来说一下我这大学一年半的经历. 方向真的很重要! 不知道是不是因为太菜了,感觉大学的前三个学期都被我给浪费了,三个学期啊,我涉猎了计算机的许 ...

  6. 利用jvisualvm.exe搞一个关于生产者消费者的另一些纠结的问题

    在利用jvisualvm.exe搞一个关于生产者消费者的一个纠结的问题中,我们已经看到如何在生产者消费者模型中,由于队列的不安全导致消费者一直空转的情况,并通过使用线程安全的队列去解决该问题.接下来我 ...

  7. 微信小程序 搞一个天气api

    最近在搞微信小程序,突然想来搞一个天气API,来获取实时的天气.话不多说,直接开搞.. 1. 选择一个天气API 百度上随便一搜,都是天气API,但是我感觉用起来都太烦了, 无论是注册,还是说要付费, ...

  8. AGP7.0|kts 搞一个加固插件

    每次都要手动使用工具去手动加固,非常麻烦,所以自己搞一个加固插件来提高生产力 开发环境使用的AGP7.0.2 ,相比较之前的版本,改动还是蛮大的,自己也踩了不少坑. 更多AGP7.0的内容可以关注一下 ...

  9. 教你如何不花一分钱,“搞”一个网站自己玩玩

    教你如何不花一分钱,"搞"一个网站自己玩玩 1.准备一个域名 可以进这个网站里注册一个:http://dm.lu.mk/ 输入网站前缀 如果可用就点击解析 按照提示自己填 主机记录 ...

最新文章

  1. 揭秘丨“北京八分钟”里中国制造的科技力量
  2. Java 初始化顺序
  3. python 网络聊天客户端
  4. 无重复字符的最长子串【三种解法】--LeetCode
  5. iOS调用 AlipaySDK 支付宝找不到头文件openssl/rsa.h 的解决方案
  6. bzoj 1677: [Usaco2005 Jan]Sumsets 求和(DP)
  7. Android 开发工具集合 - (Android Dev Tools)
  8. nginx 启动、重启、关闭
  9. Ubuntu下hadoop2.4搭建集群(单机模式)
  10. 机器人开发--编码器
  11. linux内核零拷贝技术
  12. 网站优化后如何降低阿里云国际版服务器成本
  13. 《计算机工程》从投稿到录用之一手经验
  14. BIM模型文件下载——四层仿古别墅模型
  15. js 中实现百分比计算
  16. MacTeX使用指南
  17. itchat与微软小冰的碰撞!--微软小冰接入itchat实现微信自动回复
  18. Oracle 存储过程详解(上)
  19. java word替换图片_Java 替换word文档文字并指定位置插入图片
  20. 【安全攻防系列 Windows实战】教你如何 FTP暴力破解、四大病毒勒索病毒、蠕虫病毒、ARP病毒、挖矿病毒,怎么处理应急场景

热门文章

  1. so库调用java函数_linux下so动态库调用主程序函数
  2. 2013蓝桥杯java试题_2013年第四届蓝桥杯javaB组 试题 答案 解析
  3. JS 日期转化及日期比较
  4. Linux学习笔记:安装CentOS与Linux常用命令
  5. ps计算机按键.,计算机一级Photoshop视图操作快捷键
  6. Intel(R) 处理器产品架构/微架构对照表
  7. Pentium II Pentium III架构/微架构/流水线 (1) - 架构概述
  8. latext配置 vscode_新手关于在VScode上配置latex的事情
  9. c#时分秒毫秒微妙_C# 关于DateTime类型 精确到毫秒
  10. 域名抢注php程序_“丁真”被抢注,蹭热点这门生意,能成就好品牌?