By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

Convert Data Type of Data Column

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.