Trailing spaces in char fields with ADO.Net and OleDB
Posted in 2008
Topics: General Discussion
I use the ado.net IdxConnection to connect to an informix database. Unfortunately every field of type char in the dataset has trailing blanks. How can I get rid of them? (In DbExpress I could put "trim char=true" in the connectionstring.)
There is no attribute called "trim char=true" in connection string for Infomrix .NET Provider. However you should be able to do string.Trim() and/or you might think of using VARCHAR instead of CHAR column. -Shesh "Philippe Requilé" <Philippe.Requile@falcon.be.nospamplease> Sent by: informix-list-bounces@iiug.org 14/02/2008 12:44 To informix-list@iiug.org cc Subject Trailing spaces in char fields with ADO.Net and OleDB I use the ado.net IdxConnection to connect to an informix database. Unfortunately every field of type char in the dataset has trailing blanks. How can I get rid of them? (In DbExpress I could put "trim char=true" in the connectionstring.) _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
On Feb 14, 2:14 am, "Philippe Requilé" <Philippe.Requ...@falcon.be.nospamplease> wrote: > I use the ado.net IdxConnection to connect to an informix database. > Unfortunately every field of type char in the dataset has trailing blanks. > How can I get rid of them? > > (In DbExpress I could put "trim char=true" in the connectionstring.) Depending on the size and scope of your application, you might want to look at the DevForce framework from IdeaBlade (www.ideablade.com). It is fantastic for building Windows forms applications and works just fine with Informix (using OleDB and ADO.Net, if you wish). They have an express version (without the Business Objects Server) that is free. They are sharp folks who understand good application architecture and are on top of the most important technologies from Microsoft. The OR-mapping part of the framework will handle trimming and also nulls. You need to dig into the framework to see all the benefits. Too many to list here. Read the Concepts Guide from their web site to get the best overview.