How to store strings that consists of characters like (aaoAAO) in a database by using a detailsview?  
Author Message
Ylva





PostPosted: .NET Framework Data Access and Storage, How to store strings that consists of characters like (aaoAAO) in a database by using a detailsview? Top

Hello everybody

I'm trying to insert/update values in a database by using a detailsview.

It works fine if my input string consists of only characters like ( a-z, A-Z).

But i also need to use charachter like( aaoAAO), but these values are stored as

(å ä ö Å Ä Ö ) in the database, why

How can these values be validated so they are stored in a proper way

Regards Ylva



.NET Development15  
 
 
Luis D. Rojas





PostPosted: .NET Framework Data Access and Storage, How to store strings that consists of characters like (aaoAAO) in a database by using a detailsview? Top

hi,

which database are you using

if it is sqlserver, just use nvarchar type for your fields types.

if you are using oracle, then is more complicated, because it is related with the language in which the database was installed.

Best Regards



 
 
tangfx





PostPosted: .NET Framework Data Access and Storage, How to store strings that consists of characters like (aaoAAO) in a database by using a detailsview? Top

by default, detailsview store the UNICODE value for every field, you can set HtmlEncode attribute to false in the Field element of DetailsView's Fileds in aspx page, like this:

<asp:DetailsView ID="DetailsView1" ...........>

<Fields>

<asp:BoundField DataField="f1" HeaderTextr="h1" HtmlEncode="false" />

.......

</Fields>

</asp:DetailsView>


 
 
Ylva





PostPosted: .NET Framework Data Access and Storage, How to store strings that consists of characters like (aaoAAO) in a database by using a detailsview? Top

Thanks for this help, it solved the problem

Regards Ylva