Hi All, I'm trying to use LIKE expression on my VB.NET code.
I have tried that with Access Query and got the result. But when
I use VB.NET to do the query, the datatable return zero data.
here's what I do;
=====================================================
dim sSQL as string = "SELECT * FROM Table1 WHERE INF1 LIKE '*cool*'
dim mcon as oledbconnection = new oledbconnection(sconnectionstring)
dim dt as new datatable
try
mcon.open
dim s as new oledbdataadapter(sSQL, mcon)
result.fill(dt)
catch ex as exception
msgbox ex.message
end try
dim dTotal as long = dt.rows.count
dt.dispose
=====================================================
The dTotal variable will be zero, but when you test the SQL statement with Access, it result something.. why do this happen? anyone can explain? what should I do? help please...
I have tried that with Access Query and got the result. But when
I use VB.NET to do the query, the datatable return zero data.
here's what I do;
=====================================================
dim sSQL as string = "SELECT * FROM Table1 WHERE INF1 LIKE '*cool*'
dim mcon as oledbconnection = new oledbconnection(sconnectionstring)
dim dt as new datatable
try
mcon.open
dim s as new oledbdataadapter(sSQL, mcon)
result.fill(dt)
catch ex as exception
msgbox ex.message
end try
dim dTotal as long = dt.rows.count
dt.dispose
=====================================================
The dTotal variable will be zero, but when you test the SQL statement with Access, it result something.. why do this happen? anyone can explain? what should I do? help please...