.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

a problem in work with unicode chars in WHERE clause

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net


I'm designing a website for Persian language

I create a stored procedure that contain :

SELECT @sqlstring = ' SELECT TOP ' + CONVERT(nvarchar,@RowCountUser) + ' Stars FROM SpecialAds WHERE REPLACE(REPLACE(MainGroup,NCHAR(1610),NCHAR(1740)),NCHAR(1603),NCHAR(1705)) = ''REPLACE(REPLACE(' + @MainGroup + ',NCHAR(1610),NCHAR(1740)),NCHAR(1603),NCHAR(1705))'' AND Status = ''verified'' ORDER BY Stars Desc';

EXEC (@sqlstring)

no record is not returned and printed :

Invalid column name : ...

but when I change code above to :

SELECT TOP 5 Stars FROM SpecialA

View Complete Post

More Related Resource Links

Problem to use unicode chars in yahoo mail

Hi i have a problem to send email via smtpClient class to yahoo mail. if i send a unicode email from non-Yahoo account to yahoo mail, it works correctly (display unicode chars correctly without any making change), but when i send from yahoo account to yahoo mail, it does not display characters correctly and i should change it's encoding to UTF8. can anybody help me to work-around this problem ? Please see my previous thread in this link. thanks in advancehttp://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

Path Too Long Problem. Accessing filenames longer than 260 chars using unicode and kernel32.dll.

I found this article a few weeks ago that provided a way to access files and folders past the 260 char length:


I put the code from "Finding Files and Folders" in a dll and wrote an app in vb accessing these functions.  However, the code randomly breaks on a specific kernel32 function call. 

I noticed that if the search finds a file (not folder) longer than 12 to 14 characters then it breaks on occasion.  This is strange because I would think it would either never break or always break.

Here's the line where it breaks:

// find next

found = FindNextFile(findHandle, out findData);

Any ideas?


SSIS 2005 - Send Mail Task - signature appended to email is garbled - unicode problem?

Hi, I'm pretty new to SSIS so go easy on me. I have a Send Mail Task to notify if a file cannot be imported - the mailbody is created on the previous step by a VB.NET script task to include the name of the file and the path it's been archived to. The problem I'm having is that while the body of the email I've created is displaying fine, our company's Exchange server appends a signature to all emails, and this is coming up as undisplayable characters, presumably due to some kind of unicode encoding problem. I've tried casting the email body in an expression to DT_STR (doesn't work as DT_STR "cannot be converted to a supported type" which seems a bit odd but never mind), DT_WSTR (garbled signature), DT_TEXT/DT_NTEXT (strange error on this one - "Attempted to read or write protected memory") none of those ideas worked, and I'm a bit stumped now. Can anyone help? I'm using SSIS 2005 with SP3

problem with ajax control while upgrading website from 3.5 to 4.0 frame work



i am working on asp.net website.

on my web page i  submit some data on click at button , this block is inside update panel.

this functionality working fine in 3.5 frame work.

Now  our website is using 4.0 frame work.

controls inside update panel giving following error on submting data :

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500.

 thanks in advance

Unicode problem from ashx to SQL Express


Hi everyone,

i have an sql express db with a table, containing a nvarchar(max) field.

If i add a text in SQL Management Studio, for example, running the query: UPDATE table SET htmlcontent=N'text with special character: SS' WHERE id = 1

everything is working fine!. The special unicode character S is saved into the field.

In ASP i have a generic handler which handles my data communication to and from the database. No matter what i try there, the S char is not accepted and

changed into a question mark. I have tried several things in SQL:

- stored proc with sp_executesql and parameters

- hardcoded query in the ashx file.. 

            sqlStr = "UPDATE ELEMENTS SET htmlcontent=N'" & myCleanResult & "' WHERE id=" & id

            connStringSQL = New SqlConnection(mySqlConnection)

            Dim myAdapter1 As New SqlCommand(sqlStr, connStringSQL)


            result = myAdapter1.ExecuteScalar()


Problem with Exporting RDLC to PDF while Using Unicode(Marathi)


I Have An RDLC Report in ASP.net 2.0  Application.and SQl Server2008

I have installed IndicaIME for Marathi for unicode.

When I export It in to PDF that will not display correct (Word In Marathi Format)  I USe Ariel Unicode Font
But it  will show some  extra character display with word

e.g Instead of displaying "Kishor" it will display "kshir" in marathi
What I have do ? For that just give link or code To export RDLC report in PDF ?

Unicode (Marathi) Font problem in SSRS


I Have An RDLC Report in ASP.net 2.0  Application.

When I export It in to PDF that will not display correct (Word In Marathi Format) if I USe Ariel Unicode Font
it will show some  extra character display with word
What I have do ? For that just give link or code To export RDLC report in PDF ?

I also tried iTextsharp (Third party tool to generate PDF) but when it genrate PDF  marathi Characters are not displaying. It shows marathi as  blank space.

System.ServiceModel.Channels.Message class problem in work flow persistence


I have used following link to create a workflow to call web service(asmx) in workflow rehosting.


I have created the workflow successfully. But when i run the workflow and workflow goes for persistence it shows following pesistence related errors.

1.The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}SaveWorkflow was interrupted by an error.

2.Type 'System.ServiceModel.Channels.StreamedMessage' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types."

I think this error is related to serialization of Message class.

Can anyone suggest?




VS2010 Unicode closing cursor problem in transaction



I have problems with making a transaction after opening a cursor. I have an Unicode build, so to make the cursor writable I have to Connect the SQL Server 2008 with dynamic or dynasnap attribute. This I understand makes the cursor dynamic and when I open the cursor and make a transaction it closes the dynamic cursor. If I don't use UNICODE, everything works. How can I go around this problem?

RadioButton inside GridView, How to get it work as normal

Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid!

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Power of using Clause in SharePoint

The Using Clause will help to avoid memory leaks in SharePoint by automatically Disposing the MOSS objects.

For example when we create SPSite and SPWeb objects, if we don't dispose it explicitly it might create memory leaks,

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

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