Convert Data Type of Data Column

  • Thread starter Thread starter neeraj
  • Start date Start date
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
 
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
 
Back
Top