在VB2008 速成版中使用参数化SQL查询语句无效
最近刚学会在VB2008 中使用参数化SQL语句,于是马上用到代码中,却碰到查不到任何数据的情况,纠结了好几天,还是没有搞明白,差点吐血。不得已还是先在代码中使用字符串拼接的SQL语句。
包含参数化SQL语句的代码如下:
Dim cmSl As New OleDbCommand("select * from PENA where VSL_VOY=@vsl_voy and POD"+ _ "LIKE @pod ",dbCon)
Dim paPOD As New OleDbParameter("@pod", OleDbType.VarChar)
Dim paVSL_VOY As New OleDbParameter("@vsl_voy", OleDbType.VarChar)
paPOD.Value = IIf(Me.TextBoxPOD.Text.Length = 0, "%", Me.TextBoxPOD.Text.Trim.ToUpper)
paVSL_VOY.Value = Me.TextBoxVSL_VOY.Text.Trim.ToUpper
cmSl.Parameters.Add(paVSL_VOY)
cmSl.Parameters.Add(paPOD)
&nbs
相关文档:
Option Explicit
Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pDisplayName As String
lpTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Declare Function SHGetPathfromIDList Lib "shell32.dll" Alias _
"SHGetPa ......
CREATE proc [dbo].[proc_DeleteTemplet] (@templeId varchar(15),@errorMessage varchar(50) output)
as
begin
declare @error int
set @error =0
begin tran
delete from tc_templet_Head where fBillNo=@templeId
set @error=@error+@@error
delete from tc_templet_ ......
1. Q. What is a join?
A. Join is a process of retrieve pieces of data from different sets (tables) and returns them to the user or program as one joined collection of data.
2. Q. Can a table have more than one foreign key defined?
A. A table can have any number of foreig ......
写一个存储过程,将表一按照表二的形式进行查询。
仓库名称 商品名称 数量
A
S001 12
A S002 17
A
S003 10
B S001 21
B
S002 5
B S003 ......
记得以前用SqlServer 2000的时候在“右键数据库->所有任务->导入数据/导出数据”这个选项,但是最近在使用SqlServer 2005 express的时候发现居然没有“导入/导出”功能,这个让人相当郁闷。
后来网上一查才知道是因为我用的是ex ......