.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

Unicode problem from ashx to SQL Express

Posted By:      Posted Date: October 17, 2010    Points: 0   Category :ASP.Net

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()


View Complete Post

More Related Resource Links

Deploying problem with SQL Express 2008 R2

Scientific software package works fine with SQL Express 2008 R2 on developing (mother) PC and Admin login mode, but difficulties are found elsewhere during installing and deploying on the client PCs.  We have used from year 2000 BDE (Borland Database Engine), which worked fine until now, but recently customers had been installing problems with Vista, Windows 7 and the local administration rights or permissions.   Thus I thought to test NT AUTHORITY\NETWORK SERVICE authentication, as this system is hopefully working again decades with coming new Windows versions. As not need to touch databases, ADO and authentication matters during last decade, I’m newbie with those topics.  Worked now few days with this problem, installed and unistalled SQL servers according to instructions, tested different connecting strings and now cannot found correction.  Solution is maybe and hopefully simple.   Attached is log data cut from (old and many times corrected) the main mother XP platform in Admin and Client (Guest) modes.  Same tests are done also with fresh XP installation on VirtualBox.  Used connecting strings are presented inside log files:           Main mother XP at Admin login:   2010-08-20 08:24:45.82 Server      Server local connection provider is ready to accept connection on [ \\.\pip

Problem connecting to SQL Server 2008 R2 Express from Access 2007

I have a problem with SQL Server 2008 R2 Express with MS Access 2007. I am running Windows 7 with 8 gigs memory. I installed SQL Server 2008 R2 Express. Do I now need to install SP1 because I am running with Windows 7? I can open SQL Server using the Management Screen but I cannot connect to MS Access 2007 using SQL Server Express as the database. When trying to connect to SQL Server from Access 2007, I keep getting the message that SQL Server 2005 cannot be found. It will not allow me to sign onto sql server 2008 stating that it cannot be found. Do I have to now run the SQL Server 2008 R2 Express SP1? Is there an upgrade to MS Access 2007 which will allow me to use SQL Server 2008 R2 Express?

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

SQL Express 2008 R2 Installation problem (getting error in silent installation)

Hi, I create install script that will install my application and also "Microsoft SQL Server Express 2008 R2"  (32 BIT) engine + Advanced tools (without the Management Studio). It been installed successful on Windows XP SP3 but on windows 7 i get an error. The full logs and Setup configuration are in the link files below. I will be grateful for any answer. Thanks, Shai. Log Files:  - **"MySetup.ini" file:**   http://justpaste.it/MySetupini  - **"ConfigurationFile.ini" that been generate by installation:** http://justpaste.it/ConfigurationFileinitxt  - **"Summary.txt file from "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log":**  http://justpaste.it/Summarytxt  - **"Details.txt" file that been created at "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100728_102314":**  http://justpaste.it/Detailstxt

SQL Express 2008 R2 Installation problem (getting error in silent installation)

Hello, I created install script that will install SQL Server 2008 R2 on windows XP SP3, windows vista and windows 7.  One of the command that i used in the installation is for silent installation of SQL Server 2008 R2. When i install it on windows XP everything works just fine but when i try to install it on Windows 7 i get an error. What am i doing wrong? Here is the command line that i use:  "Setup.exe /ConfigurationFile=Mysetup.ini" Mysetup.ini file: -------------------------------------End of ini file --------------------------------- ;SQL SERVER 2008 R2 Configuration File ;Version 1.0, 5 May 2010 ; [SQLSERVER2008] ; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will reflect the instance ID of the SQL Server instance. INSTANCEID="MSSQLSERVER" ; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter. ACTION="Install" ; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, RS, IS, and Tools. The SQL feature will install the database engine, replication, and full-text. The Tools feature will install Management Tools, Books online, Business Intelligence Development Studio, and other shared components. FEATURES=SQLENGINE ; Displays the command line parameter

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 upgrade from SQL 2008 Express to SQL Server 2008 Enterprise

I use the wizard "Maintenance > Edition Upgrade". When I choose the instance of SQL Express 2008 and click Next I get the error "Rule SQL 2008 edition upgrade failed. The selected SQL Server instance does not meet upgrade matrix requirements."What can I do to ugrade ?

sql express 2008 64bit, will this be a problem?


Hi, I'm developing a site on sql express 2008 64bit + VS 2010 Express. Then, I realize that when it is done, the hosting maybe only provide 32bit server.  Will this be a problem? Do I have to do extra steps, for example, convert the 64bit sql DB file to 32bit SQL DB file, then can attach to the server?


Problem uninstalling or reinstalling SQL Server 2008 Express


Hi all, as still a novice user, I am looking for some advise on a problem I am currently having with SQL Server 2008 Express. Thanks in advance.

I had a copy of SQL Server 2008 Express installed on my XP machine. Recently I tried to uninstall it, so that I can install a clean copy of 2008 R2. The uninstallation failed halfway, and subsequently, the SQL server does not start or even allow me to reinstall/uninstall or put in the Microsoft updates meant for the SQL Server 2008 express.

Need advice on how to remove it cleanly, and I do not require any of the database on the current installation. Appreciate any advice.

Below is a copy SQL Server Error Log when I tried to redo the uninstallation:

 Copyright (c) 1988-2008 Microsoft Corporation
 Express Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)

2010-09-18 22:34:50.09 Server      (c) 2005 Microsoft Corporation.
2010-09-18 22:34:50.09 Server      All rights reserved.
2010-09-18 22:34:50.09 Server      Server process ID is 4236.
2010-09-18 22:34:50.09 Server      Authentication mode is WINDOWS-ONLY.
2010-09-18 22:34:50.09 Server      Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Se

a problem in work with unicode chars in WHERE clause



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

sql 2005 express restore problem



i try to restore a bak file from another sql2005 server to my sql2005 server, but it show the error message as below :



TITLE: Microsoft SQL Server Management Studio Express

Restore failed for Server 'CLIENT193\SQLEXPRESS'.  (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476


System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'MedicalStore' database. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476






pls some one can help me ???



sql server express problem



I know this is not the best place for this post but i didn't get any help in the sql section so maybe someone here knows something about this.

i've created a database in sql server ex. 2008 but when i tried to use it at another computer i keep getting this message:

The database "<data base path>" cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
Could not open new database "<data base path>". CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file "<data base path>"  failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. 

how can i solve this?

many thanks

Problem adding a View to a Controller in VS 2010 Express


Hi all,

I am very new to ASP.Net Forums and just starting up with MVC2.

For that, I was trying to build MVCMusicStore Application based upon the guidelines from ASP.Net site.

But when I am trying to add a view from controller or from Solution Explorer. VS stops responding.

I am using Windows 7 Enterprise as an OS and Microsoft Visual Web Developer 2010

Is it a problem related to installation or something else???

Please help me out... :(

sql server express 2008 problem


We just recently switched from Visual Studio 2008 to Visual Studio 2010. I have an application which uses sql express database locally. The problem is after installing new Visual Studio, I can't access the Sql Server 2008 express. When I try to create a new database, or change the existing one, I get following message:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and and that SQL Server is configured to allow remote connections. (provider: TCP Provider, Error 0 - No connection could be made because target machine is actively refused it.)

When I check the sqlexpress windows service, it is stopped. If I try to enable it, it runs for a few seconds and then stops again.

Problem with "Error 0xD59 when trying to install the Microsoft SQL Server Express edition Service Pa

Hi Folks,

I've been jumping from site to site trying to find a solution for this and still no luck.  I have tried this update many times but it always fails.  I have the results of the installation log here if it helps.  I am on HP hardware using XP.  Any help is most appreciated.  Thanks for reading!

Time: 11/30/2009 06:25:09.718
KB Number: KB955706
OS Version: Microsoft Windows XP Professional Service Pack 3 (Build 2600)
Package Language: 1033 (ENU)
Package Platform: x86
Package SP Level: 3
Package Version: 4035
Command-line parameters specified:
Cluster Installation: No

Prerequisites Check & Status
SQLSupport: Passed

Products Detected                         Language  Level  Patch Level       Platform  Edition
Express Database Services (MSSMLBIZ)      ENU       SP2    2005.090.3042.00  x86       EXPRESS

Products Disqualified & Reason

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 ?

SQL Server Express 2008 vista x64 installation rpc problem

Hi Folks,

I am trying to install SQL Server 2008 Express in a brand new workstation with Vista Business x64 and I am keep on getting this error:

"The following error has ocurred: The RPC server is unavailable..."

At the same time this alert message is displayed:

"Windows has encountered a critical problem and will restart automatically in one minute. Please save your work now"

After a while (~1 minute) the computer reboots, but I am not able to log on as usual. I have to reboot manually the computer in "safe mode" first. 

Trying to reduce the problem I reinstalled the OS and only run the recommended Windows updates. Other than that the computer is in the absolute initial state. (The firewall is not the problem since I already tried it after disabling it)

Any clue !!!!!


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