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

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

Remove foreign characters from data

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :Sql Server

I have date in my results where squares appear - how to i replace non-letter characters with empty string...They are squares in windows they are like ALT + 0 + 1
+ 1+1

I have tried trim , rtrim - no luck


View Complete Post

More Related Resource Links

Remove characters in a string


i have a string like this   sravani/, asdfff/, lsdsf/
i want to remove last character '/'  in the above string...
which function can i use?

pls help me....

SQL data type for HL7 message retaining carriage return and new line characters

Hi, What data type should be used for a column storing text as descripted in title? Please advise. I crrently have the message stored as text, but if I copy the message from studio management to a notepad, it will be come one big line of text instead.  

for foreign key which data type is covinent ?

for foreign key which data type is covinent ?example:- a fruits shop application.i have 4 text boxes in that can enter 1.mango,2.apple,3.banan,4.pineapple.i want to buy and sale, inventry based on date save in database and retrive.can explain any one for that i think foreign key is required.so i am asking is it possible date time for foreign key ?

How to remove data from arrayList with Linq?

Hi All-This arrayList produced by the Linq query returns data pairs of an ID and count.  I would like to keep pairs that have a high enough count.  For example, keep all that have a count of 5 and higher so if the arraylist contains:userID    Count1               102               93                94                35                1the remaining data in the arraylist would be userId 1,2, and 3 (with their counts).  How can I do this? Dim customerCount = (From c In results Group c By key = c.userID Into Group _ Select New With _ { _ .userID = key, _ .Count = Group.Count() _ } _ ).ToList().OrderByDescending(Function(a) a.Count)

Maximum amount of characters in a text data source

Hi, I've got an Infopath 2007 form, that contains a repeating table. I'm using a text type data source that is storing certain values from the repeating table's multiple columns using double eval function. Is there any limitation to maximum how many characters are allowed on this text data source? I'm also planning on promoting this data source on a sharepoint site's form library. I think the text fields in sharepoint site are allowed maximum 255 characters. Please correct me if this is not the case. Would sharepoint form library show full text after promoting this data source if it contains a lot of info or exceeds 255 characters. I haven't tested these yet, but just thinking of extreme cases to plan things better. Please advise. Thanks,Pman http://www.pmansLab.com/

Foreign characters causing a duplicate attribute key error - how to avoid?

Greetings, We have a data warehouse into which we import data obtained from our outside vendors.  The data are then used to build data cubes.  Lately we have started to get a duplicate key error on the "County" attribute in our "Location" dimension.  The problem appears to be caused by these two values returned by the query that returns the distinct list of counties: Spree-Neisse Spree-Neiße These are German counties and they are really the same county, I believe.  Our data warehouse stores County as a varchar.  If I cast the stored value as nvarchar, the query that returns the distinct list of counties returns only the 2nd value and so should avoid the duplicate key error.  (I haven't tried it yet, just speculating.) This post suggests the root cause of the problem: http://ssas-musings.blogspot.com/2009/11/duplicate-key-error.html We don't have any control over the data before our vendors give it to us, and it comes from all over the world.  What is the best way to avoid occurrences of the duplicate attribute key error?  Should we be storing all our character data as nvarchar?  Would it be enough to cast the stored data as nvarchar when the cubes are being built?  Is there a better approach?  I'd like to get an idea of what the best practice would be.  Our warehouse

insert data in foreign key


I've two table 

a). Country

  1.CountryId  -PK

 2. Country Name




3.CountryId --FK to Country table

and my code is 

FWUDataContextDataContext CityContext = new FWUDataContextDataContext();
        tblCity objCity = new tblCity();
        objCity.City = City.City;
        objCity.CountryId= int.Parse(City.CountryId);

DataContextDataContext CityContext = new ataContextDataContext();
        tblCity objCity = new tb

Help creating an Add/Remove button for data entry

I have a form that is currently made up of 4 items:  DateTime Picker, Origin TextBox, Destination TextBox, and a read only Mileage TextBox. Each row represents one entry. I have two buttons next to each entry for Adding and Removing entry lines.  How would I go about coding those buttons to do just that?

SSRS 2005 - Extra Data (Characters) after SQL result



I ran into a snag with Reporting Services 2005. When I run a query in RS against SQL it returns me a result with some additional data (characters) + bunch of spaces!! So here is an example: my query returns a varchar, when I run it in SQL it is fine and returns me:


When I run it SSRS in the Data tab, I get "SHRIMP 5 SAMPLE E NET WT 5 SAMPLE                                                                                                                " (extra data and bunch of spaces)

It does it for all results. The extra characters are absolutelly unrelated to this record BTW so I have no clue where it's picking those up from!

Here is what I tried so far without any luck:

-I made sure the database is correct and I'm connecting to the correc

DataGridComboBoxColumn data binding for an Entity Framework foreign key relationship


I am using Entity Framework and want to show a foreign key relationship in a datagrid using a combobox; I cannot find any good instructions on how to do the data binding.  Here is a simplified example:

City: (CityID, CityName, StateID)  Collection: Cities
State: (StateID, StateName)  Collection: States

The Window constructor:

        public MainWindow()

            /* get a database context for the entity framework */
            MyEntities dbContext = new MyEntities();

            /* bind the data controls */
            this.DataContext = dbContext;

This XAML for the DataGrid will display the State Name as a Readonly Text Column:

                            <DataGrid AutoGenerateColumns="False"

Problem in displaying values for foreign keys in Dynamic data asp.net web app


I have the following tables in my database which are as given under:


Table 2: CREATE TABLE [dbo].[PromotionCodes]( [PromotionCode] nchar NOT NULL, [CustomerPromotionDiscountID] [int] NOT NULL, [EmployeePromotionDiscountID] [int] NOT NULL, [IsActive] [bit] NOT NULL, CONSTRAINT [PK_PromotionCodes_1] PRIMARY KEY CLUSTERED ( [PromotionCode] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]

There is a foreign key relationship between columns (1) PromotionID of table PromotionDiscountValues and CustomerPromotionDiscountID of table PromotionCodes and (2) PromotionID of table PromotionDiscountValues and EmployeePromotionDiscountID of table PromotionCodes

When i browse the PromotionCodes table in the dynamic data listing, the following columns get displayed:

  1. PromotionCode

  2. IsActive

  3. Prom

How to get xml to ignore "&" and "<" characters in the data?

As the title says.

    <subnode>some example text including an & character</subnode>

How to remove data connections dependancy from infopath forms?


Hi All,

In my Infopath forms there are hard coded data connections.

For example GetUserProfileByName data connection has url http://site_url:port/_vti_bin//UserProfileService.asmx?WSDL. Every time I want to publish the form to different site url, port, I have to modify such data connections. Is there any way to remove this dependacy or make it configurable from some central location.


Rahul Babar

Dot Net, Sharepoint, Infopath Developer

Data validation on a datetime column - or remove date part and only keep time part of the datetime2


Windows Server 2003, SharePoint Designer 2007, Windows SharePoint Services 3.0

I have a calendar list with start date(datetime1) and end date (datetime2).  Each is the default column created by the calendar list in SharePoint.  They both display a date and a time to choose from.

QUESTION:  Is there a way to remove the date section of the end date in a custom list form so that the user can only pick an end TIME?  Or, is there a way to force the end date (datetime2) to HAVE TO BE the same DATE as datetime1, only allowing for a different time?

Thank you!

Dynamic Data Foreign Key Filter - how to limit the # of dropdowns on the list view



I have a visual basic website in VS 2010 framework 4, linx to SQL, with scafolding.... and this dataclass has about 10 foreign key fields, of which all 10 are shown in the list view of the website.  I want the ability to exclude those filters from the list view (or exclude some and keep some), but without eliminating them from the edit forms.  Using <scafoldingcolumn("False")> does the trick to remove them entirely but that will also remove them from the grid/list itself, which I don't want, and remove the column from the edit record views, which I don't want either.

Any help would be great!!!!

Using jdbc driver1.1 The XML data row is truncated at 2,033 characters

I am getting big xml data (using FOR XML EXPLICIT in query ) from sql server 2000  but xml is truncated at 2,033 characters. I need full xml. Here is the jdbc code calling from java
       connection =  DbcpMgr.getConnection();   
        PreparedStatement pstmt = connection.prepareStatement(query);
        ResultSet rs = pstmt.executeQuery();
        if (rs.next()) {
Clob clob = rs.getClob(1); // I tried with getstream(),getString(),getBytes()

I tried with all above option but i did not work.
I found some solutions over the internet but those are in other languages(c#,.net.asp).

please help me.



Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.
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