Ext.Net

Self-employed.
posts - 16, comments - 2, trackbacks - 0, articles - 0

2008年6月15日

 1  protected static ConfigInfo Get()
 2         {
 3             var ci = new ConfigInfo();
 4             IDataReader dr =ExecuteReader("**"null);
 5             var ht = new Hashtable();
 6             while (dr.Read())
 7             {
 8                 ht.Add(dr["name"], dr["value"]);
 9             }
10             dr.Close();
11             PropertyInfo[] p = ci.GetType().GetProperties();
12             foreach (PropertyInfo pi in p)
13             {
14                 pi.SetValue(ci, Convert.ChangeType(ht[pi.Name], pi.MemberType.GetTypeCode()), null);
15             }
16             HttpContext.Current.Trace.Warn((string) ht[""]);
17             foreach (object o in ht.Keys)
18             {
19                 HttpContext.Current.Trace.Warn((string) o);
20//http://ysoho.cnblogs.com             }
21             return ci;
22         }

posted @ 2008-06-15 07:31 Ext.Net 阅读(89) 评论(0) 编辑

select   cast('37200'   as   int)
select   convert(int,'1548877')   

其他...
Sql日期:
1 select day(getdate())
2 --当前日期[数字]
3 select month(getdate())
4 --当前月份数字
5 

posted @ 2008-06-15 04:44 Ext.Net 阅读(2289) 评论(0) 编辑

C++\CLI&C#.NET 09:32:15
建立一个对象,最先会在栈里产生一个地址.这就是我们说的引用.然后在堆里有实际的对象.用new的时候就可以把栈的地址指到堆的对象.所以不用ref也是传地址.
C++\CLI&C#.NET 09:33:45
因为c#中都是传的是栈的内容.int型直接就在栈里面了.传的就是它本生的一个副本.

=========From Msdn==========
引用类型的变量不直接包含其数据;它包含的是对其数据的引用。当通过值传递引用类型的参数时,有可能更改引用所指向的数据,如某类成员的值。但是无法更改引用本身的值;也就是说,不能使用相同的引用为新类分配内存并使之在块外保持。若要这样做,应使用 refout 关键字传递参数。

试图将参数重新分配到不同的内存位置时,该操作仅在方法内有效,并不影响原始变量

PS:要改变传递值 就 ref

posted @ 2008-06-15 00:03 Ext.Net 阅读(126) 评论(0) 编辑