473,503 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9895
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
67368
by: Loi Tan Vo | last post by:
Hi, I have a text file that contains a date column. The text file will be imported to database in SQL 2000 server. After to be imported, I want to convert the date column to date type. For...
4
59401
by: meh | last post by:
I have imported data from excel file. When data came to SQL table, the type of AMOUNT column was varchar. I tried to convert and cast amount type of amount column to number type but it does not...
4
9645
by: D Newsham | last post by:
Hi, This javascript creates a table that has a header and side column that do not move while scrolling through the table. I need to convert this to vb script. Can anybody help, or do you have...
2
15524
by: Mac | last post by:
I have imported some data to sql2k from my old system. Somehow, it imported invoice amount to char type. I just created another column called invamt2 type NUMERIC so I can copy or convert...
5
3766
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
3
57359
by: t2581 | last post by:
Hi , I have database db2 udb 7.2 with following table and datatype CREATE DISTINCT TYPE APP.NOTEPAD AS SYSIBM .CLOB(4096); CREATE TABLE APP.AP_NOTE_PAD ( CONTROL_LOCATION INTEGER NOT NULL...
2
8901
by: Ch Pravin | last post by:
Hi All: I am having the following xml which i need to convert to excel using xslt. Please help me out. Afghanistan.xml <?xml version="1.0" encoding="utf-16"?> <Languages...
8
25735
by: hidrkannan | last post by:
I am reading a set of data from the excel workbook. Data are contained in 2 columns. Column A contains the names and Column B contains values. The issue is the value can be of any type integer,...
19
14746
by: tshad | last post by:
I have a value in my sql table set to tinyint (can't set to bit). I am trying to move it into a boolean field in my program and have tried: isTrue = (int)dbReader and isTrue =...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.