dim department as integer =Level.SelectedIndex
Dim sqlstr1 As String = "select landname from users where depid = @department"
Dim com2 As New SqlCommand(sqlstr1, conn)
com2.Parameters.Add("@department", department)
com2.ExecuteReader()
这样写行吗?
Dim sqlstr1 As String = "select landname from users where depid = '& department &'"
Dim com2 As New SqlCommand(sqlstr1, conn)
com2.ExecuteReader()
这两种写法那种对,还是都不对?
Dim sqlstr1 As String = "select landname from users where depid = @department"
Dim com2 As New SqlCommand(sqlstr1, conn)
com2.Parameters.Add("@department", department)
com2.ExecuteReader()
这样写行吗?
Dim sqlstr1 As String = "select landname from users where depid = '& department &'"
Dim com2 As New SqlCommand(sqlstr1, conn)
com2.ExecuteReader()
这两种写法那种对,还是都不对?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货