DataGridView的增加,修改,删除命令指定SQL语句
'保存数据
Private Sub Save()
Try
If MsgBox("确定要保存所修改的数据吗?", MsgBoxStyle.Question Or MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.YesNo, "系统提示") = MsgBoxResult.Yes Then
GridView.Rows(0).Cells("spbm").Selected = True
Dim gCummand As New SqlClient.SqlCommandBuilder(gDataAdapter)
With gDataAdapter
Dim parameterU As SqlClient.SqlParameter
'重新指定修改的SQL命令
.UpdateCommand = New SqlClient.SqlCommand("P_SetSJCXinfo", eCMyData.CreateConnection())
.UpdateCommand.CommandType = CommandType.StoredProcedure
parameterU = .UpdateCommand.Parameters.Add("@v_type", SqlDbType.Char, 2)
parameterU.Value = "20"
parameterU = .UpdateCommand.Parameters.Add("@v_sjbh", SqlDbType.Char, 10)
相关文档:
SQL Server 索引结构及其使用(二)
作者:freedk
一、深入浅出理解索引结构
改善SQL语句
很多人不知道SQL语句在SQL SERVER中是如何执行的,他们担心自己所写的SQL语句会被SQL SERVER误解。比如:
select * from table1 where name=''zhangsan'' and tID > 10000
和执行:
select * from table1 where tID ......
SQL Server 索引结构及其使用(四)
作者:freedk
一、深入浅出理解索引结构
二、改善SQL语句
三、实现小数据量和海量数据的通用分页显示存储过程
聚集索引的重要性和如何选择聚集索引
在上一节的标题中,笔者写的是:实现小数据量和海量数据的通用分页显示存储过程。这是因为在将本存储过程应用于“办 ......
If the SQL data type is 'timestamp', we need to use ResultSet.getBytes() to retrieve its value. If the SQL data type is 'datetime', we can use ResultSet.getTimestamp(). It is said timestamp is interanlly saved as binary data.
try {
Class.forName("com.microsoft. ......
在很多编程语言中都有 for循环这样的东西。在数据库里面 替代他是 游标
但是游标使用起来是相当耗费资源的,今天看见一个CTE尝试了下他的用法
create table employewhere
(
id int identity(1,1),
[name] varchar(10),
[value] varchar(10),
[ttime] int
)
insert employewhere
select ......
delete 删除一张大表时空间不释放,非常慢是因为占用大量的系统资源,支持回退操作,空间还被这张表占用着。
truncate table 表名 (删除表中记录时释放表空间)
DML 语句:
表级共享锁: 对于操作一张表中的不同记录时,互不影响
行级排它锁:对于一行记录,oracle 会只允许只有一个用户对它在同一时间进行修改操作 ......