??xml version="1.0" encoding="utf-8" standalone="yes"?>辽宁福彩快乐12:BlogJava - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/zh-cnSat, 15 Dec 2018 21:19:55 GMTSat, 15 Dec 2018 21:19:55 GMT60Sqoop&Hive,解决ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly. - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/433143.htmlKeKeTue, 03 Apr 2018 08:56:00 GMT//www.ot7t.com.cn/keweibo/articles/433143.html//www.ot7t.com.cn/keweibo/comments/433143.html//www.ot7t.com.cn/keweibo/articles/433143.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/433143.html//www.ot7t.com.cn/keweibo/services/trackbacks/433143.html?$SQOOP_HOME/lib目录下执行以下命?br />
ln -s  /app/soft/apache-hive-2.3.2-bin/lib/hive-exec-2.3.2.jar   hive-exec-2.3.2.jar


Ke 2018-04-03 16:56 发表评论
]]>
时间列转?amp;&动态指定分区Insert数据 - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/433141.htmlKeKeMon, 02 Apr 2018 08:47:00 GMT//www.ot7t.com.cn/keweibo/articles/433141.html//www.ot7t.com.cn/keweibo/comments/433141.html//www.ot7t.com.cn/keweibo/articles/433141.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/433141.html//www.ot7t.com.cn/keweibo/services/trackbacks/433141.html--然后再Insert表,动态指定分?br />
insert overwrite table partition_user_table partition (dt) select id, account, name, create_time,  from_unixtime(unix_timestamp(create_time,'yyyy/mm/dd'),'yyyymmdd') as dt from external_user_table;


Ke 2018-04-02 16:47 发表评论
]]>
hadoop或hbase集群重启失效节点 - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/433135.htmlKeKeFri, 30 Mar 2018 02:44:00 GMT//www.ot7t.com.cn/keweibo/articles/433135.html//www.ot7t.com.cn/keweibo/comments/433135.html//www.ot7t.com.cn/keweibo/articles/433135.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/433135.html//www.ot7t.com.cn/keweibo/services/trackbacks/433135.html有时候hadoop或hbase集群运行时间久了后,某些节点就会失效,这个时候如果不想重启整个集群(这种情况在很多情况下已经不被允许),这个时候可以单独重启失效节点?/span>
HADOOP?br style="box-sizing: border-box;" />
hadoop中重启单节点的方法和增加新节点其实是一样的?/div>
重启或添加节?/strong>

$bin/hadoop-daemon.sh start datanode 
当然,添加的话需要copy配置文件到新节点。重启的话先  $bin/hadoop-daemon.sh stop datanode

重新balancer(可?
$bin/hadoop balancer
其实集群自己会balancer,当然也可以像上面那样手动balancer,不然在繁忙时段最好避免?/span>

HBASE?/strong>
重启
$bin/hbase-daemon.sh stop regionserver
$bin/hbase-daemon.sh start regionserver

也可以添加新的master(默认只有一个master),
$bin/hbase-daemon.sh start master


Ke 2018-03-30 10:44 发表评论
]]>windows下使用IDEA开?spark SQL例子报IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/433116.htmlKeKeWed, 21 Mar 2018 03:31:00 GMT//www.ot7t.com.cn/keweibo/articles/433116.html//www.ot7t.com.cn/keweibo/comments/433116.html//www.ot7t.com.cn/keweibo/articles/433116.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/433116.html//www.ot7t.com.cn/keweibo/services/trackbacks/433116.html
public class FirstSparkSql {
public static void main(String[] args) {


String masterMode = "local";//spark://master:7077

SparkConf conf = new SparkConf();
//conf.set("spark.executor.memory", "1024m");
conf.setAppName("First Spark SQL");
conf.setMaster(masterMode);
//解决异常?/span>IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI
conf.set("spark.sql.warehouse.dir","D:\\temp_files");

JavaSparkContext sc = new JavaSparkContext(conf);

SparkSession spark = SparkSession.builder().config(conf).getOrCreate();
Dataset<Row> df = spark.read().json("hdfs://master:9000/user/spark/input/persons.txt");
df.show();
sc.stop();
}
}


Ke 2018-03-21 11:31 发表评论
]]>
ORA-54033 要修改的列由某个虚拟表达式使?/title><link>//www.ot7t.com.cn/keweibo/articles/427353.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 16 Sep 2015 06:30:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/427353.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/427353.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/427353.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/427353.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/427353.html</trackback:ping><description><![CDATA[<em style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 14px/21px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; float: left; letter-spacing: normal; color: rgb(153,153,153); word-spacing: 0px; -webkit-text-stroke-width: 0px">原文</em><span style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; display: inline !important; font: 14px/21px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; float: none; letter-spacing: normal; color: rgb(153,153,153); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <span class="Apple-converted-space"> </span></span><a style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; text-overflow: ellipsis; display: inline-block; font: 14px/21px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; max-width: 69%; white-space: nowrap; letter-spacing: normal; color: rgb(51,51,51); overflow: hidden; word-spacing: 0px; text-decoration: none; -webkit-text-stroke-width: 0px; transition: 0.25s; -webkit-transition: 0.25s" class="cut cut70" >//blogs.oracle.com/sql/entry/ora_54033_and_the_hidden</a><br /><br /> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">A colleague recently asked me a question:</p> <address style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; display: block; font: 16px/1.5em 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; margin-bottom: 1.5em; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">"I'm modifying the data type of a column. When doing so I get the following error:</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">ORA-54033: column to be modified is used in a virtual column expression</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">But there's no virtual columns defined on the table! What on earth's going on?!"</p></address> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">This was exceptionally confusing. Looking at the table definition we couldn't see any virtual columns defined: </p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 0.75em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="sql"><span class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">create</span> <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">table</span> tab ( x <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">integer</span>, y <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">date</span>, z varchar2(<span style="color: rgb(0,153,153)" class="number">30</span>) );</span></pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Sure enough, when we tried to change the data type of y we got the exception:</p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 1.5em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="prettyprint sql"><span class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">alter</span> <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">table</span> tab modify (y <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">timestamp</span>);</span> ORA-54033: column to be modified is used in a virtual column expression</pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">How could this be? </p> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Perhaps there was a column defined that we couldn't see. Querying user_tab_cols revealed something interesting:</p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 1.5em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="prettyprint sql"><span class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">select</span> column_name, data_default, hidden_column <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">from</span> user_tab_cols <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">where</span> table_name = <span style="color: rgb(221,17,68)" class="string">'TAB'</span>;</span> COLUMN_NAME <span style="white-space: pre"> </span>DATA_DEFAULT <span style="white-space: pre"> </span>HID <span style="font-style: italic; color: rgb(153,153,136)" class="comment">------------------------------ <span style="white-space: pre"> </span>----------------------------- ---</span> SYS_STUYPW88OE302TFVBNC6$MMQXE<span style="white-space: pre"> </span>SYS_OP_COMBINED_HASH("X","Y")<span style="white-space: pre"> </span>YES Z<span style="white-space: pre"> </span> NO Y<span style="white-space: pre"> </span>NO X<span style="white-space: pre"> </span>NO</pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">The SYS_... column isn't in the table DDL! Where does it come from? And what's SYS_OP_COMBINED_HASH all about? Has someone been mucking around with the database?</p> <div style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">The SYS_ prefix is a sign that the column is system generated. So something's happened that's caused Oracle to create this on our behalf.</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">SYS_OP_COMBINED_HASH is an undocumented feature. The name implies Oracle is merging the arguments together to form a hash.</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">Is there a feature where we want to capture information about a group of columns?</p></div> <div style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">Indeed there is -extended statistics!This feature enables to Oracle calculate statistics on a group of columns. It uses this information to improve row estimates. This is useful when there's a correlation between the values of two (or more) columns in a table.</p> <p style="line-height: 1.7em; text-indent: 1em; margin: 0px 0px 0.75em; font-size: 16px">Someone had created extended stats on this table for (x, y).</p></div> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Now we've identified the problem, how do we get around it?</p> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Simple: drop and recreate the extended stats:</p><pre style="border-bottom: 1px solid; border-left: 1px solid; padding-bottom: 0.3em; overflow-y: auto; text-transform: none; background-color: rgb(246,246,246); text-indent: 0px; margin: 0px 0px 1.5em; padding-left: 0.3em; padding-right: 0.3em; display: block; font: 12px/1.5em Monaco, Menlo, Consolas, 'Courier New', monospace; word-wrap: break-word; white-space: pre-wrap; letter-spacing: normal; color: rgb(51,51,51); word-break: break-all; border-top: 1px solid; border-right: 1px solid; word-spacing: 0px; padding-top: 0.3em; -webkit-text-stroke-width: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px" class="prettyprint sql">exec dbms_stats.drop_extended_stats(user, 'tab', '(x, y)'); <span class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">alter</span> <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">table</span> tab modify (y <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">timestamp</span>);</span> <span class="operator"><span style="color: rgb(51,51,51); font-weight: bold" class="keyword">select</span> dbms_stats.create_extended_stats(<span style="color: rgb(51,51,51); font-weight: bold" class="keyword">user</span>, <span style="color: rgb(221,17,68)" class="string">'tab'</span>, <span style="color: rgb(221,17,68)" class="string">'(x, y)'</span>) <span style="color: rgb(51,51,51); font-weight: bold" class="keyword">from</span> dual;</span> DBMS_STATS.CREATE_EXTENDED_STATS(USER,'TAB','(X,Y)') <span style="font-style: italic; color: rgb(153,153,136)" class="comment">--------------------------------------------------------------------------------</span> SYS_STUYPW88OE302TFVBNC6$MMQXE </pre> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Success!</p> <p style="text-transform: none; background-color: rgb(254,254,254); text-indent: 1em; margin: 0px 0px 0.75em; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">Extended stats are a great way to improve the optimizer's row estimates. If you need to create these, I recommend you also do the following:</p> <div style="text-transform: none; background-color: rgb(254,254,254); text-indent: 0px; font: 16px/27px 'Helvetica Neue', Helvetica, Tahoma, Arial, STXihei, 'Microsoft YaHei', 微软雅黑, sans-serif; white-space: normal; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"> <ul style="padding-bottom: 0px; line-height: 1.7em; list-style-type: none; margin: 0px 0px 0.75em 25px; padding-left: 0px; padding-right: 0px; font-size: 16px; padding-top: 0px"><li style="line-height: 1.7em; list-style-type: disc; font-size: 16px">Apply the extended stats to all environments</li><li style="line-height: 1.7em; list-style-type: disc; font-size: 16px">Put a comment on the columns explaining what you've done, e.g. </li> <ul style="padding-bottom: 0px; line-height: 1.7em; list-style-type: none; margin: 0px 0px 0px 25px; padding-left: 0px; padding-right: 0px; font-size: 16px; padding-top: 0px"><li style="line-height: 1.7em; list-style-type: disc; font-size: 16px">comment on column tab.x is 'part of extended stats. To modify data type drop and recreate stats';</li></ul></ul>These actions will help prevent future developers getting stuck tracking down the cause of "missing" virtual columns!</div><img src ="//www.ot7t.com.cn/keweibo/aggbug/427353.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2015-09-16 14:30 <a href="//www.ot7t.com.cn/keweibo/articles/427353.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JQuery EasyUI combobox动态添加option(? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/418124.htmlKeKeSat, 20 Sep 2014 07:59:00 GMT//www.ot7t.com.cn/keweibo/articles/418124.html//www.ot7t.com.cn/keweibo/comments/418124.html//www.ot7t.com.cn/keweibo/articles/418124.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/418124.html//www.ot7t.com.cn/keweibo/services/trackbacks/418124.html
<input class="easyui-combobox" id="rwlb" name="rwlb" style="width:435px" data-options="valueField:'id', textField:'text', panelHeight:'auto'" >  

方法一?/p>

1 var data, json;
2 json = '[{"id":"年计?,"text":"年计?,"selected":true}]';
3 data = $.parseJSON(json);
4 $("#rwlb").combobox("loadData", data);

方法二:

1 var data,json;
2 data = [];
3 data.push({ "text": "测试", "id": 100 });
4 $("#rwlb").combobox("loadData", data);
转自?a >//www.cnblogs.com/easypass/archive/2012/12/29/2838329.html

Ke 2014-09-20 15:59 发表评论
]]>
转:Easyui Tree方法扩展 - getLevel(获取节点级别) - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/417899.htmlKeKeSat, 13 Sep 2014 08:12:00 GMT//www.ot7t.com.cn/keweibo/articles/417899.html//www.ot7t.com.cn/keweibo/comments/417899.html//www.ot7t.com.cn/keweibo/articles/417899.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/417899.html//www.ot7t.com.cn/keweibo/services/trackbacks/417899.html//www.jeasyuicn.com/the-extended---easyui-tree-method-getlevel-access-node-level.html


Easyui Tree一直就没有提供这个方法,以前没有用到,所以一直没怎么在意,这次自己用到?顺便扩展了一个方?分享给大?

1 $.extend($.fn.tree.methods, {
2     getLevel:function(jq,target){
3         var l = $(target).parentsUntil("ul.tree","ul");
4         return l.length+1;
5     }
6 });
用法:
1 var node = $().tree("getSelected");
2 var lv =  $().tree("getLevel",node.target);


Ke 2014-09-13 16:12 发表评论
]]>
oracle 十进制与十六进制的转?/title><link>//www.ot7t.com.cn/keweibo/articles/416374.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 30 Jul 2014 09:35:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/416374.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/416374.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/416374.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/416374.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/416374.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; font: 13px/20px georgia, verdana, Arial, helvetica, sans-seriff; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(75,75,75); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">十进制与十六进制的转?br />8i以上版本?/p> <p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; font: 13px/20px georgia, verdana, Arial, helvetica, sans-seriff; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(75,75,75); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">十进?->十六进制 <br />select to_char(100,'XX') from dual;</p> <p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; font: 13px/20px georgia, verdana, Arial, helvetica, sans-seriff; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(75,75,75); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">十六进制-->十进?br />select to_number('7D','XX') from dual;</p><br /><span style="color: red">其中XX为格式,注意XX的位数不能小?/span>传入的参数?br /><img src ="//www.ot7t.com.cn/keweibo/aggbug/416374.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2014-07-30 17:35 <a href="//www.ot7t.com.cn/keweibo/articles/416374.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaScript中实现函数重载和参数默认?? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/416152.htmlKeKeThu, 24 Jul 2014 01:22:00 GMT//www.ot7t.com.cn/keweibo/articles/416152.html//www.ot7t.com.cn/keweibo/comments/416152.html//www.ot7t.com.cn/keweibo/articles/416152.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/416152.html//www.ot7t.com.cn/keweibo/services/trackbacks/416152.html转自?a >//www.2cto.com/kf/201208/149413.html

参数默认值是指在调用函数时,若省略了某个实参,函数会自动为该参数分配一个默认值,使得函数调用的方便性和灵活性大大提高?/p>

举个例子,比?a style="color: rgb(51,51,51); font-size: 14px; text-decoration: none" class="keylink" target="_blank">PHP中的字符串截取函数substr(string,start,length),当不指定length时,函数将默认截取字符串中start位置到字符串结束,而如果指定了length,则截取从start位置开始的以length为长度的字符串,所以如果调用的是substr('//www.hualai.net.cn',11,6),则返回的是hualai;如果省略掉最后一个参数,substr('//www.hualai.net.cn',11),则返回hualai.net.cn?/p>

再比如jQuery框架中,$(selector).html()方法是获取该元素内的HTML代码,?(selector).html(content)则是设置该元素内的HTML。我们知道,在C语言中,我们可以通过如下形式来为函数参数设置默认值:

[cpp] 
void foo(int a, int b = 1, bool c = false);   
?a style="color: rgb(51,51,51); font-size: 14px; text-decoration: none" class="keylink" target="_blank">Java中,则可以通过函数重载来设置函数参数默认值:

[java]
public void foo(int a){   
    foo(a, 1);   
}   
public void foo(int a, int b){   
    foo(a, b, false);   
}   
public void foo(int a, int b, bool c){   
    //函数内容   
}   
而在JavaScript中,如何像jQuery那样设置函数参数默认值呢?JavaScript中并没有像C语言中定义函数时直接在参数后面赋值的方法,也没有像Java里那样的函数重载,但我们可以通过JavaScript方法中的一个arguments只读变量数组来实现,具体如下?/p>

[js] 
function foo(){   
    var a = arguments[0] ? arguments[0] : 1;   
    var b = arguments[1] ? arguments[1] : false;   
    //函数内容   
}   
以上是通过判断参数是否存在,若不存在则将默认值附给变量,而我们可以通过判断参数的类型来实现重载?/p>

[js] 
function foo(){   
    if(typeof arguments[0] == 'string')    
        alert('参数类型为字符串');    
    else if(typeof arguments[0] == 'number')    
        alert('参数类型为数?);    
}   
或者:

[js] 
function foo(){   
    if(arguments[0].constructor == String)    
        alert('参数类型为字符串');    
    else if(arguments[0].constructor == Number)    
        alert('参数类型为数?);    
}   



Ke 2014-07-24 09:22 发表评论
]]>
SQL Server 2005中的CTE递归查询得到一棵树 (? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/415936.htmlKeKeThu, 17 Jul 2014 06:46:00 GMT//www.ot7t.com.cn/keweibo/articles/415936.html//www.ot7t.com.cn/keweibo/comments/415936.html//www.ot7t.com.cn/keweibo/articles/415936.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/415936.html//www.ot7t.com.cn/keweibo/services/trackbacks/415936.html//blog.csdn.net/bin_520_yan/article/details/5998349

感觉这个CTE递归查询蛮好用的,先举个例子?/p>

 

  1. use City;  
  2. go  
  3. create table Tree  
  4. (  
  5.   ID int identity(1,1) primary key not null,  
  6.   Name varchar(20) not null,  
  7.   Parent varchar(20) null  
  8. )  
  9. go  
  10. insert Tree values('大学',null)  
  11. insert Tree values('学院','大学')  
  12. insert Tree values('计算机学?,'学院')  
  13. insert Tree values('网络工程','计算机学?)  
  14. insert Tree values('信息管理','计算机学?)  
  15. insert Tree values('电信学院','学院')  
  16. insert Tree values('教务?,'大学')  
  17. insert Tree values('材料?,'教务?)  
  18. insert Tree values('招生?,'大学')  
  19. go  
  20. with CTE as  
  21. (  
  22. -->Begin 一个定位点成员  
  23.  select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,0 as Levle from Tree where Parent is null  
  24. -->End   
  25. union all  
  26. -->Begin一个递归成员  
  27.  select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  28.         from Tree inner join CTE  
  29.         on Tree.Parent=CTE.Name  
  30. -->End  
  31. )  
  32. select * from CTE order by ID  
  33. --1.?nbsp;CTE 表达式拆分为定位点成员和递归成员?nbsp; 
  34. --2.运行定位点成员,创建第一个调用或基准结果?nbsp;(T0)?nbsp; 
  35. --3.运行递归成员,将 Ti 作为输入(这里只有一条记?,将 Ti+1 作为输出?nbsp; 
  36. --4.重复步骤 3,直到返回空集?nbsp; 
  37. --5.返回结果集。这是对 T0 ?nbsp;Tn 执行 UNION ALL 的结果?nbsp; 

 

上面的SQL语句再次插入一条数据:

insert Tree values('网络1?,'网络工程')

     运行结果如下图:

? 运行结果

     注意点:貌似在递归成员处所选择的字段都必须Tree表的数据,而不能是CTE结果集中的除了Tree中没有而CTE中有的字段在这里才可以引用,比如字段TE?/p>

    首先看下,遍历的?条记录的SQL语句?/p>

  1. select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,0 as Levle from Tree where Parent is null  

 

   获取的结果为?/p>

   Name  Parent   TE    Levle

-------------------------------------

     大学    NULL   大学     0

   递归?次所获取的结果集合的类SQL语句为:

  1. select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  2. from Tree inner join  
  3.    (select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,0 as Levle from Tree where Parent is null)  
  4. as CTE  
  5. on Tree.Parent=CTE.Name  

 

   上面的CTE子查询的结果就是第一次递归查询的结果集,上面SQL运行结果为:

   同样的,将第二次递归查询的上面三条记录作为第三次查询?#8216;定位成员’?/p>

  【这里要注意,上面的三条记录是从最后一条开始依次作为第三次递归的输入的,即第一条是ID=9的记录,接下来是7?,关于第四次递归也类似?/p>

   第三次递归类SQL语句

  1. select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  2. from Tree inner join  
  3. (第二次递归查询的SQL语句)as CTE  
  4. on Tree.Parent=CTE.Name  

 

   结果如下?/p>

其实每次递归的类SQL可为如下所示:

  1. select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,Levle+1 as Levle  
  2. from Tree inner join  
  3. (上次递归查询的结果集,仅仅是上次那一次的,而不是以前的总和结果?  
  4. as CTE  
  5. on Tree.Parent=CTE.Name  

 

 第四次递归一次类推,最后所查询的结果为上面所有递归的union?/p>

 续:在上面的SQ语句查询结果中,ID?0的记录应该要放在ID?的后面?/p>

 往数据表中再次添加两条记录?/p>

insert Tree values('计科','计算机学?)
insert Tree values('?,'网络1?) 

再次修改上面的SQL语句?/p>

  1. with CTE as    
  2. (     
  3. -->Begin 一个定位点成员     
  4.  select ID, Name,Parent,cast(Name as nvarchar(max)) as TE,  
  5.         ROW_NUMBER()over(order by getdate()) as OrderID  
  6.         --最关键是上面这个字段,要获取排序字段,按字符串来排序?nbsp; 
  7.         --其中窗口函数必须要使用order by,但是不能用整型,那就用时间?nbsp; 
  8.         from Tree where Parent is null    
  9. -->End      
  10. union all     
  11. -->Begin一个递归成员     
  12.  select Tree.ID, Tree.Name,Tree.Parent,cast(replicate(' ',len(CTE.TE))+'|_'+Tree.name as nvarchar(MAX)) as TE,  
  13.         CTE.OrderID*100+ROW_NUMBER()over(Order by GETDATE()) as OrderID  
  14.         from Tree inner join CTE     
  15.         on Tree.Parent=CTE.Name     
  16. -->End     
  17. )     
  18. select * from CTE  
  19. order by LTRIM(OrderID)--最后将这个整型数据转换为字符串型的进行排序  
  20.   
  21. --有时候整型可以比大小,字符串也可以,字符串比的大小是一位一位进行字符比较的  
  22. --整型+字符?=整型,只有字符串+字符?=两个字符串的并和  
  23. --递归查询中:第二条记录可以引用第一条记录的?nbsp; 
  24. --动态加载记录时,同一个等级的记录识别符:RowNumber()over(order by getdate())  
  25. --延伸:可以动态获取某个部门下的所以子部门。也可以获取该部门上级的所以部?nbsp; 
  26.   
  27. --总结:首先要拼凑出一个整型数据,然后转换为字符串,最后是进行字符串的order,而不是整型数据的order?nbsp; 

 

最后的结果为:

? 运行结果

这样,无论用户插入多少条记录都可以进行按部门,按规律进行查询?/p>

Ke 2014-07-17 14:46 发表评论
]]>
DataTable更新数据操作(? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/415278.htmlKeKeMon, 30 Jun 2014 07:49:00 GMT//www.ot7t.com.cn/keweibo/articles/415278.html//www.ot7t.com.cn/keweibo/comments/415278.html//www.ot7t.com.cn/keweibo/articles/415278.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/415278.html//www.ot7t.com.cn/keweibo/services/trackbacks/415278.html

BLL?nbsp;     

  public void Update(DataTable dt)
        {
            foreach (DataRow dr in dt.Rows)
            {
                if (dr.RowState == DataRowState.Deleted)
                    continue;
                if (dr.RowState == DataRowState.Modified || dr.RowState == DataRowState.Added)
                {
                    if (dr["usr_id"] == DBNull.Value)
                    {
                        throw new Exception("用户代码不能为空");
                    }                }
            }

            dal.Update(dt);
        }

       

DAL?/p>

 public void Update(DataTable dt)
        {
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlConnection conn = new SqlConnection(SqlHelper.ConnectionString);
            conn.Open();

            adapter.InsertCommand = new SqlCommand("INSERT INTO dbo.t6( com_id ,usr_id ) VALUES( @com_id ,@usr_id)", conn);
            adapter.InsertCommand.CommandType = CommandType.Text;
            adapter.InsertCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
            adapter.InsertCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");

            adapter.UpdateCommand = new SqlCommand("update t6 setwhereand usr_id", conn);
            adapter.UpdateCommand.CommandType = CommandType.Text;
            adapter.UpdateCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
            adapter.UpdateCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");
            adapter.UpdateCommand.Parameters.Add("@usr_id1", SqlDbType.VarChar, 8, "usr_id");
            adapter.UpdateCommand.Parameters["@usr_id1"].SourceVersion = DataRowVersion.Original;

            adapter.DeleteCommand = new SqlCommand("delete from t6 whereand usr_id", conn);
            adapter.DeleteCommand.CommandType = CommandType.Text;
            adapter.DeleteCommand.Parameters.Add("@com_id", SqlDbType.VarChar, 4, "com_id");
            adapter.DeleteCommand.Parameters.Add("@usr_id", SqlDbType.VarChar, 8, "usr_id");

            adapter.DeleteCommand.Parameters["@com_id"].SourceVersion = DataRowVersion.Original;
            adapter.DeleteCommand.Parameters["@usr_id"].SourceVersion = DataRowVersion.Original;

            adapter.Update(dt);
        }

 

前台

    public partial class DataTableUpdate : Form
    {

        public BLL.Users Bu = new BLL.Users();
        public DataTable dtUsr = new DataTable();
        public MOD.Users modObject = new MOD.Users();

        public string _UserId = "";

        public DataTableUpdate()
        {
            InitializeComponent();
            dataGridView1.AutoGenerateColumns = false;
        }

//窗口加载

        private void Form1_Load(object sender, EventArgs e)
        {
            dtUsr = Bu.GetList();
            dataGridView1.DataSource = dtUsr;
            BindValue();
        }

        private void BindValue()
        {
            tb_com_id.DataBindings.Add("Text", dataGridView1.DataSource, "com_id");
            tb_UsrId.DataBindings.Add("Text", dataGridView1.DataSource, "usr_id");

            //手动修改可以; 代码赋值需要用下面这句?br />            tb_UsrId.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
        }

        private void 保存_Click(object sender, EventArgs e)
        {
            foreach (DataRow dr in dtUsr.Rows)
            {
                dr.EndEdit();
            }
            try
            {
                Bu.Update(dtUsr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            MessageBox.Show("保存成功?, "系统提示");
        }

        private void 删除_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("您确认要删除用户? + tb_UsrName.Text.Trim()+" ?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                return;

            if (dataGridView1.CurrentCell == null)
                return;

            try
            {
                dataGridView1.Rows.Remove(dataGridView1.CurrentRow);
                Bu.Update(dtUsr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
            MessageBox.Show("删除成功?, "系统提示");
           
        }

        private void 增加_Click(object sender, EventArgs e)
        {
            DataRow dr = dtUsr.NewRow();
            dr["usr_id"] = _UserId;
            dtUsr.Rows.Add(dr);
            dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
        }

        private void 取消_Click(object sender, EventArgs e)
        {
            dtUsr.RejectChanges();
        }
牛铁?a style="color: rgb(63,167,203); text-decoration: underline" >//blog.csdn.net/fangxinggood/archive/2008/04/18/2304047.aspx



Ke 2014-06-30 15:49 发表评论
]]>
在数据表(DataTable)中操作数?? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/415272.htmlKeKeMon, 30 Jun 2014 03:08:00 GMT//www.ot7t.com.cn/keweibo/articles/415272.html//www.ot7t.com.cn/keweibo/comments/415272.html//www.ot7t.com.cn/keweibo/articles/415272.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/415272.html//www.ot7t.com.cn/keweibo/services/trackbacks/415272.html转自?a >//blog.csdn.net/cui55/article/details/1371411

?span class="Apple-converted-space"> DataSet 中创?span class="Apple-converted-space"> DataTable 之后,您执行的活动可以与使用数据库中的表时执行的活动相同。您可以添加、查看、编辑和删除表中的数据;可以监视错误和事件;并且可以查询表中的数据。在修改 DataTable 中的数据时,您也可以验证更改是否正确,并决定是否以编程方式接受更改或拒绝更改?/p>

本节内容

将数据添至表?/font>:说明如何创建新行并将其添至表中?/p>
在创?span class="Apple-converted-space"> DataTable 并使用列和约束定义其结构之后,您可以将新的数据行添至表中。要添加新行,可将一个新变量声明?span class="Apple-converted-space"> DataRow 类型。调?span class="Apple-converted-space"> NewRow 方法时,将返回新?span class="Apple-converted-space"> DataRow 对象。然后,DataTable 会根据表的结构按 DataColumnCollection 的定义创?span class="Apple-converted-space"> DataRow 对象?

以下示例演示了如何通过调用 NewRow 方法来创建新行?/p>

DataRow workRow = workTable.NewRow();

然后您可以使用索引或列名来操作新添加的行,如下例所示?/p>

workRow["CustLName"] = "Smith";
workRow[1] = "Smith";

在将数据插入新行后,Add 方法可用于将行添?span class="Apple-converted-space"> DataRowCollection,如以下代码所示?/p>

workTable.Rows.Add(workRow);

您也可以通过传入值的数组(类型化?span class="Apple-converted-space"> Object),调用 Add 方法来添加新行,如下例所示?/p>

workTable.Rows.Add(new Object[] {1, "Smith"});

将类型化?span class="Apple-converted-space"> Object 的值的数组传递到 Add 方法,可在表内创建新行并将其列值设置为对象数组中的值。请注意,数组中的值会根据它们在表中出现的顺序相继与各列匹配?/p>

以下示例将十行添至新建的 Customers 表中?/p>

DataRow workRow;

for (int i = 0; i <= 9; i++) 
{
  workRow = workTable.NewRow();
  workRow[0] = i;
  workRow[1] = "CustName" + i.ToString();
  workTable.Rows.Add(workRow);
}

查看表中数据:说明如何访问行中的数据,包括数据的原始版本和当前版本?/p>
可以使用 DataTable ?span class="Apple-converted-space"> Rows ?span class="Apple-converted-space"> Columns 集合来访?span class="Apple-converted-space"> DataTable 中的内容。也可以根据包括搜索标准、排序顺序和行状态等特定标准,使?span class="Apple-converted-space"> DataTable.Select 方法返回 DataTable 中数据的子集。此外,用主键值搜索特定行时,还可使用 DataRowCollection ?span class="Apple-converted-space"> Find 方法?

DataTable 对象?span class="Apple-converted-space"> Select 方法返回一组与指定条件匹配?span class="Apple-converted-space"> DataRow 对象?strong>Select 采用筛选表达式、排序表达式?span class="Apple-converted-space"> DataViewRowState 的可选参数。筛选表达式根据 DataColumn 值(例如 LastName = 'Smith'。排序表达式遵循用于为列排序的标?SQL 约定,例?span class="Apple-converted-space"> LastName ASC, FirstName ASC。有关编写表达式的规则,请参?strong>DataColumn 类的 Expression 属性?/p>

提示 如果您将?span class="Apple-converted-space"> DataTable ?span class="Apple-converted-space"> Select 方法执行多次调用,可通过先为 DataTable 创建 DataView来提高性能。创?span class="Apple-converted-space"> DataView 会为表中的行编制索引。然后,Select 方法会使用该索引,这样将显著缩短生成查询结果的时间。有关为 DataTable 创建 DataView 的信息,请参?a style="color: rgb(51,102,153); text-decoration: none" >创建和使?DataView?/blockquote>

Select 方法基于 DataViewRowState 确定要查看或操作的行的版本。下表说明了可能?span class="Apple-converted-space"> DataViewRowState 枚举值?/p>

成员名称 说明
CurrentRows 当前行,包括未更改的行、已添加的行和已修改的行?/td>
Deleted 已删除的行?/td>
ModifiedCurrent 当前版本,它是原始数据的修改版本(请参阅ModifiedOriginal)?/td>
ModifiedOriginal 所有已修改行的原始版本。使?span class="Apple-converted-space"> ModifiedCurrent 时,当前版本可用?/td>
Added 新行?/td>
None 无?/td>
OriginalRows 原始行,包括未更改的行和已删除的行?/td>
Unchanged 未更改的行?/td>

在下面的示例中,DataSet 对象已经过筛选,这样,您可以只使用其 DataViewRowState 设置?span class="Apple-converted-space"> CurrentRows的行?/p>

DataRow[] currRows = workTable.Select(null, null, DataViewRowState.CurrentRows);

if (currRows.Length < 1 )
  Console.WriteLine("No Current Rows Found");
else
{
  foreach (DataColumn myCol in workTable.Columns)
    Console.Write("/t{0}", myCol.ColumnName);

  Console.WriteLine("/tRowState");

  foreach (DataRow myRow in currRows)
  {
    foreach (DataColumn myCol in workTable.Columns)
      Console.Write("/t{0}", myRow[myCol]);

    Console.WriteLine("/t" + myRow.RowState);
  }
}

Select 方法可用于返回具有不?span class="Apple-converted-space"> RowState 值或字段值的行。以下示例返回一个引用所有已删除行的 DataRow数组,并返回另一个引用所有已排序行(按照 CustLName 排序,其?span class="Apple-converted-space"> CustID 列大?5)的 DataRow 数组?/p>

// Retrieve all deleted rows.
DataRow[] delRows = workTable.Select(null, null, DataViewRowState.Deleted);

// Retrieve rows where CustID > 5, and order by CustLName.
DataRow[] custRows = workTable.Select("CustID > 5", "CustLName ASC");

编辑表中的数?/font>:说明如何修改行中的数据,包括挂起对行的更改,直至验证并接受了建议的更改?/p>
当您?span class="Apple-converted-space"> DataRow 中更改列值时,所做更改会立即置于行的 Current 状态中。然后,RowState 会设置为Modified,并使用 DataRow ?span class="Apple-converted-space"> AcceptChanges ?span class="Apple-converted-space"> RejectChanges 方法来接受或拒绝所做更改?strong>DataRow还提供了三种可用于在编辑行时将行的状态挂起的方法。这些方法是 BeginEdit?strong>EndEdit ?span class="Apple-converted-space"> CancelEdit?

当您直接?span class="Apple-converted-space"> DataRow 中修改列值时?strong>DataRow 会使?span class="Apple-converted-space"> Current?strong>Default ?span class="Apple-converted-space"> Original 行版本来管理列值。除这些行版本以外,BeginEdit?strong>EndEdit ?span class="Apple-converted-space"> CancelEdit 方法还使用第四个行版本:Proposed?/p>

在执行编辑操作(通过调用 BeginEdit 开始,并且通过使用 EndEdit ?span class="Apple-converted-space"> CancelEdit 或者通过调用AcceptChanges ?span class="Apple-converted-space"> RejectChanges 结束)的过程中,Proposed 行版本会存在?/p>

在编辑操作过程中,您可以通过计算 DataTable ?span class="Apple-converted-space"> ColumnChanged 事件中的 ProposedValue 来将验证逻辑应用于各列?strong>ColumnChanged 事件保存 DataColumnChangeEventArgs,可保持对正在更改的列和ProposedValue 的引用。计算了建议值后,可以对其进行修改或取消编辑。编辑结束时,行?span class="Apple-converted-space"> Proposed 状态中移出?/p>

您可以通过调用 EndEdit 来确认编辑,也可以通过调用 CancelEdit 来取消编辑。请注意,尽?span class="Apple-converted-space"> EndEdit 确实已确认您所做的编辑,但在调?span class="Apple-converted-space"> AcceptChanges 之前?strong>DataSet 并没有实际接受更改。另外请注意,如果在EndEdit ?span class="Apple-converted-space"> CancelEdit 编辑结束之前调用 AcceptChanges,编辑将会终止,并接?span class="Apple-converted-space"> Current ?span class="Apple-converted-space"> Original 行版本的 Proposed 行值。调?span class="Apple-converted-space"> RejectChanges 会以同样的方式结束编辑,并放?span class="Apple-converted-space"> Current ?span class="Apple-converted-space"> Proposed 行版本。在调用 AcceptChanges ?span class="Apple-converted-space"> RejectChanges 之后调用 EndEdit ?span class="Apple-converted-space"> CancelEdit 不会起作用,因为编辑已经结束?/p>

以下示例演示了如何将 BeginEdit ?span class="Apple-converted-space"> EndEdit ?span class="Apple-converted-space"> CancelEdit 一起使用。本示例也会检?span class="Apple-converted-space"> ColumnChanged 事件中的 ProposedValue,并决定是否取消编辑?/p>

DataTable  workTable  = new DataTable();
workTable.Columns.Add("LastName", typeof(String));

workTable.ColumnChanged += new DataColumnChangeEventHandler(OnColumnChanged);

DataRow workRow = workTable.NewRow();
workRow[0] = "Smith";
workTable.Rows.Add(workRow);

workRow.BeginEdit();
// Causes the ColumnChanged event to write a message and cancel the edit.
workRow[0] = "";     
workRow.EndEdit();

// Displays "Smith, New".
Console.WriteLine("{0}, {1}", workRow[0], workRow.RowState);  


protected static void OnColumnChanged(Object sender, DataColumnChangeEventArgs args)
{
  if (args.Column.ColumnName == "LastName")
    if (args.ProposedValue.ToString() == "")
    {
      Console.WriteLine("Last Name cannot be blank. Edit canceled.");
      args.Row.CancelEdit();
    }
}

行状态与行版?/font>:提供有关行的不同状态的信息?/p>
ADO.NET 用行状态和版本管理表中的行。行状态表示行的状态。当修改行时,行版本会维护存储于行中的值,包括当前值、原始值和默认值。例如,修改了某行中的一列后,该行会有一?span class="Apple-converted-space"> Modified 的行状态,并且会存在两个行版本?strong>Current(包含当前行值)?span class="Apple-converted-space"> Original(包含修改该列前的行值)?

每个 DataRow 对象都具?span class="Apple-converted-space"> RowState 属性,您可以检查此属性来确定行的当前状态。下表给出了对各RowState 枚举值的简要说明?/p>

RowState 说明
Unchanged 自上次调?span class="Apple-converted-space"> AcceptChanges 之后,或?span class="Apple-converted-space"> DataAdapter.Fill 创建了行之后,未做出过任何更改?/td>
Added 已将行添至表中,但尚未调?span class="Apple-converted-space"> AcceptChanges?/td>
Modified 已更改了行的一些元素?/td>
Deleted 已将该行从表中删除,并且尚未调用 AcceptChanges?/td>
Detached 对于已经创建但不属于任何 DataRowCollection 的行,设置为 Detached。新建行?span class="Apple-converted-space"> RowState设置?span class="Apple-converted-space"> Detached。通过调用 Add 方法将新?span class="Apple-converted-space"> DataRow 添至 DataRowCollection 之后?strong>RowState 属性的值设置为 Added?

对于已经使用 Remove 方法(或是在使用 Delete 方法之后使用?span class="Apple-converted-space"> AcceptChanges 方法)从DataRowCollection 中移除的行,也设置为 Detached?/p>

?span class="Apple-converted-space"> DataSet?strong>DataTable ?span class="Apple-converted-space"> DataRow 上调?span class="Apple-converted-space"> AcceptChanges 时,会移除行状态为 Deleted 的所有行。剩余的行会被赋?span class="Apple-converted-space"> Unchanged 行状态,并且 Original 行版本中的值会改写?span class="Apple-converted-space"> Current 行版本值。调?strong>RejectChanges 时,会移除行状态为 Added 的所有行。剩余的行会被赋?span class="Apple-converted-space"> Unchanged 的行状态,并且Current 行版本中的值会改写?span class="Apple-converted-space"> Original 行版本值?/p>

通过用列引用来传?span class="Apple-converted-space"> DataRowVersion 参数,您可以查看行的不同行版本,如下例所示?/p>

DataRow custRow = custTable.Rows[0];
string custID = custRow["CustomerID", DataRowVersion.Original].ToString();

下表给出了各 DataRowVersion 枚举值的简要说明?/p>

DataRowVersion 说明
Current 行的当前值。如果是?span class="Apple-converted-space"> Deleted ?span class="Apple-converted-space"> RowState 的行,则不存在此行版本?/td>
Default 特定行的默认行版本?strong>Added?strong>Modified ?span class="Apple-converted-space"> Unchanged 行的默认行版本是Current?strong>Deleted 行的默认行版本是 Original?strong>Detached 行的默认行版本是 Proposed?/td>
Original 行的原始值。如果是?span class="Apple-converted-space"> Added ?span class="Apple-converted-space"> RowState 的行,则不存在此行版本?/td>
Proposed 行的建议值。在对行进行编辑操作期间,或对于不属?span class="Apple-converted-space"> DataRowCollection 的行,存在此行版本?/td>

通过调用 HasVersion 方法并将 DataRowVersion 作为参数传递,您可以测?span class="Apple-converted-space"> DataRow 是否具有特定的行版本。例如,在调?span class="Apple-converted-space"> AcceptChanges 之前?code class="ce">DataRow.HasVersion(DataRowVersion.Original) 对新添加的行将返?span class="Apple-converted-space"> false?/p>

例如,以下代码示例显示了表中所有已删除行的值。已删除的行没有 Current 行版本,因此在访问列值时必须传?span class="Apple-converted-space"> DataRowVersion.Original?/p>

DataTable catTable = catDS.Tables["Categories"];

DataRow[] delRows = catTable.Select(null, null, DataViewRowState.Deleted);

Console.WriteLine("Deleted rows:/n");

foreach (DataColumn catCol in catTable.Columns)
  Console.Write(catCol.ColumnName + "/t");
Console.WriteLine();

foreach (DataRow delRow in delRows)
{
  foreach (DataColumn catCol in catTable.Columns)
    Console.Write(delRow[catCol, DataRowVersion.Original] + "/t");
  Console.WriteLine();
}

从表中删除行:说明如何从表中移除行?/p>
用于?span class="Apple-converted-space"> DataTable 对象中删?span class="Apple-converted-space"> DataRow 对象的方法有两种?strong>DataRowCollection 对象?span class="Apple-converted-space"> Remove 方法?strong>DataRow 对象?span class="Apple-converted-space"> Delete 方法?strong>Remove 方法?span class="Apple-converted-space"> DataRowCollection 中删?span class="Apple-converted-space"> DataRow,?span class="Apple-converted-space"> Delete 方法只将行标记为删除。当应用程序调用 AcceptChanges 方法时,才会发生实际的删除。通过使用 Delete,您可以在实际删除之前先以编程方式检查哪些行标记为删除。如果将行标记为删除,其 RowState 属性会设置?span class="Apple-converted-space"> Deleted?

在将 DataSet ?span class="Apple-converted-space"> DataTable ?span class="Apple-converted-space"> DataAdapter 和关系型数据源一起使用时,用 DataRow ?span class="Apple-converted-space"> Delete 方法移除行?strong>Delete 方法只是?span class="Apple-converted-space"> DataSet ?span class="Apple-converted-space"> DataTable 中将行标记为 Deleted,而不会移除它。?span class="Apple-converted-space"> DataAdapter 在遇到标记为 Deleted 的行时,会执行其 DeleteCommand 以在数据源中删除该行。然后,就可以用AcceptChanges 方法永久移除该行。如果使?span class="Apple-converted-space"> Remove 删除该行,则该行将从表中完全移除,但DataAdapter 不会在数据源中删除该行?/p>

DataRowCollection ?span class="Apple-converted-space"> Remove 方法采用 DataRow 作为参数,并将其从集合中移除,如下例所示?/p>

workTable.Rows.Remove(workRow);

作为对比,以下示例演示了如何调用 DataRow 上的 Delete 方法来将?span class="Apple-converted-space"> RowState 改为 Deleted?/p>

workRow.Delete();

如果将行标记为删除,并且调用 DataTable 对象?span class="Apple-converted-space"> AcceptChanges 方法,该行就会从 DataTable 中移除。相比之下,如果调用 RejectChanges,行?span class="Apple-converted-space"> RowState 就会恢复到被标记?span class="Apple-converted-space"> Deleted 之前的状态?/p>

注意 如果 DataRow ?span class="Apple-converted-space"> RowState ?span class="Apple-converted-space"> Added,则意味着已将其添至表中,然后将其标记?strong>Deleted,从表中移除?/blockquote>

添加和读取行错误信息:说明如何按行插入错误信息,以用于解决有关应用程序内行中数据的问题?/p>
为了避免在编?span class="Apple-converted-space"> DataTable 中的值时每次发生行错误都必须响应,可将错误信息添至行中,以便以后使用?strong>DataRow 对象通过对各行提?span class="Apple-converted-space"> RowError 属性来支持此功能。将数据添至 DataRow ?span class="Apple-converted-space"> RowError 属性会?strong>DataRow ?span class="Apple-converted-space"> HasErrors 属性标记为 true。如?span class="Apple-converted-space"> DataRow ?span class="Apple-converted-space"> DataTable 的组成部分,?span class="Apple-converted-space"> DataRow.HasErrors?span class="Apple-converted-space"> true,则 DataTable.HasErrors 属性也?span class="Apple-converted-space"> true。这也适用?span class="Apple-converted-space"> DataTable 所属的 DataSet。为错误做测试时,可以检?span class="Apple-converted-space"> HasErrors 属性以确定错误信息是否已添至所有行。如?span class="Apple-converted-space"> HasErrors ?span class="Apple-converted-space"> true,则可使?span class="Apple-converted-space"> DataTable ?strong>GetErrors 方法以便只返回和检查有错误的行,如下例所示?

DataTable  workTable = new DataTable("Customers");
workTable.Columns.Add("CustID", typeof(Int32));
workTable.Columns.Add("Total", typeof(Double));

workTable.RowChanged += new DataRowChangeEventHandler(OnRowChanged);

for (int i = 0; i < 10; i++)
  workTable.Rows.Add(new Object[] {i, i*100});

if (workTable.HasErrors)
{
  Console.WriteLine("Errors In Table " + workTable.TableName);

  foreach (DataRow myRow in workTable.GetErrors())
  {
    Console.WriteLine("CustID = " + myRow["CustID"]);
    Console.WriteLine(" Error = " + myRow.RowError + "/n");
  }
}

protected static void OnRowChanged(Object sender, DataRowChangeEventArgs args)
{
  // Check for zero values.
  if (args.Row["Total"].Equals(0D))
    args.Row.RowError = "Total cannot be 0.";
}

接受或拒绝对行的更改:说明如何接受或拒绝对行的更改?/p>
在检验过?span class="Apple-converted-space"> DataTable 中的数据所做更改的准确性之后,可使?span class="Apple-converted-space"> DataRow?strong>DataTable ?span class="Apple-converted-space"> DataSet ?strong>AcceptChanges 方法来接受更改,此方法会?span class="Apple-converted-space"> Current 行值设置为 Original 值,并会?span class="Apple-converted-space"> RowState 属性设置为 Unchanged。接受或拒绝更改会清除所?span class="Apple-converted-space"> RowError 信息,并?span class="Apple-converted-space"> HasErrors 属性设置为 false。接受或拒绝更改还可以影响在数据源中更新数据。有关更多信息,请参?a style="color: rgb(51,102,153); text-decoration: none" >使用 DataAdapter ?DataSet 更新数据?/a>?

如果 DataTable 上存在外键约束,使用 AcceptChanges ?span class="Apple-converted-space"> RejectChanges 接受或拒绝的更改就会根据ForeignKeyConstraint.AcceptRejectRule 传播?span class="Apple-converted-space"> DataRow 的子行?/p>

以下示例检查有错误的行,在适用之处解决错误,拒绝无法解决错误的行。请注意,对于解决的错误?strong>RowError值会重置为空字符串,导致?span class="Apple-converted-space"> HasErrors 属性设置为 false。当解决或拒绝了所有的有错误的行时,就会调?strong>AcceptChanges 来接受对整个 DataTable 的所有更改?/p>

if (workTable.HasErrors)
{

  foreach (DataRow errRow in workTable.GetErrors())
  {
    if (errRow.RowError == "Total cannot exceed 1000.")
    {
      errRow["Total"] = 1000;
      errRow.RowError = "";    // Clear the error.
    }
    else
      errRow.RejectChanges();
  }
}

workTable.AcceptChanges();

处理 DataTable 事件:提供可用?span class="Apple-converted-space"> DataTable 的事件的相关信息,包括修改列值和添加或删除行时的事件?/p>
DataTable 对象提供一系列可由应用程序处理的事件。下表说明了 DataTable 事件?
事件 说明
ColumnChanged 在值已成功插入列时发生?/td>
ColumnChanging 在已提交列值时发生?/td>
RowChanged 在已成功编辑表中的行后发生?/td>
RowChanging 当正在更改表中的行时发生?/td>
RowDeleted 在表中的某行已被标记?span class="Apple-converted-space"> Deleted 之后发生?/td>
RowDeleting 在表中的某行被标记为 Deleted 之前发生?/td>

以下示例创建 4 个事件:OnColumnChanged?strong>OnColumnChanging?strong>OnRowChanged ?strong>OnRowChanging。这些事件中的每一个都在列或行更改时发生?/p>

workTable.ColumnChanged  += new DataColumnChangeEventHandler(OnColumnChanged);
workTable.ColumnChanging += new DataColumnChangeEventHandler(OnColumnChanging);
workTable.RowChanged     += new DataRowChangeEventHandler(OnRowChanged);
workTable.RowChanging    += new DataRowChangeEventHandler(OnRowChanging);

protected static void OnColumnChanged(object sender, DataColumnChangeEventArgs args)
{
  Console.Write(" ColumnChanged: ");
  Console.Write(args.Column.ColumnName + " changed to '" + args.ProposedValue + "'/n");
}

protected static void OnColumnChanging(object sender, DataColumnChangeEventArgs args)
{
  Console.Write("ColumnChanging: ");
  Console.Write(args.Column.ColumnName + " equals '" + args.Row[args.Column] + 
                    "', changing to '" + args.ProposedValue + "'/n");    
}

protected static void OnRowChanging(object sender, DataRowChangeEventArgs args)
{
  if (args.Action != DataRowAction.Nothing)
    Console.WriteLine("   RowChanging: Action = " + args.Action + ", CustID = " + args.Row["CustID"]);
}

protected static void OnRowChanged(object sender, DataRowChangeEventArgs args)
{
  if (args.Action != DataRowAction.Nothing)
    Console.WriteLine("    RowChanged: Action = " + args.Action + ", CustID = " + args.Row["CustID"]);
}



Ke 2014-06-30 11:08 发表评论
]]>
SQL Server 2000 Split 自定义函?/title><link>//www.ot7t.com.cn/keweibo/articles/406147.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Fri, 08 Nov 2013 08:57:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/406147.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/406147.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/406147.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/406147.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/406147.html</trackback:ping><description><![CDATA[<div class="yibqv">/****** Object: Function [dbo].[F_SQLSERVER_SPLIT]   Script Date: 2013-10-30 16:21:46 ******/</div><div class="yibqv">USE [ZBP];</div><div class="yibqv">GO</div><div class="yibqv">SET ANSI_NULLS OFF;</div><div class="yibqv">GO</div><div class="yibqv">SET QUOTED_IDENTIFIER ON;</div><div class="yibqv">GO</div><div class="yibqv">CREATE FUNCTION [dbo].[F_SQLSERVER_SPLIT](@Long_str varchar(8000),@split_str varchar(100))    </div><div class="yibqv">RETURNS  @tmp TABLE(        </div><div class="yibqv">    ID          inT     IDENTITY PRIMARY KEY,      </div><div class="yibqv">    short_str   varchar(8000)    </div><div class="yibqv">)    </div><div class="yibqv">AS   </div><div class="yibqv">BEGIN   </div><div class="yibqv">    DECLARE @long_str_Tmp varchar(8000),@short_str varchar(8000),@split_str_length int   </div><div class="yibqv">    SET @split_str_length = LEN(@split_str)    </div><div class="yibqv">    IF CHARINDEX(@split_str,@Long_str)=1 </div><div class="yibqv">         SET @long_str_Tmp=SUBSTRING(@Long_str,@split_str_length+1,LEN(@Long_str)-@split_str_length)</div><div class="yibqv">    ELSE</div><div class="yibqv">         SET @long_str_Tmp=@Long_str</div><div class="yibqv">    IF CHARINDEX(REVERSE(@split_str),REVERSE(@long_str_Tmp))>1    </div><div class="yibqv">        SET @long_str_Tmp=@long_str_Tmp+@split_str    </div><div class="yibqv">    ELSE   </div><div class="yibqv">        SET @long_str_Tmp=@long_str_Tmp    </div><div class="yibqv">    IF CHARINDEX(@split_str,@long_str_Tmp)=0</div><div class="yibqv">        Insert INTO @tmp select @long_str_Tmp </div><div class="yibqv">    ELSE</div><div class="yibqv">        BEGIN</div><div class="yibqv">            WHILE CHARINDEX(@split_str,@long_str_Tmp)>0    </div><div class="yibqv">                BEGIN   </div><div class="yibqv">                    SET @short_str=SUBSTRING(@long_str_Tmp,1,CHARINDEX(@split_str,@long_str_Tmp)-1)    </div><div class="yibqv">                    DECLARE @long_str_Tmp_LEN INT,@split_str_Position_END int   </div><div class="yibqv">                    SET @long_str_Tmp_LEN = LEN(@long_str_Tmp)    </div><div class="yibqv">                    SET @split_str_Position_END = LEN(@short_str)+@split_str_length    </div><div class="yibqv">                    SET @long_str_Tmp=REVERSE(SUBSTRING(REVERSE(@long_str_Tmp),1,@long_str_Tmp_LEN-@split_str_Position_END))</div><div class="yibqv">                    IF @short_str<>'' Insert INTO @tmp select @short_str    </div><div class="yibqv">                END           </div><div class="yibqv">        END</div><div class="yibqv">    RETURN     </div><div class="yibqv">END</div><div class="yibqv">GO</div><div class="yibqv"></div><img src ="//www.ot7t.com.cn/keweibo/aggbug/406147.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2013-11-08 16:57 <a href="//www.ot7t.com.cn/keweibo/articles/406147.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL Server 2000 十六进制与十进制互转(收藏) - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/406146.htmlKeKeFri, 08 Nov 2013 08:54:00 GMT//www.ot7t.com.cn/keweibo/articles/406146.html//www.ot7t.com.cn/keweibo/comments/406146.html//www.ot7t.com.cn/keweibo/articles/406146.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/406146.html//www.ot7t.com.cn/keweibo/services/trackbacks/406146.html十进制转十六进制
/****** Object: Function [dbo].[IntToHex]   Script Date: 2013-10-30 16:22:15 ******/
USE [ZBP];
GO
SET ANSI_NULLS OFF;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE FUNCTION [dbo].[IntToHex]
(@IntNum bigint)
RETURNS varchar(16)
AS
BEGIN
declare @Mods bigint, @res varchar(16)
set @res=''
while @IntNum <> 0
begin
set @Mods = @IntNum % 16
if @Mods > 9
set @res = Char(Ascii('A')+@Mods-10)+@res
else
set @res = Cast(@Mods as varchar(4))+@res
set @IntNum = @IntNum/16
end
return @res
END
GO
十六进制转十进制
/****** Object: Function [dbo].[HexToInt]   Script Date: 2013-10-30 16:22:04 ******/
USE [ZBP];
GO
SET ANSI_NULLS OFF;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE FUNCTION [dbo].[HexToInt]
(@hex varchar(100))
RETURNS int
AS
BEGIN
Declare @result bigint,@iPos int,@iTmp bigint,@iLoop int,@tmp varchar(16)
    Set @tmp = '0123456789ABCDEF'
    Select @result = 0,@iPos = 0
    While @iPos <   Len(@hex)
    Begin
          Set  @iTmp = 
               CharIndex(substring(@hex,Len(@hex) - @iPos,1),@tmp)-1
          Set @iLoop = 1
          While @iLoop <= @iPos and @iTmp > 0
          begin
              Set @iTmp = @iTmp * 16
              Set @iLoop = @iLoop + 1
          end
          Set @result = @result + @iTmp
          Set @iLoop = @iLoop + 1     
          Set @iPos = @iPos + 1
    End
    return @result
END
GO


Ke 2013-11-08 16:54 发表评论
]]>
存储过程递归调用?游标的使用注意事? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/399268.htmlKeKeTue, 14 May 2013 09:17:00 GMT//www.ot7t.com.cn/keweibo/articles/399268.html//www.ot7t.com.cn/keweibo/comments/399268.html//www.ot7t.com.cn/keweibo/articles/399268.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/399268.html//www.ot7t.com.cn/keweibo/services/trackbacks/399268.html注意?/span>必须把游标声明为局部的,即加上local

CREATE PROCEDURE [dbo].[p_expand_k3_bom]
@p_itemID int, @p_levelID int
WITH EXEC AS CALLER
AS
declare @v_itemID int
declare @v_levelID int
declare @v_itemNO varchar(20)
declare @v_itemName varchar(200)
declare @v_itemModel varchar(200)
declare @v_note1 varchar(20)
declare cursor_bom CURSOR LOCAL FOR select b.FItemID,c.FShortNumber, c.FName, c.FModel,  b.FNote1
  from AIS20120110144135.dbo.ICBOM a, AIS20120110144135.dbo.ICBOMChild b, AIS20120110144135.dbo.t_ICItem c
  where a.FInterID = b.FInterID
  and b.FItemID = c.FItemID
  and a.FInterID = (select top 1 FInterID from AIS20120110144135.dbo.ICBOM where FItemID = @p_itemID)
  and a.FItemID = @p_itemID
set @v_levelID = @p_levelID+1
open cursor_bom 
fetch next from cursor_bom into @v_itemID, @v_itemNO, @v_itemName, @v_itemModel, @v_note1
while (@@FETCH_STATUS = 0)
  begin
    INSERT INTO k3_bom_info
      (level_id, item_id, item_no, item_name, item_model, note_1) 
    VALUES (@v_levelID, @v_itemID, @v_itemNO, @v_itemName, @v_itemModel, @v_note1)
    
    exec p_expand_k3_bom @v_itemID, @v_levelID
    
    fetch next from cursor_bom into @v_itemID, @v_itemNO, @v_itemName, @v_itemModel, @v_note1
  end
close cursor_bom
deallocate cursor_bom
GO


Ke 2013-05-14 17:17 发表评论
]]>
Openbravo Developers_Guide Notes - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/398701.htmlKeKeFri, 03 May 2013 01:23:00 GMT//www.ot7t.com.cn/keweibo/articles/398701.html//www.ot7t.com.cn/keweibo/comments/398701.html//www.ot7t.com.cn/keweibo/articles/398701.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/398701.html//www.ot7t.com.cn/keweibo/services/trackbacks/398701.html辽宁福彩快乐12:How to create a Table
//wiki.openbravo.com/wiki/How_to_create_a_Table

The new table must include the AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated and UpdatedBy fields that are mandatory and required for security and auditory purposes of the application. 

Each table must have at least one column marked as an identifier. The actual values of identifier columns later get concatenated to be shown to the user as a representation of a particular record (see the link to the Sales Order within the Sales Invoice window). These identifiers will also be used to construct dropdown lists of records of that particular table. By default all columns with column name Name are set as an identifier. In case there is no column with this Name, no identifier is set and needs to be done so manually or compilation will fail. 

NOTE: The columns that are named line or seqNo are used to contain the sequence number of a record (i.e. the number of a line in an invoice). They take a default value like:

@SQL=SELECT COALESCE(MAX(ColumnName),0)+10 AS DefaultValue FROM TableName WHERE xxParentColumn=@xxParentColumn@

The WHERE part of this clause needs to be replaced with the required values. The code that should appear here is the name of the column which links with the id of the parent one. For example, each record of the C_InvoiceLine belongs to a particular C_Invoice record and they are all sequenced. C_Invoice is the parent table for the lines saved in C_InvoiceLine. This table has a column named line and the default value that it takes is:

@SQL=SELECT COALESCE(MAX(LINE),0)+10 AS DefaultValue FROM C_INVOICELINE WHERE C_INVOICE_ID=@C_INVOICE_ID@

How to add Columns to a Table

//wiki.openbravo.com/wiki/How_to_add_Columns_to_a_Table


These changes can be done in two different locations:

  1. Add columns to the original module (dbprefix HT)
  2. Create a second module (dbprefix HT2) which adds the columns to the first module

The first option can be chosen if the original module author wants to add more columns to his/her module. The second option is possible for anyone as the columns are added by a new module to the existing one which is not changed directly.

The main difference between these two methods is the names which need to be chosen for the columns to comply with the modularity naming rules.

  1. Adding column to same module: Any valid column name can be picked
  2. Via second module: New column name must comply to the pattern EM_<DBPREFIX>_ where <DBPREFIX> must be the dbprefix if the new module contaning the column to be added. In this example: EM_HT2_

How to add a Constraint

//wiki.openbravo.com/wiki/How_to_add_a_Constraint

In the Application Dictionary || Message window create a new record using the following details:

  • Module Openbravo Howtos 2 as this is the module containing the constraint also.
  • Search key: The search key must be exactly the same as the constraint's one, in this case em_ht2_ht_salary_dates_chk as this is the link between the constraint and the message.
  • Message type: Depending on the type the UI for the message box will be different (green for success, yellow for warning...), in our case we want a red error message box, so we select Error.
  • Message text: It is the user friendly message that will be displayed inside the message box. So let's enter: The Valid To date may not be before the Valid From date

 

 Creating a new instance of a Business Object

//wiki.openbravo.com/wiki/How_to_work_with_the_Data_Access_Layer#A_.27Hello_World.27_Example

A business object may never be created using the Java new operator. All business objects should be created using the OBProvider factory class:

   // create the object through the factory   final Category bpg = OBProvider.getInstance().get(Category.class);

Hibernate will detect that a business object is new when:

  • the id of the business object is not set
  • when the flag newOBObject is set to true explicitly

So if you want to create a new business object with a specific id (by calling setId(...)) then you explicitly need to call businessObject.setNewOBObject(true). Otherwise, Hibernate will throw an exception ('count of batch update operation....'). 




Ke 2013-05-03 09:23 发表评论
]]>
redhat 9.0,提示Determining IP information for eth0... failed; no link present. Check cable? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/398679.htmlKeKeThu, 02 May 2013 08:27:00 GMT//www.ot7t.com.cn/keweibo/articles/398679.html//www.ot7t.com.cn/keweibo/comments/398679.html//www.ot7t.com.cn/keweibo/articles/398679.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/398679.html//www.ot7t.com.cn/keweibo/services/trackbacks/398679.htmlredhat 9.0,提示Determining IP information for eth0... failed; no link present. Check cable?无法激活网络设备eth0
我搜的相关解决方案为?nbsp;
?etc/sysconfig/network-scripts/ifcfg-eth 
/etc/sysconfig/networking/devices/ifcfg-eth 其中表示Ethernet adapter的标识数字,一般为0。当为零的时候,就是 
/etc/sysconfig/network-scripts/ifcfg-eth0 
/etc/sysconfig/networking/devices/ifcfg-eth0 这两个文件中加入 

check_link_down () { 
return 1; 


Ke 2013-05-02 16:27 发表评论
]]>
具体分析tftp server配置的步?? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/398387.htmlKeKeThu, 25 Apr 2013 06:57:00 GMT//www.ot7t.com.cn/keweibo/articles/398387.html//www.ot7t.com.cn/keweibo/comments/398387.html//www.ot7t.com.cn/keweibo/articles/398387.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/398387.html//www.ot7t.com.cn/keweibo/services/trackbacks/398387.html转自?a >//network.51cto.com/art/201009/225534.htm

在Linux系统中,我们依然可以进行tftp server配置的操作。可能对于熟悉窗口操作的朋友,对于命令操作有些不熟悉,没关系这里我们就来讲解一下Linux 下的tftp-server配置的命令操作。TFTP是用来下载远程文件的最简单网络协?它其于UDP协议而实?嵌入式linux的tftp开发环境包括两个方?

一是linux服务器端的tftp-server支持,

二是嵌入式目标系统的tftp-client支持.

因为u-boot本身内置支持tftp-client,所以嵌入式目标系统端就不用配置?

下面就详细介绍一下linux服务器端tftp server配置.在redhat 9.0的第三张光盘?有tftp-server的安装rpm???nbsp;      安装

#mount –t iso9660 /dev/hdc /mnt/cdrom    //挂载光盘

#rpm -ivh tftp-server-0.32-4.i386.rpm              //安装

#umount /mnt/cdrom                                          //卸载光盘

?)修改文件在linux?不管使用的是哪一种super-server,inetd或者xinetd,默认情况下TFTP服务是禁用的,所以要修改文件来开启服?

根据?)的安装方法,可以修改文件/etc/xinetd.d/tftp.主要是设置TFTP服务器的根目?开启服?

修改后的文件如下:

service tftp {

socket_type            =dgram

protocol                  =udp

wait                        =yes

user                        =root

server                     =/usr/sbin/in.tftpd

server_args             =-s /home/app -c

disable                    =no

per_source             =11

cps                         =100 2

flags                       =IPv4

}

说明:修改项server_args= -s     <path>    -c,其中<path>处可以改为你的tftp server配置的根目录,参数-s指定chroot,-c指定了可以创建文?

?)创建tftp根目?关闭防火?启动tftp-server.

#mkdir /home/app

#chmod o+w       /home/app

#/etc/init.d/iptables stop        //关闭防火?/p>

#service xinetd restart          //重启 xinetd 服务

重启xinetd服务,因为TFTP服务受控与xinetd, xinetd是管服务的服?它是不开端口?

验证一下TFTP是否起来?

# netstat -nlp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 3122/rpc.statd

tcp 0 0 127.0.0.1:32781 0.0.0.0:* LISTEN 4035/xinetd

tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3103/portmap

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3324/httpd

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3255/sshd

tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3213/cupsd

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3295/sendmail: acce

tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3415/0

tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3324/httpd

udp 0 0 0.0.0.0:32768 0.0.0.0:* 3122/rpc.statd

udp 0 0 0.0.0.0:69 0.0.0.0:* 4035/xinetd   ;

可以看到69端口已经打开

udp 0 0 0.0.0.0:69 0.0.0.0:* 4012/in.tftpd

udp 0 0 0.0.0.0:111 0.0.0.0:* 3103/portmap

udp 0 0 0.0.0.0:754 0.0.0.0:* 3122/rpc.statd

udp 0 0 0.0.0.0:631 0.0.0.0:* 3213/cupsd

这样,tftp server配置的启动步骤就完成了?/p>

你可以登陆本机测试以?命令如下:

#tftp     your-ip-address

tftp>get <download file>

tftp>put <upload file>

tftp>q



Ke 2013-04-25 14:57 发表评论
]]>
VC:nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12..."错误! (转?/title><link>//www.ot7t.com.cn/keweibo/articles/396482.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Fri, 15 Mar 2013 07:04:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/396482.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/396482.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/396482.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/396482.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/396482.html</trackback:ping><description><![CDATA[<div class="yibqv">朋友编写一个dll,编译时总出?/div> <div class="yibqv">"nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12..."错误!</div> <div class="yibqv">后发现是,<span style="color: red"><strong class="yibqv">其创建dll时选择的时不使用MFC,而后来工程中又添加了与MFC相关的东?/strong></span>.才引起上述问?</div> <div class="yibqv">采用如下步骤解决此问?</div> <div class="yibqv">1.将工程设置中改为"动态使用MFC"</div> <div class="yibqv">2.<strong class="yibqv">到C++设置页中,看到Preprocessor Definitions编辑框中同时存在_USRDLL和_AFXDLL, 删除_USRDLL即可</strong>.<br /><br />转自?a >//blog.csdn.net/train_z/article/details/3118754</a><br /><br />确认解决了问题,但步?,我使用的是“静态MFC”</div><img src ="//www.ot7t.com.cn/keweibo/aggbug/396482.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2013-03-15 15:04 <a href="//www.ot7t.com.cn/keweibo/articles/396482.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC: “LoadLibraryW? 不能将参?1 从“const char *”转换为“LPCWSTR?/title><link>//www.ot7t.com.cn/keweibo/articles/396408.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Wed, 13 Mar 2013 10:59:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/396408.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/396408.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/396408.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/396408.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/396408.html</trackback:ping><description><![CDATA[<p>动态调用DLL<br />通过<br />LoadLibrary<br />GetProcAddress<br />FreeLibrary实现?/p> <p>原因 :工程只支持UNICODE字符</p> <p>解决方法?/p> <p><strong style="color: red">工程属?>配置属?#8211;>常规—>字符?#8212;->使用多字节符字符?/strong></p> <p> </p><img src ="//www.ot7t.com.cn/keweibo/aggbug/396408.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2013-03-13 18:59 <a href="//www.ot7t.com.cn/keweibo/articles/396408.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>c++调用c#的dll(转? - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/396322.htmlKeKeTue, 12 Mar 2013 07:13:00 GMT//www.ot7t.com.cn/keweibo/articles/396322.html//www.ot7t.com.cn/keweibo/comments/396322.html//www.ot7t.com.cn/keweibo/articles/396322.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/396322.html//www.ot7t.com.cn/keweibo/services/trackbacks/396322.html一、使?clr编译MFC可执行文件或规则C# DLL函数.
    1、打开“项目属?#8221;对话框,方法是右键单?#8220;解决方案资源管理?#8221;中的项目并选择“属?#8221;?br />    2、展开“配置属?#8221;旁边的节点并选择“常规”。在右侧窗格中的“项目默认?#8221;下,?#8220;公共语言运行库支?#8221;设置?strong>“公共语言运行库支持(/clr?#8221;?br />
    3、在相同的窗格中,确保将“MFC的使?#8221;设置?#8220;在共享DLL中使用MFC”?br />    4、在“配置属?#8221;下,展开“C/C++”旁边的节点并选择“常规”。请确保?#8220;调试信息格式”设置?#8220;程序数据?Zi”(而不?#8220;/ZI”)?br />    5、在“配置属?#8221;下,选择“C/C++”,然后选择“代码生成”。请确保?#8220;运行时库”设置?#8220;多线程调试DLL?MDd?#8221;?#8220;多线程DLL?MD?#8221;之一?br />二、在代码引用需要的dll.
 using <mscorlib.dll>. 
 using "DownloaFiles.dll"   //换成需要的dll文件?/strong> 
 using namespace System?
 using namespace ADMessage_test?nbsp; //换成dll中类所使用的namespace.
三、在C# DLL函数调用代码前加?pragma managed
    这是manage和unmanage混合编程在MFC下的一种实现方式?br />    以上介绍C++调用C# DLL函数,希望对你有所帮助?/p>

?、几点要记住?/p>

  1 使用#using引用C# DLL,而不?include.我就是想当然的使用了后者,所以浪费了一上午的时间;

  2 别忘了using namespace CSLib?/p>

  3 使用C++/clr语法,采用正确的访问托管对象,即:使用帽?#8216;^’,而不是星?#8216;*’?br />

PS:附上自己成功运行C++代码

#include "stdafx.h"
#include <iostream>
//#using "..\..\SFCSDLL.dll" //右击项目-->引用...,添加新引用,将DLL添加到项目中,可以不用此行代?/p>

using namespace std;
using namespace SFCSDLL;

int _tmain(int argc, _TCHAR* argv[])
{
 Class1 ^c = gcnew Class1();

 c->SFCSDLL_Create_Connection("127.0.0.1", 0, 0, 0, 0);
 c->SFCSDLL_Get_DLLVersion();
 c->SFCSDLL_Close_Connection();

 cout<<"end...";
 system("pause");
 return 0;
}

 



Ke 2013-03-12 15:13 发表评论
]]>
javascript 计算日期相差的天?/title><link>//www.ot7t.com.cn/keweibo/articles/395722.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Tue, 26 Feb 2013 02:00:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/395722.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/395722.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/395722.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/395722.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/395722.html</trackback:ping><description><![CDATA[<font face="Verdana"><html><br /> <head><br />  <script type="text/javascript"><br />   function moreThanOneMonth(dt)<br />   {<br />    var s1=new Date(dt.replace(/-/g, "/")); //日期格式为yyyy-mm-dd转换成yyyy/mm/dd<br />    var s2=new Date();<br />    var time= s2.getTime() - s1.getTime(); <br />    var days = parseInt(time / (1000 * 60 * 60 * 24));<br />    if(days > 30)<br />     return true;<br />    else<br />     return false;<br />   }<br />   function load(dt)<br />   {<br />    if( checkDate(dt) )<br />    {<br />     alert("days > 30");<br />    }<br />    else<br />    {<br />     alert("days < 30");<br />    }<br />   }<br />  </script><br /> </head><br /> <body onLoad="load('2013-01-01')"><br /> </body><br /></html></font><img src ="//www.ot7t.com.cn/keweibo/aggbug/395722.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2013-02-26 10:00 <a href="//www.ot7t.com.cn/keweibo/articles/395722.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C# DataGridView显示行号的方?/title><link>//www.ot7t.com.cn/keweibo/articles/392802.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Tue, 11 Dec 2012 06:54:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/392802.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/392802.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/392802.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/392802.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/392802.html</trackback:ping><description><![CDATA[<div id="content" class="content mod-cs-content text-content clearfix"> <div class="yibqv"> <p><span class="yibqv">网上最常见的做法是?/span><span class="yibqv">DataGridView</span><span class="yibqv">?/span><span class="yibqv">RowPostPaint</span><span class="yibqv">事件?/span><span class="yibqv">RowHeaderCell</span><span class="yibqv">中绘制行号:</span></p> <p><span class="yibqv">private</span><span class="yibqv">void</span><span class="yibqv">dataGridView1_RowPostPaint(</span><span class="yibqv">object</span><span class="yibqv">sender, DataGridViewRowPostPaintEventArgs e)<br />         {<br />            </span><span class="yibqv">try</span><span class="yibqv"><br />             {</span></p> <p><span class="yibqv">       e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, new SolidBrush(Color.CadetBlue), e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);<br />             </span><span class="yibqv">}<br />            </span><span class="yibqv">catch</span><span class="yibqv">(Exception ex)<br />             {<br />                 MessageBox.Show(</span><span class="yibqv">"</span><span class="yibqv">添加行号时发生错误,错误信息?/span><span class="yibqv">"</span><span class="yibqv">+</span><span class="yibqv">ex.Message, </span><span class="yibqv">"</span><span class="yibqv">操作失败</span><span class="yibqv">"</span><span class="yibqv">);<br />             }<br />         }<br /></span></p> <p><strong class="yibqv"><span class="yibqv">但是这种方法在大数据量的时候性能比较差,每次滚动数据都会触发</span><span class="yibqv">RowPostPaint</span><span class="yibqv">事件?/span></strong></p></div></div><img src ="//www.ot7t.com.cn/keweibo/aggbug/392802.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/keweibo/" target="_blank">Ke</a> 2012-12-11 14:54 <a href="//www.ot7t.com.cn/keweibo/articles/392802.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VS2008 自动生成属性的get、set - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/keweibo/articles/391417.htmlKeKeFri, 16 Nov 2012 01:34:00 GMT//www.ot7t.com.cn/keweibo/articles/391417.html//www.ot7t.com.cn/keweibo/comments/391417.html//www.ot7t.com.cn/keweibo/articles/391417.html#Feedback0//www.ot7t.com.cn/keweibo/comments/commentRss/391417.html//www.ot7t.com.cn/keweibo/services/trackbacks/391417.html

在VS2008里,也可以像Eclipse那样自动生成get 、set方法?br />
下面是两个具体操作的方法?br />

1、在编写的字段上单击右键----->重构------->封装字段

2、在空白行处,输?#8220;prop”再按Tab?/p>

Ke 2012-11-16 09:34 发表评论
]]>
如何查看SQL SERVER补丁的版?/title><link>//www.ot7t.com.cn/keweibo/articles/391210.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Mon, 12 Nov 2012 08:19:00 GMT</pubDate><guid>//www.ot7t.com.cn/keweibo/articles/391210.html</guid><wfw:comment>//www.ot7t.com.cn/keweibo/comments/391210.html</wfw:comment><comments>//www.ot7t.com.cn/keweibo/articles/391210.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/keweibo/comments/commentRss/391210.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/keweibo/services/trackbacks/391210.html</trackback:ping><description><![CDATA[<p>原文?a >//hi.baidu.com/einsteinalbert/item/b0366529705c5cfb51fd87ee</a><br /><br />有两种方法:<br /><br /><strong class="yibqv">第一步:使用SQL语句查询</strong><br /><br />select @@version<br /><br />查询结果如下?/p> <p>Microsoft SQL Server   2000 - 8.00.2039 (Intel X86) <br />   May   3 2005 23:18:38 <br />   Copyright (c) 1988-2003 Microsoft Corporation<br />   Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)</p><br />其实在C:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlservr.exe<br />点击鼠标右键查看版本也能得到,不过信息比较简单而已?.00.2039就代表安装的SQL Server的版本了。对应以下的表格,可以查出来具体对应的补丁版本?strong style="color: #ff0000">8.00.2039表示安装了SP4?.00.760表示安装了SP3</strong>?br /><br /><strong class="yibqv">第二步:对照表格查找具体的补丁版?/strong><br /><br /><strong class="yibqv">SQL Server Versions</strong><br /><br />@Version SQL Server Version Released <br /><br />6.50.201 SQL Server 6.5 RTM <br />6.50.213 SQL Server 6.5 with Service Pack 1 <br />6.50.240 SQL Server 6.5 with Service Pack 2 <br />6.50.258 SQL Server 6.5 with Service Pack 3 <br />6.50.281 SQL Server 6.5 with Service Pack 4 <br />6.50.415 SQL Server 6.5 with Service Pack 5 <br />6.50.416 SQL Server 6.5 with Service Pack 5a <br />7.00.623 SQL Server 7.0 / MSDE 1.0 RTM <br />7.00.699 SQL Server 7.0 SP1 July 1999 <br />7.00.842 SQL Server 7.0 SP2 March 20th, 2000 <br />7.00.961 SQL Server 7.0 SP3 December 15th, 2000 <br />7.00.1063 SQL Server 7.0 SP4 <br />8.00.194 SQL Server 2000 RTM <br />8.00.384 SQL Server 2000 SP1 <br />8.00.534 SQL Server 2000 SP2 November 30th, 2001 <br /><strong style="color: #ff0000">8.00.760 SQL Server 2000 SP3 <br />8.00.2039 SQL Server 2000 SP4</strong><strong class="yibqv"><br /></strong><br />更多的版本对照表?br /><br /><strong class="yibqv">For SQL Server 8</strong><br /><br />Main Releases <br />@@version Version and Service Pack <br />8.00.2039 Service Pack 4<br />8.00.760 Service Pack 3 <br />8.00.534 Service Pack 2 <br />8.00.384 Service Pack 1 <br />8.00.194 RTM <br /><br />All Releases <br />@@version Version and Service Pack <br />8.00.2039 Service Pack 4<br />8.00.760 Service Pack 3 <br />8.00.686 SP 2 + Q316333 <br />8.00.679 SP 2 + Q316333 <br />8.00.665 SP 2 + Q316333 <br />8.00.655 SP 2 + Q316333 <br />8.00.650 SP 2 + Q316333 <br />8.00.644 SP 2 + Q324186 <br />8.00.608 SP 2 + Q316333/Q356326/Q356938 <br />8.00.578 SP 2 + Q316333 <br />8.00.534 Service Pack 2 <br />8.00.532 Service Pack 2 Beta <br />8.00.452 SP 1 + Q308547 <br />8.00.444 SP 1 + Q308547/Q307655 <br />8.00.443 SP 1 + Q307538 <br />8.00.428 SP 1 + Q304850 <br />8.00.384 Service Pack 1 <br />8.00.287 Q297209 <br />8.00.251 Q300194 <br />8.00.250 Q291683 <br />8.00.249 Q288122 <br />8.00.239 Q285290 <br />8.00.233 Q282416 <br />8.00.231 Q282279 <br />8.00.226 Q278239 <br />8.00.225 Q281663 <br />8.00.223 Q280380 <br />8.00.222 Q281769 <br />8.00.218 Q279183 <br />8.00.217 Q279293/Q279296 <br />8.00.211 Q276329 <br />8.00.210 Q275900 <br />8.00.205 Q274330 <br />8.00.204 Q274329 <br />8.00.194 RTM(SQL Server 8 with no service pack applied)<br /><br /><strong class="yibqv">For SQL Server 7</strong><br /><br />Main Releases<br />@@version Version and Service Pack <br />7.00.1063 SQL Server 7 with Service Pack 4 <br />7.00.961 SQL Server 7 with Service Pack 3 <br />7.00.842 SQL Server 7 with Service Pack 2 <br />7.00.699 SQL Server 7 with Service Pack 1 <br />7.00.623 SQL Server 7 with no service pack applied <br /><br /><strong class="yibqv">For SQL Server 6.5</strong><br /><br />Main Releases<br />@@version Version and Service Pack <br />6.50.479 SQL Server 6.5 with Service Pack 5a (updated) <br />6.50.416 SQL Server 6.5 with Service Pack 5a. <br />6.50.415 SQL Server 6.5 with Service Pack 5 <br />6.50.281 SQL Server 6.5 with Service Pack 4 <br />6.50.258 SQL Server 6.5 with Service Pack 3 <br />6.50.240 SQL Server 6.5 with Service Pack 2 <br />6.50.213 SQL Server 6.5 with Service Pack 1 <br />6.50.201 SQL Server 6.5 with no service pack applied <br /><br /><strong class="yibqv">For SQL Server 6</strong><br /><br />Main Releases<br />@@version Version and Service Pack <br />6.00.151 SQL Server 6 with Service Pack 3 <br />6.00.139 SQL Server 6 with Service Pack 2 <br />6.00.124 SQL Server 6 with Service Pack 1 <br />6.00.121 SQL Server 6 with no service pack applied <br /><br /><strong class="yibqv">补充</strong><br />For SQL Server 2005<br />打了sp3后版本号?nbsp;<strong class="yibqv">9.0.4035</strong>如果是这个旧说明不用打了,如果比这个低,说明没有?img src ="//www.ot7t.com.cn/keweibo/aggbug/391210.html" width = "1" height = "1" /><br><br><div align=right><a href="//www.ot7t.com.cn/" title="四川福利彩票快乐12">四川福利彩票快乐12</a> 2012-11-12 16:19 <a href="//www.ot7t.com.cn/keweibo/articles/391210.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <script>(function(){ var src = (document.location.protocol == "http:") ? "//js.passport.qihucdn.com/11.0.1.js?f7a6bc378844a5df707c414e6b6fea33":"https://jspassport.ssl.qhimg.com/11.0.1.js?f7a6bc378844a5df707c414e6b6fea33"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script>