GH教學

GodHelp線上補習班、各類教學分享網站(程式設計、Flash遊戲教學、影音轉檔、動畫、繪圖、Go Home Schooling.....等等)

搜尋

Table之間Update

我現在寫一個VBA的程式. 其中有一個Update 語法如下. Update item1 Set cat='" & a0 & "' where 識別碼=" & a1 a0 及a1 都是其他table的值那我該如何取得a0,a1的值呢?? 我現在是要做一個按紐為更新一按下就會更新所有的值

SQL指令

--參考指令
update A set A.iUnit=B.iUnit
from A,B
where A.sKey=B.sKey
--Update 語法
update item1 set item1.cat=B.iUnit
from item1,B
where item1.識別碼=B.sKey

ARITHABORT 錯誤

[SqlException (0x80131904): INSERT 已經失敗,因為下列的 SET 選項設定不正確: 'ARITHABORT'。]

網路上看到解決方式是
ALTER DATABASE DBName
SET ARITHABORT ON

最後找到其中一個COLLATE定序與其他欄位不同造成
把它修改為資料庫預設後就可以了

倒正三角形以For迴圈

C++問題倒正三角形以for迴圈
使用者輸入一個正整數
然後輸出以*印成的倒 正三角形(用for迴圈來做)
EX:
輸入5
輸出的東西
 *****
  ***
   *

寫了兩個不同的程式語言
重點是如何控制空白及*數量
C++
我是以階層iLevel來設定比較單純
你要5個*需要設定3層

int iLevel=3;
for(int i = iLevel-1 ; i <=0 ; i--)
{
repeat(iLevel-i," ") ;
repeat(1+(i)*2, "*") ;
repeat(iLevel-i," ") ;
printf("\n");
continue;
}
//自行定義一個repeat 數量,字的function
function repeat void repeat(int n,char ch)
{
for(int i=0;i<n;i++) printf("%c",ch);
}


ASP寫法

<%
iLevel=7
For i=iLevel-1 To 0 Step -1
Response.write String(iLevel-i," ") & String(1+(i)*2, "*") & String(iLevel-i," ") & "
"
Next
%>

活動

給您專屬賀卡

好站

知識+名片

GH知識+

天氣

Sitetag台灣部落格列表

統計

Blog Look Score and Rank