Dim id as integer = 1
Dim command as sqlcommand
Dim reader as idatareader
command = db.GetSqlStringCommand("select id, image, caption from profile where id = @id and image IS NOT NULL Order By NEWID()")
db.AddInParameter(command, "@id", DbType.Int32, id)
reader = db.ExecuteReader(Command)
的代码扔我从来没见过一个错误....参数异常
SqlCommand.DeriveParameters失败,因为SqlCommand.CommandText属性值是无效的多部分名称“/port:4544/path:“C:\ sitepath”/ vpath:“/ sitepath”“,不正确地使用引号。
如何解决该错误。
企业库数据访问应用程序块正在提供数据库,正在使用的连接字符串是默认的,并且可用于整个站点的许多其他查询。如果我用整数值替换参数并在SQLSMS中运行查询,它将返回预期的结果。谢谢 – Phil 2010-07-20 08:27:09