473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Text Truncation

hi,
I have a dataview which is returning the shipdate information like
01/23/2005 10:23:23 from the database , i need to truncate the time
part of the ship date information ,
currently i am using..
I am creating a separate column at runtime and and assigning the ship
date information to that new column ,
Always String has a remove function which truncates the characters, but
how do i do that for a ROW..
If you guys have a better solutions , i ll appreciate your help

Attached is my code:

DataColumn myCol3 = dvResults.Table.Columns.Add("ShipDate1");
DataRow ship;
dvResults.Table.Columns.Add(myCol3);
for(int i=0;i<dvResults.Table.Rows.Count;i++)
{
dvResults.Table["ship"] =
dvResults.Table.Rows[i]["Ship_Date"].ToString;
}
Thanks
polur

Nov 19 '05 #1
1 878
If it's already a datetime format, you could cast or convert it to a
System.DateTime. Then just use the ToShortDateString() method which will
only return the date, not the time part.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"manas" <ma**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
hi,
I have a dataview which is returning the shipdate information like
01/23/2005 10:23:23 from the database , i need to truncate the time
part of the ship date information ,
currently i am using..
I am creating a separate column at runtime and and assigning the ship
date information to that new column ,
Always String has a remove function which truncates the characters, but
how do i do that for a ROW..
If you guys have a better solutions , i ll appreciate your help

Attached is my code:

DataColumn myCol3 = dvResults.Table.Columns.Add("ShipDate1");
DataRow ship;
dvResults.Table.Columns.Add(myCol3);
for(int i=0;i<dvResults.Table.Rows.Count;i++)
{
dvResults.Table["ship"] =
dvResults.Table.Rows[i]["Ship_Date"].ToString;
}
Thanks
polur

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve Bright | last post by:
In an ASP page, I am using the FileSystemObject OpenTextFile method to initiate a TextStream object. In some files I have long lines and it appears that these are being truncated to 2048...
1
by: hharry | last post by:
Hello All, I am attempting a bulk load of fixed position flat file data via bcp and I have noticed that I get a Right Truncation error when trying to load a row where the last column value is...
10
by: joel.brewster | last post by:
We have a VB6 application using ADO version 2.5 and I am receiving a " CLI0109E String data right truncation. SQLSTATE=22001" error when I execute the rs.UpdateBatch method. I have determined...
2
by: Magix | last post by:
Hi, I have following code. char buffer; void string_addchar(char *sourc, char ch) { int length; length=strlen(sourc);
26
by: Alfonso Morra | last post by:
Hi, I'm getting a compiler error of "pointer truncation from 'void *' to 'int'" because I'm not explicitly casting from void* to (datatype*). Pointers are stored as ints (is that right?), so as...
2
by: seash | last post by:
Hi my application is an MDI application , when i call a child form like this objchild = new frm(); objchild.MdiParent = this; objchild.Show(); the child screen in the container gets a...
8
by: michele | last post by:
Hi, i have in my crystal report viewer .net a multiline field. When i preview the report, the text in the field is clipped on the right, so some words are invisible... i'm going mad; i've searched...
0
by: Galal | last post by:
Does DB2 Net Search Extender support right truncation, left truncation in Arabic, left truncation in English, or right truncation in Arabic?
2
by: coolnoff | last post by:
I have a dts which creates a table which is utilized on my local intranet. The DTS runs without error and the table is created/populated/transfered to the appropriate db. Then it appears that...
12
by: Juan Carlos Espinoza | last post by:
i have a problem com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'FGiroNPagDol' at row 1 at...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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,...

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.