Showing posts with label across. Show all posts
Showing posts with label across. Show all posts

Friday, March 23, 2012

Pound Sign Problem

Hi

I have come across a bit of problem with my Web Form. I have standard textbox which inserts a value into a SQL 2000 database. However if I put a pound sign anywhere inside the text box and do the insert it disappears when I try and reshow the value.

I have checked the database field to see if it has been inputted but its no where to be seen.

So what has happened to my pound sign? any ideas?

I am using VS.Net 2003.

Thanks in advanceThat is strange. SQL 2000 does not reject the pound sign. Neither does the text box control. I did several tests, cannot seem to produce your problem. Do you do any kind of massage to your input in your code before it is insert into the database table?

Please post your code.|||Hiya

Sorry for the delay in getting back to you, please find below my code. This problem really does have me miffed

Cmd As New SqlCommand

Conn.Open()
With objCmd
.Connection = Conn
.CommandType = CommandType.Text
.CommandText = "INSERT INTO PhoneList (FirstName, Surname) " & _
" VALUES (@.FirstName, @.Surname)"

.Parameters.Clear()
.Parameters.Add("@.FirstName", SqlDbType.VarChar).Value = txtFirstName.Text
.Parameters.Add("@.Surname", SqlDbType.VarChar).Value = txtSurname.Text
.ExecuteNonQuery()
End With
Conn.Close()

Field types in theSQL Server 2000 DB are Varchar's. Just thought could this be one of the rasons for the roblem

Thanks in advance|||I have seen this problem before and I think the DataType on the column needs to beText to store ASCII characters.|||Hi PD

I have changed the data type to Text in my SQL DB but I still get the same problem

It just seems really odd, every other character works including !"$%^&*()

but the £ just does not get stored|||I was sleeping when I read your post, I thought you meant the # sign.

Themonetary data types MONEY and SMALLMONEY can accept many national currency symbols like the British pound, the Euro and others.|||How about if you use NVarChar instead?
Although you shouldn't have to go unicode in order to save the pound sign...

Regards
Fredrik|||Hi Fredrik

I have tried changing it to NvarChar and still didnt have any joy. I have even searched around on teh web and cant seem to find anybody else who has had that problem

Just wondering can anybody else replicate this problem there end?

I dont seem to have any hair left..... i think ive pulled it all out|||OK the only way I can seem to get round the problem is by inputting the HTML equvilant of a £ sign which is £

So when this is rendered it appears as a £

But im sure this cant be a solution.... can it?

I even tried to set validateRequest="false", but did not have any joy|||I am sorry. I thought it was # as well.
I did a test. Cannot re-produce the problem. I am using Varchar for the data field.

Did you try to debug and see whether the pound value was passed in correctly?|||Here is my test code in C#. I just have a textbox at the front end.


conn.Open ();
string strInsert = "Insert Into Chun (Test) Values (@.chun)";
SqlCommand cmd = new SqlCommand (strInsert, conn);
SqlParameter p = new SqlParameter("@.chun",SqlDbType.VarChar,50);
p.Value = txtPound.Text;
p.Direction = ParameterDirection.Input;
cmd.Parameters.Add (p);
cmd.ExecuteNonQuery ();
conn.Close ();

Here is the value I entered in the text box:

£5432

The value is stored and retrieve displayed as it is.|||I have a similar issue when I pass the # as part of a query string! It chops everything off after the pound sign!|||I did eventually manage to solve my pound sign problem, it was a problem with the globalization setting in the web.config.

Try reading the below article and see if it helps

http://www.howtodothings.com/showarticle.asp?article=755

Good luck

Post-Relational Databases

I just recently came across Post-Relational databases, strange I never heard
of them before. Anyone any experience of them, are they going to be the next
generation of databases as I heard one guy claim!?
Thanks
NYes, that old dilemma - is reality made up of relations or objects? :)
ML
http://milambda.blogspot.com/|||So its just an OO Database. I'm a relational man myself!
"NH" wrote:

> I just recently came across Post-Relational databases, strange I never hea
rd
> of them before. Anyone any experience of them, are they going to be the ne
xt
> generation of databases as I heard one guy claim!?
> Thanks
> N|||I thought we realted objects in the relational database :)
"ML" wrote:

> Yes, that old dilemma - is reality made up of relations or objects? :)
>
> ML
> --
> http://milambda.blogspot.com/|||ML wrote:
> Yes, that old dilemma - is reality made up of relations or objects? :)
>
Neither. Both are abstractions. What does "post-relational" mean to
you?
More appropriate for comp.databases.theory anyway.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||> Neither. Both are abstractions.
Absolutely. No argument there.

> What does "post-relational" mean to you?
Seriously? Well, no offense indended but the first time I heard this
expression I thought it had to do with divorce. Maybe even a weird
puritanistic definition of the state two (or more) sexual partners are in
after sexual intercourse.
ML
http://milambda.blogspot.com/|||"ML" <ML@.discussions.microsoft.com> wrote in message
news:9E68AE41-2414-4B49-A8BE-FC078B2D4BA8@.microsoft.com...
> Absolutely. No argument there.
>
> Seriously? Well, no offense indended but the first time I heard this
> expression I thought it had to do with divorce. Maybe even a weird
> puritanistic definition of the state two (or more) sexual partners are in
> after sexual intercourse.
>
> ML
> --
> http://milambda.blogspot.com/
I get it. NH's posts didn't show up at first so I thought you started the
thread.
Post-relational is what XML fans call the hierachical model. The rest of us
call it Pre-Relational.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx|||A brief look at Matisse (for example) gives the impression of another layer
of abstraction on top of a "regular" relational model.
Sometimes abstraction is good, but sooner or later...
abstraction = confusion
ML
http://milambda.blogspot.com/|||> Post-relational is what XML fans call the hierachical model. The rest of us call it[color
=darkred]
> Pre-Relational.[/color]
LOL!
That's a classic.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:es6j0GzfGHA.5092@.TK2MSFTNGP04.phx.gbl...
> "ML" <ML@.discussions.microsoft.com> wrote in message
> news:9E68AE41-2414-4B49-A8BE-FC078B2D4BA8@.microsoft.com...
> I get it. NH's posts didn't show up at first so I thought you started the
thread.
> Post-relational is what XML fans call the hierachical model. The rest of u
s call it
> Pre-Relational.
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>
>|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1148473208.702352.33010@.g10g2000cwb.googlegroups.com...
> More appropriate for comp.databases.theory anyway.
Yup. We never get into theory in this forum.
=P