ASP.NET and SQL Server Language Problem

  • Thread starter Stelios Skiathitis
  • Start date
S

Stelios Skiathitis

Having con as an open connection I try to execute the following code

Dim strSQL_NewSender As String
Dim cmdInsert As SqlCommand
Dim intRecIns As Integer

strSQL_NewSender = "INSERT INTO SENDERS (SndName, SndEmail) VALUES
(@SenderName, @SenderEmail)"
cmdInsert = New SqlCommand(strSQL_NewSender, con)
cmdInsert.Parameters.Add("@SenderName", txtSndName.Text)
cmdInsert.Parameters.Add("@SenderEmail", txtSndEmail.Text)
Response.Write(cmdInsert.commandText)
intRecIns = cmdInsert.ExecuteNonQuery()
con.Close()

Unfortunately when in the TextBox txtSndName I enter greek characters in the
sql server table (SENDERS)
a blank value is stored. When i use english characters it is stored
successfuly.
The database collation is greek_ci_ai and I'm using
windows-1253 (greek) encoding in the aspx script.

I must note that the above script is executed within a control ascx file.
the control called from an aspx file which has the windows-1253 encoding.

How can I fix this vulnerability?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top