??? ??? ?????? ??????? ??????? ????? ??? ????? ??????: "??????? ??? ????? ?? ????? 'System.Data.SqlClient.SqlException' ??? ?? system.data.dll"

?????? ????????? ?????? ?????????
???? ???????: 310368 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
?????? ??? ????? Microsoft Visual C# .NET ?? ??? ???????? ???? 311348.

???? ??? ??????? ??? ?????? ????? Microsoft .NET Framework ??? ????? ???????:
  • System.Data.OleDb
  • System.Data.SqlClient
????? ???? | ?? ????

?? ??? ??????

???????

??? ????? ??? ?????? ????? Microsoft SQL Server 7.0 ??? ??????? ??????? ????? ??? ????? ?????? ????? ????? ????? ????? ???????:
??? ??????? ??? ?????? ??? ??? 'System.Data.SqlClient.SqlException' ?? system.data.dll.
??????? ??????: ??? ????.
?? ???? ??? ??????? ?? SQL Server 2000.

?????

???? ??? ??????? ?? SQL Server 7.0 ???? ??? ??????? ?? ???? ????? ??????? ????? ??? ????? ??????. ????? ??? ??? ???? ????? ????? ????????.

?? ???? SQL Server 2000 ?????? ??????? above-mentioned ??? ???? ?? ??? ????? ????? ??? ??? ????? ????? ?????. ???? ??? ???????? ????? ????? ??? ??? ??? ????? ?? ??????? ???? ???.

????

??? ??? ???????? ?? ??????? ????? ??????? ??? ??? ????? ????????.

??????? ????

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

?????? ????? ???????? ???????? ??????? ???? ??????? Northwind ????? ????? ????????.
  1. ??? ????? Microsoft Visual Studio .NET.
  2. ????? ????? Visual Basic ????? Windows ????. ??? ????? Form1 ??? ??????? ???? ???????.
  3. ???? ?? ?? ????? ??????? ??? ???? ??? ????? ????? System.Data ?? ????? ???? ??? ????? ??????? ??? ??? ?? ???.
  4. ?? ???? ???? ?? ?? Form1. ????? ????? ??? ???? ??? btnTest ?????? ??????? Text ??? ??????.
  5. ?????? ????? ?????? ????????? ??? ?????? ????? ????System.Data.OleDb ? System.Data.SqlClient ???? ??? ?????? ????? ????????? ?? ????? ??????? ?????? ?? ????????? ????????. ????? ????????? ???????? ??????? ??? ???? "Declarations ???" Form1:
    Imports System
    Imports System.Data.OleDb
    Imports System.Data.SqlClient
    					
  6. ?? ?????? ???????? ???????? ??????? ??? ???? ????????? ???????? ??? ??????? "???? ????? Windows ????? ????????? ????????".

    ????????? ????? <username>"????? ????????" ????? ?????? = < ???? ?????? ?????? > ??? ????? ??????? ??? ????? ??? ????????? ????????. ???? ?? ?? "????? ????????" ???? ???????? ???????? ?????? ??? ??????? ??? ????? ????????.
        Private Sub btnTest_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btnTest.Click
            Dim myConnString As String = _
                "User ID=<username>;password=<strong password>;Initial Catalog=Northwind;Data Source=myServer"
            Dim id As Integer = 25
            Dim desc As String = "myFirstRegion"
            Dim rConn As SqlConnection = New SqlConnection(myConnString)
            rConn.Open()
            Dim command As SqlCommand = New SqlCommand("", rConn)
            command.CommandText = "insert into Region (RegionID, RegionDescription)" & _
                                  "values (@id, @desc)"
    
            'SQL Server 7.0 throws an exception here.
            'Comment the following line to resolve this problem against SQL Server 7.0.
            command.Prepare()
    
            command.Parameters.Add("@id", SqlDbType.Int, 4)
            command.Parameters.Add("@desc", SqlDbType.Char, 50)
            'You can call Prepare after you set up CommandText and parameters.
            command.Prepare() 
    
            command.Parameters(0).Value = id
            command.Parameters(1).Value = desc
            command.ExecuteNonQuery()
            MessageBox.Show("Updated Successfully")
        End Sub
    					
  7. ????? ????? ??????? (myConnString) ??? ?? ????? ?????? ?????? ??.
  8. ??? ??????? ????? ??. ?? ??????? ????? ? ???? ??? ???? ????? ???????.
  9. ???? ??? ??????. ??? ??? ?????? ?????? ?????? SQL Server 7.0 ?????? ????? ????????? above-mentioned.

    ??? ??? ?????? ?????? ?????? SQL Server 2000? ??? ????? ????????? ???????? ???? ???? ??? ???? ???? ????? "?? ??????? ?????".
  10. ??? ??? ??????? ?? SQL Server 7.0 ??????? ???? ??????? command.Prepare ???? ???? ?????? ????? ???????? ?? ?? ?????? ??????? ??? ????.

?????

?????? ??? ???? ?? ????????? ??? ?????? ADO.NET ????? ?????? ???? ??? ??????? Microsoft .NET Framework ????? ?????? ??????? (SDK) ???????:
?????? ??? ???????? ???????? ADO.NET
http://msdn2.microsoft.com/en-us/library/e80y5yhx(vs.71).aspx

???????

???? ???????: 310368 - ????? ??? ??????: 21/???? ??????/1435 - ??????: 2.8
????? ???
  • Microsoft ADO.NET 2.0
  • Microsoft ADO.NET (included with the .NET Framework)
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic 2005
  • Microsoft SQL Server 7.0 Standard Edition
????? ??????: 
kbnosurvey kbarchive kbmt kbtshoot kberrmsg kbnofix kbprb kbsqlclient kbsystemdata KB310368 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????310368

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

 

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