Programming

There's no direct command to read a script file and execute it.
But isql.exe and osql.exe come in handy when you have to execute a script file from within T-SQL.
Just call any of these exes using xp_cmdshell and pass the script file name as parameter to it:


EXEC master..xp_cmdshell 'osql -Svaio -Usa -Pzaassds1 -ic:\MySQl.sql -n'
EXEC master..xp_cmdshell 'isql -Svaio -Usa -Pzaassds1 -ic:\MySQl.sql -n'

ที่มา
http://www.devx.com/tips/Tip/15132

Err : Specified argument was out of the range of valid values.
Parameter name: '-2147483643' is not a valid value for 'index'.


Doug Lott
I get the same error on just one value (which happens to be 2nd in the list)
in my combobox.The combobox in question is bound to a datatable and
later in the load event, the selectedvalue property is assigned a value
from a custom object.

cboCurrentStatus.SelectedValue = _projectList.CurrentStatus

This works as long as the value is not the 2nd item in the collection.
If it is the 2nd item,I get the "Specified argument was out of the range
of valid values" error. On the other hand, if I replace the above
code with:

For Each item As Object In Me.cboCurrentStatus.Items
If CType(item, DataRowView)(0).ToString() = projectList.CurrentStatus.ToString Then
Me.cboCurrentStatus.SelectedItem = item
End If
Next

it works just fine even when currentSatus is the 2nd item in the collection.
Can anyone explain this?

--------------------------------
From: Doug Lott


ที่มา

http://www.dotnet247.com/247reference/msgs/29/148796.aspx

การสร้าง Running number
สร้าง Running Total Field ขึ้นมาใหม่
เลือก Field to summarize เช่น primary key
เลือก Type of summary เป็น count
เลือก Evaluate เป็น For each record
เลือก Reset เป็น Never
จากนั้น ลากฟิลด์ Running Total ตัวใหม่นี้ไปไว้บนส่วน Detail

ที่มา
http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&id=5432