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

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

?????

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

????

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

    ???:ASP.NET ??????? ??? ?? ??? ???????? ???, ???????? ?? ????? ???? ?? ??? ?? ????????? ??? ??? ??? ???????? ??????? ?????? ??? ?? ???? ?? ????
  • ???????? ?????? ???? ?????? ??? ?? ????????? .NET Framework ??? ??? ?? ???? SQL ????? ??? ???? ?????? ?? ??? ????? ?? ???? ??? ?? ?????? ???? ?? ???? ???

    ?????? ?? ???, ?? ?????? SQL Server ???????? ??????,nvarcharn ?????? ?? ??-?????? ??????? ???? ???? ???? ??? "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?????? ?? ??? ??C#destructor.
  • ????????? ????SqlDbType?? ??? ???SqlParameter???????? ???? ???? inferred ?????? ???? ???
  • ???? ?????? ?? ?????? ??? ?? ?? ???????? ???? ????????? ?????

??????

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

???

???? ID: 827366 - ????? ???????: 05 ?????? 2010 - ??????: 7.0
???? ???? ???? ??:
  • Microsoft .NET Framework 1.0
??????: 
kbprb kbmt KB827366 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??: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