.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Removing unwanted spaces in columns

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :Sql Server
How to remove unwanted spaces empty lines in table columns

View Complete Post

More Related Resource Links

Removing columns inherited from parent not working

I'm trying to install a couple of custom workflow task content types that are based on the standard workflow task type, but I want to remove some of the attributes defined on the std worfklow task type.  Per the MSDN online info you can use the <RemoveFieldRef/> tag in your XML content type definition file to remove such columns.  For some reason mine does not appear to work, however.  In addition to not removing the columns specified by the <RemoveFieldRef/> tags, it also does not create my custom "Comments" column -- It DOES create the custom "Respoinse" column. The following are my XML definition files for the feature (which installs fine and the content types are created, but the columns I want to remove still show up).  Any idea what I'm missing to remove these columns from the custom types?  I pulled the IDs for the columns I want to remove from the std type definition XML under the 12-hive FEATURES folder Type Definition File <?xml version="1.0" encoding="utf-8"?> <!-- See this blog for specifics: http://www.scribd.com/doc/2278897/Part-4-Custom-Workflow-Forms-TaskEdit-Form --> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType ID="0x010801003D9E4ED01F024d28AF0056E2654CECB0" Name="MoreInfo Task" Group="

How to minify html , css , javascript ( removing white spaces etc )


i am looking for a tool which will minify my code when publishing website


or it may be run time minify too if not using too much cpu power



Removing columns after Merge Join ?



I have the scenario (using a third party component) where certain columns must not be present as input.

I am doing a Full Outer - Merge Join.

This results in:



but now in some cases the LeftPK may be  null in other cases the RightPK may be null,

so i'm creating a derived column to check:

ISNULL(LeftPK) ? RightPK : LeftPK

and call this the TruePK

this all works however now i'm left with 3 columns

LeftPK; RightPK; TruePK

Is there some kind of transform (other than script task) that i can use to get rid of Left and Right PK columns before sending input to next third party component?

I.W Coetzer

SSRS 2008 - Excel Export adding unwanted total columns to spreadsheet



I have a SSRS 2008 report which has 3 column groups which when i export to Excel the resulting excel spreadsheet has an additional total column for each of the groups.  I dont have this displayed in the report and dont want it displayed in teh excel export, is there anyway to turn this off?

I've had a search of this forum but so far i've been unable to find a solution(or someone else having the same problem)


CSV importing unwanted columns


Hi all,

I wonder if anyone can help with a strange issue that's occuring when I try to import some csv files via SSIS.
My flat file connection manager details are as follows:

Format: Delemited
Text Qualifier: <none>
Header row delimiter: Comma {,}
Header rows to skip: 0
Column names ARE NOT in the first data row.

The problem is that if I have specified 3 columns, as below:

Column1 ColumnDelimiter: Comma{,}
Column2 ColumnDelimiter: Comma{,}
Column3 ColumnDelimiter: {CR}{LF}

...However, if in the csv file there is data populated in the first 4 columns (i.e. my defined columns[1-3] in addition to column4 which I have not specified) then when I look into the Preview tab in SSIS, I get the value followed by a comma (',') for the for Column3 field. What's worse is that if I have lots more rows then it populate all those other entries in Column3 with a comma (',') also.

Has anyone experience this before, and more importantly is there a fix to it? I only want SSIS to read those column values that I have specified in the file connection manager. I don't want to read/import anything after my last defined column.

Any help would be greatfully appreciated.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

add columns with textboxes in gridview using C#

'm working on a shopping cart in a website and I have my items(which have been added to the cart) in an arraylist. And using these values I've read the rest of the values from the db and and have populated on the gridview successfully.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Sorting GridView Columns Manually

We all know that GridView columns can be sorted automatically when SQLDataSource is being used. But what if you are not using SqlDataSource to populate the GridView. Sorting the GridView manually is pretty straight forward task take a look at the code below

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


How to let user edit selected gridview columns, not entire row



I've got a gridview I would like to let the user edit a couple of columns.  Seems like everything I'm coming across so far makes the entire row editable.  

Hopefully the solution isn't too complicated.  Can someone point me in the right direction?


removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







How to change text in columns in SSRS?


I need to create a complex report and export it to Excel. 

In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. Any ideas please. I am new to SSRS and tried out many ways but didn't get it.

Unwanted page breaks in rdlc report



I hav a report that has a table group =Fields!Location.Value

and in the cells I do this

=Avg(IIF(Fields!Contaminant.Value = "Element1", cDbl(Fields!Value.Value), cDbl(0)))

what I am getting is 1 row for each location then there is a pagebreak! what i want is the next location right below the  first I looked through for all the page breaks with no luck. Any ideas?

Filter search over multiple text columns


Hi everyone,

I'm working on a library that stores information on various cases. The case table has several columns that contain descriptive strings on what happened in the case. I would like to create a single filter that returns all cases where the search string is found in any of the columns. I've looked at Dynamic Data Filtering, but as far as I can tell, the "Contains" filter only allows you to connect to each column individually. Has anyone tried this?



Delete spaces created by combining 2 fields


Howdy, this is kind of a continuation of an answer I got from this thread:  http://forums.asp.net/t/1592766.aspx

My users will enter a city/station where an incident occured, and the date.  The trigger below does work, but it will occasionally put spaces between the citystation and the date.  I think this happens when the citystaion name is not very long, but not sure.

(ex: city____08242010)

How can I make sure that if the incidentid is going to have spaces, that sql deletes those spaces?  I need the id to be space free.





TRIGGER [dbo].[tr_AddID1] ON [dbo].[tblIncidents] INSTEAD
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend