Exact searching


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)StrataFrame User (360 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

in one of my BOs ("LieferBO") I added a get-method I took from the help-file

and modified it to myBO-name and field-name.

[code]

Dim loCommand As New SqlCommand()

loCommand.CommandText = "SELECT COUNT(*) FROM liefer WHERE adresse = @pAdresse"

loCommand.Parameters.Add("@pAdresse", SqlDbType.VarChar)

loCommand.Parameters("@pAdresse").Value = cAdresse

Return CType(Me.ExecuteScalar(loCommand), Integer)

[/code

But now I have the following problem which I can't solve by myself:

There are, for example the following records with the field "adresse" which is a char(6)-field:

B-M

BALM

BZ

I want to search, if there is a record with "BAL", which would be a valid new value, but the method returns 1 because it finds the "BALM"-record. I tried changing the var cAdresse to cAdresse.padr(6," ") which always worked with VFP-Views, but not here.

Can somebody advise me how this can be done?

Thanks in advance

Thomas

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search