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)
The code is throwing an error I’ve never seen before….
SqlCommand.DeriveParameters failed because the SqlCommand.CommandText property value is an invalid multipart name “/port:4544 /path:”C:\sitepath” /vpath:”/sitepath””, incorrect usage of quotes.
How do I fix that error.
It looks like the code is failing at a deeper level than the code you have posted. I have received a similar error from within SQLServer Management Studio when I have not correctly defined the path to my DB.
How are you setting up the object ‘db’?
What is your connection string? (Without password! :-))
The error is obviously related the badly formed string in terms of the quote positions. Do you know where entlib is constructing this string and how parts of it such as “C:\sitepath” are appearing with quotes as opposed to being appended as string literals?
I wonder if somewhere there is a declaration such as
..which is leading to the quotes being inserted into the constructed string.