469,613 Members | 2,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Convert Data Type of Data Column

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

Jan 27 '07 #1
1 9649
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

"neeraj" <ne********@gmail.comschreef in bericht
news:11**********************@l53g2000cwa.googlegr oups.com...
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

Jan 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by D Newsham | last post: by
19 posts views Thread by tshad | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.