.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

special character wrongly inserted

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
I have a gridview with checkbox column.  I loop through all the rows of gridview, if it's checked I enter the second column text into my database.The second column text at one point shows the word  Küche, but when I take that text (in order to insert it in db) it gives me Kücheand that's what I see when I then read it from db.

View Complete Post

More Related Resource Links

problem to convert special character in export to csv

I am using FIleStream object to write .csv file from dataTable/Dataset.It is working fine. But when i got special character in my DataTable like $, @, # ect. it will convert these convert in encoded form( which can't be readable i.e.  â,¬ etc). FileStream flStream;astrFileName = HttpContext.Current.Server.MapPath("~/files/FtpFiles/Download/") + astrFileName + ".csv";if (File.Exists(astrFileName)){flStream = new FileStream(astrFileName, FileMode.Truncate, FileAccess.Write);}else{flStream = new FileStream(astrFileName, FileMode.Create, FileAccess.Write);}StreamWriter objSw = new StreamWriter(flStream);DataTable objDt = idtInstance;//Get No Of Column in GridView int NoOfColumn = objDt.Columns.Count;//Create Header for (int i = 0; i < NoOfColumn; i++){objSw.Write(objDt.Columns[i]);//check not last column if (i < NoOfColumn - 1){objSw.Write("||");}}objSw.Write(objSw.NewLine);//Create Data foreach (DataRow dr in objDt.Rows){//if (dr["GCMSCaseNumber"].ToString() == "14222")//{// string desc = dr["Updates"].ToString();//}for (int i = 0; i < NoOfColumn; i++){string sData = dr[i].ToString();sData = sData.Replace("<br>", " ");sData = sData.Replace("<br/>", " ");sData = sData.Replace("\n", " ");sData = sData.Replace("\t", "

How to prevent special character encoding when using xslt value in javascript variable

Hi, I've created a dataview and inserting a little bit of javascript. I need to store one of the xslt values into a javascript variable. The problem is that when I get the value into my javascript variable, it is already encoding special characters . for example, instead of "<", I get "&lt;" Am I doing something inaccurate here? I even tried using the javascript unescape() function, but that didn't work. would you be able to advise how to get the xslt value into a javascript variable as it is without having the original data changed? <xsl:template ... ... <SCRIPT type="text/javaScript"> <![CDATA[ ...     var myData = ']]><xsl:value-of select="@sampleData" disable-output-escaping="yes"/><![CDATA['  ;  ... ]]> </SCRIPT> Pman http://www.pmansLab.com/

Best Method to remove special character from string

I am trying to remove the special characters from a string that was entered by the user.  I am not sure the best method to do this.  i can get a foreach of all the characters but what do i check it against?
Christian - developer

Regular Expression to avoid space and special character



I would like to have an regular expression that does not allow any spaces(before,within,after the word) and alphanumeric characters.

Thanks in advance.



Special Character Translation

I built a view in Designer that's pulling data from a list.  When I deployed the view to SharePoint, I discovered that special characters entered into the list don't display correctly.  For example, "-" is displayed as &#39.  Is there a solution for this translation issue?

How to write storeprocedure update special character in Sql server 2005


Hi All,

I am using Sql Server 2005,My table structure is below.

Create Table ComentTable(id int,coments varchar(4000))

insert into ComentTable values(1,'sanjay I don%27t Know Tamil Language')

insert into ComentTable values(1,'sanjay I don%27t Know Kanar Language')

how to write storeprocedure update coments column replace %27 to &#39;

Replace special character with space throughout the database



My requirement is to replace the special characters with space throughout the databse. How can I do this? I am new to this sql server. So any one could you please help me in this aspect.

Thanks in advance

Special character problem



Using a gridView to read some data from a SQL database.

The user can select a record in the gridview.

On the SelectedIndexChanged property I populate this to a couple of text boxes & drop down list ; txtCountry,ddlProvince,ddlCity.

I have special characters in France ( accent marks) and when I populate it to the drop down list it fails giving out the error message

"SelectedValue which is invalid because it does not exist in the list of items".

Example of items that I try to populate are as follows. ( separated by commas)


When I looked in the drop down lists for Province and Cities  I see those Provinces there in the item list.

When I debug line by line the word ÃŽLE-DE-FRANCE comes out like  &#206;LE-DE-FRANCE  which is not there in the drop down list.  Got to know the ÃŽ is typed by pressing down ALT+206 and lloks like this is what is coming in at the start of the string above.

Any suggestions how to overcome this issue?


PS: The drop down lists for Province and Cities are also populated from the same SQL Database which has the above accent characters. The list that is displayed c

Loading Data from excel without Special character and similar match

Hi All I have data In excel in the below format Id Address Name 1 #302Bangalore Sanjeev 2 No302Bangalore Sanjiv 3 500 Bangalore Ramesh I want to dump this excel data into SQL table . I want my output to come in my table in below format ID Address Name 1 302bagalore Sanjiv 3 500Chennai Ramesh All the data should come only once and there was a spelling mistake (Sanjeev and Sanjiv) also Address should start with number E.g 302 or 500,there should not be any special character or text before integer in Address .. I have taken Excel source and OLEDB destination Transformation,but what other Transformation should I used to achieve this, I tried using Derived column but didnt help,How to use it here..

concat a special character (ampersand)?



In DFWP XSLT, I am using a Concat funtion inside my href code. I would like to add an ampersand character in URL.

<a href="{concat('Lists/mylist/dispform.aspx?ID=',@ID,'amp;','blah)}">

I want my link to be like this:  http://sp/lists/mylist/dispform.aspx?ID=1&blah

I've tried:
%26  => This generates http://sp/lists/mylist/dispform.aspx?ID=1%26blah  which did not work well. I need really "&" itself.
&amp; => This generates http://sp/lists/mylist/dispform.aspx?ID=1&amp;blah  I cann't set disable-output-escaping property since it's a href tag..

Any idea? Thanks.

Using RegEx, how to find substrings enclosed by a special character


Let’s say, special character is: $

Input string: This $abc$ and $def123$ is a test

Desired output:




I tried: @“\$.*?\$"


Got the output as:



WebMatrix conversion failed when converting from a character string to uniqueidentifier?


I am trying to retrieve xml from a small function in my .cshtml page. Its throwing me an error. This however, runs fine in a console/form environment.

It takes 3 parameters and 1 exception.

myDll.GetXML(year, username, uniqueidentifier, out ex);

When I run this page I get the error, "Conversion failed when converting from a character string to uniqueidentifier."

Or a stack of.

System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBeha

how to get id value from the row inserted in a table with thr trigger.


I have a reports table with column report id and and report version. I created a trigger on this table to execute an application to do some processing each time a row is inserted in reports table. I need to pass the new report id execute this application from the trigger. How do I get the report id from the row that was inserted?


Web Deployment Projects (WDP) arabic character



I built web project using asp.net & c# in VS2005 and i use arabic label in my project and every think working good when i run my application. but when i use WDP to make msi file All arabic letter come like ?????. 


Aero Glass: Create Special Effects With The Desktop Window Manager


In this article we introduce the Desktop Window Manager, the new interface that manages how windows are rendered on the Windows Vista desktop.

Ron Fosner

MSDN Magazine April 2007

DirectX 8.0: Enhancing Real-Time Character Animation with Matrix Palette Skinning and Vertex Shaders


DirectX 8.0 allows the creation of smooth and realistic character movements that are more life-like than simple articulated structure animations. This is made possible by its improved support for vertex tweening and blended vertex deformations, also known as soft-skinning. After a brief history of the use of these techniques in DirectX, soft-skinning using the fixed function pipeline is discussed. This is followed by the use of matrix palettes from within vertex shaders to create a customized soft-skinning solution that takes advantage of the benefits of vertex shaders, such as hardware acceleration and custom lighting algorithms without the limitations of fixed-function solutions.

Benjamin Freidlin

MSDN Magazine June 2001

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