|
-
Dec 28th, 2005, 04:55 AM
#1
Thread Starter
New Member
Problem with SQL statement
Hi,
I need some help with a little SQl problem.
I'm using VB 2005 en SQL Express.
I have build a SQL statement like this:
SELECT * FROM USERS WHERE (ACHTERNAAM LIKE '%' + @PARAM_LASTNAME + '%')
I have created it through the query builder, if i run it there it works fine.
VB 2005 creates his own code, so you can call the procedure.
It looks like this:
Public Overloads Overridable Function FillByAchternaam(ByVal dataTable As CRMDATA.USERSDataTable, ByVal PARAM_LASTNAME As String) As Integer
Me.Adapter.SelectCommand = Me.CommandCollection(3)
If (PARAMACHTERNAAM Is Nothing) Then
Throw New System.ArgumentNullException("PARAM_LASTNAME")
Else
Me.Adapter.SelectCommand.Parameters(0).Value = CType(PARAMACHTERNAAM,String)
End If
If (Me.m_clearBeforeFill = true) Then
dataTable.Clear
End If
Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
Return returnValue
End Function
I call it this way:
Me.USERSTableAdapter.FillByAchternaam(DataTable, "Any text")
SO, again, when i test it in the query designer it works fine, but when i run my application like the way i described above it doesn't give back any records all the time.
Does anybody have an idea ??
Thnx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|