SQLServer : Problem in inserting Arabic data using ntext datatype

by Syed Aziz ur Rahman 8. March 2006 01:03

Have you ever tried to insert arabic data using ntext data type in SQL Server2000? I am sure you had. Did you face any strange problems? I had. It was a dotnet based desktop application. The strange problem was: If I insert english data, it comes back fine but if I insert arabic data, it gets corrupted. Strange, we were doing this in our web based news portal site and it is working fine there.


Then I dig into the problem. I came to know that if the data is smaller in size, it goes back and forth properly. But if it is a little bit bigger it gets corrupted. That was just heuristically tested. I figured that data bigger than 4000 char is making the problem. I checked the documentation but there is nothing there.

I consulted the guys responsible for news portal website. I asked them whether they are doing something special. Why they are not having this problem. Finally they reported that they encrypt the article contents before putting it in the database for security reasons and decrypting before displaying on the website.

They forwarded me the Encrypt/Decrypt class. I used the same technique and WALLAAAAA.... it worked. Now I can insert records bigger than 6000 and it is coming back just fine.

Cannot figure out the problem, unable to figure the solution as well. Just used CP technology (Copy Paste Technology) to solve the problem. I will dig into it more when I get some time. If you ever encountered such problem, please comment.




Default sa password in SQL Server Express

by Syed Aziz ur Rahman 26. November 2005 05:20

Referring to Khurram's Post , @Khurram ,Can you explain a little more on the "Installing SQL Express on Domain" problem. Do you want to install SQL Express on machine having the active directory and access using some other machine? Or
You want to install SQL express on a machine that is a part of a domain?

One question from my side. If you install web express, SQL express will be installed automatically without asking you anything :( . What will the default password for "sa" user? I have tried hard to change authentication mode of default instance ".\sqlexpress" to SqlServer mode but no success. Finally I installed another instance with the "Hide advance settings" unchecked so that I can select SQL Server mode and enter a desirable password. Is there any way around to change it?

SQL express is not much stable. There was no problems during installation but it is throwing exceptions here and there.




Changing Sql Connection dynamically in Crystal Reports 10 using DotNet

by Syed Aziz ur Rahman 20. July 2004 01:12


myReport As New crDB()
myReport.SetDatabaseLogon(Me.txtUserId.Text, Me.txtPass.Text, Me.txtServer.Text, Me.txtDB.Text)
Dim myLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table

Each myTable In myReport.Database.Tables
   myLogonInfo = myTable.LogOnInfo
   With myLogonInfo.ConnectionInfo
      .ServerName = Me.txtServer.Text
      .DatabaseName = Me.txtDB.Text
      .UserID = Me.txtUserId.Text
      .Password = Me.txtPass.Text
  End With

MessageBox.Show("Login Failed")
   End Try

   'Note: The next line is only necessary for SQL Server
myTable.Location = myTable.Location.Substring(myTable.Location.LastIndexOf(".") + 1)
Next myTable
CrystalReportViewer1.ReportSource = myReport

A very important piece of code is the assignment of the myTable.Location property (near the end of the listing). A requirement for changing the data source of a SQL Server table is that you must also change the Location property of the Table object. The Location property is a string value that has the name of the server as part of the string. It lists the database name, the table owner and the table name. For example, it looks similar to the following:


If you leave the Location property alone and don?t overwrite it, then the report?s server and database name won?t change. Instead, you have to reset it to just the table name. By removing the database name from the string, the report has to look at the new properties you just set to get this information. Consequently, this results in the server and database changing.

The easiest change to make would be to overwrite the Location property with a string constant. For example, the following line of code would overwrite it with the ?Customers? table.

myTable.Location = "Customers"

This works fine if the report only uses one table. But when you have multiple tables, you have to get more creative because you can?t assign the same table name to every table object. Rather than use a string constant, the code parses out the table name from the Location property and reassigns it to itself. This has the effect of resetting the value, but dropping the database name and table owner from the string.

myTable.Location = myTable.Location.Substring(myTable.Location.LastIndexOf(".") + 1)





ASP.Net | DotNet | SqlServer

Powered by BlogEngine.NET
Original Design by Laptop Geek, Adapted by onesoft