""??? ???? "???? ???????? ?? ???? ? ????? ????? ?? ??? ???? SQL ??? ??????? ???? ???? .NET ???? SQL

?????? ????????? ?????? ?????????
???? ???????: 827366 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

???????

??? ??????? ??? Microsoft .NET Framework SqlClient ????? ????? ????? ??????? ?? ??? ????? Microsoft SQL Server 2000:
17805 ???: ???????: ???? 20 ?: 3
???? ?? ???? ?????? ?????? ??? ????.
???? ????? ????? ??????? ??????? ?? ????? ???? Microsoft .NET Framework:
System.Data.SqlClient.SqlException: ??? ??? ??? ?? ????? ??????. ??????? ? ?? ????? ??? ?? ??? ?????

?????

???? ??? ?????? ??? ???? ??? ???????????? ???????:
  • ?????? ??? SqlClient ?? ????? Finalize ?? ?? destructor C#.
  • ?? ???? ????? SQLDbType ???? ??? ????? ???? SqlParameter. ??? ??? ????? ????? SQLDbType ????? ? "???? ????????" Microsoft .NET Framework ?? SQL Server (SqlClient) ????? ??? ??????? SQLDbType ??????? ???????? ??? ???????? ???? ??? ???????. SqlClient.
  • ????? ???? ??? SqlClient ???? ????? ?? C# ?? ???? ?????? ?? Visual Basic. ?????? ???? ?????? ????? ???? ?????? ?? ???? ????? ???? ?? ???? ?? ???????.

    ?????? ?? ???? ASP.NET ?? ?? ??? ??????? ?? ?????? ?????? ????????? ??? ??? ??? ????? ?? ?????? ????? ?????? ???? ???? ?? ????????? ???????? ???????.
  • ??? ????? ???? ?????? ???? ???? ?? ????????? ???????? .NET Framework ???? ?? ????? ?????? ???? ????? ????????? ???? ???????? ?? SQL Server.

    ??? ???? ??????? ???????? ??? SQL Server ???????? ? nvarchar ?????? ??? Unicode ??? ????? ?? ?????? n. ??? ?? ???? "n" ???? ?? 1 ??? 4000. ??? ??? ?????? ??? ??? ???? ?? 4000 ??????? nvarchar ????? ????? ????? ??????? ?? ??? "???????".
???? ???????? ???????? ??????? ????? ????? ?? ???? ??? ???????:
Stored Procedure
--------------------------

CREATE PROCEDURE spParameterBug @myText Text AS
            Insert Into ParameterBugTable (TextField) Values (@myText)

Code
-------
static void Main(string[] args)
{
       string dummyText=string.Empty;
       for (int n=0; n < /*80*/ 3277; n++)   // change this to 80 to receive the second error that is mentioned earlier in this article.
       {
             dummyText += "0123456789";
       }

        // TO DO: Change data source to match your SQL Server:

       SqlConnection con= new SqlConnection("data source=myserver;Initial Catalog=mydb;Integrated Security=SSPI;persist security info=True;packet size=16384");
       SqlCommand cmd = new SqlCommand("SpParameterBug", con);
      con.Open();
           // Causes error 17805:
      SqlParameter param2 =new SqlParameter("@myText", dummyText);
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.Parameters.Add(param2);
      try
      {
          cmd.ExecuteNonQuery();
      } 
      catch (Exception err)
      {
         Console.WriteLine(err.ToString());
      }

      Console.ReadLine();

}

????

??? ??? ???????? ???? ?? ????? ?? ???:
  • ?? ?????? ??? SqlClient ?? ????? Finalize ?? ?? destructor C#.
  • ????? ????? SqlDbType ????? SqlParameter ???? ?? ???? ??? inferred ????.
  • ????? ??? ????? ??? ?????? ??? ????????.

?????

????? ?? ????????? ??? ???? ?????? ???? ????? ?????? ?????? ?????? ????? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn2.microsoft.com/en-us/library/aa276823(SQL.80).aspx
http://msdn2.microsoft.com/en-us/library/aa258271(SQL.80).aspx

???????

???? ???????: 827366 - ????? ??? ??????: 01/???? ??????/1428 - ??????: 3.4
????? ???
  • Microsoft .NET Framework 1.0
????? ??????: 
kbmt kbprb KB827366 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????827366

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com