Convert Data Type of Data Column

N

neeraj

Hi All
Can any give me the code for convert "DataColumn" data type of
"DataTable". Even if data table already populated (have data)

Actually I am creating one search module which searches the data from
"DataView" using "RowFilter" method. Here I m using like
operator for searching, its work fine for string but if data type of
"Data Column" is Date or Integer then its not working.

Now I m decide I will convert data types of all column as string but
here one another problem occurring,
We can not convert data type of column if "DataTable" has data.

I don't want to do it though looping like create one another table
with all string data type columns and place all records to this new
data table one by one.

This is the code for searching.

Working fine
dv.RowFilter = "Employee_Name like '" & txtSearchValue & "%'"

Not Working fine
dv.RowFilter = "Employee_id like '" & txtSearchValue & "%'"


please conceder it, for interger serching I also don't want to search
like this.

dv.RowFilter = "Employee_id >=" & txtSearchValue
 
C

Cor Ligthert [MVP]

Neeraj,

You cannot do a convert in an existing table, however more important, what
datatype is the sender and what is the result. I think you want strings, but
before we take senseless time.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top