????? ?????? ??? ????? ?????? ??????? ?? ???? ??????? ADO.NET ?? Visual Basic .NET

?????? ????????? ?????? ?????????
???? ???????: 308043 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ????? ??????? ????????? ??????. ?????? ??? ???? ?? ????????? ??????? ??? ?????, ????? ??? ?????? ??? ??????? ????? ????? ?????. ??? ??????? dicusses ????? ?????? ??? ????? ?????? ??????? ??? ??????? ADO.NET ?? Visual Basic .NET.


???????

???? ??????? ??????? ??????? ?????? ??? ????? ?????? ???????? ?????? ? ??? ??????? ???? ???????:
  • ???? ??? Microsoft .NET
  • Microsoft Visual Basic .NET
????? ??? ??????? ??? ??????? ??? ???????? ???????:
  • ?????????
  • Microsoft OLE DB
  • ?????? ???????

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

?????? ??? ??????? ???? ??????? ??? ????? ??????? ?????? ????????? ???????? ?? ???? catch ???? ?????? ????????? ? ?????? ???????? ????? ?? ??? OleDbException.
  1. ??? ????? Microsoft Visual Studio .NET ?? ?? ?????? ????? ????? Windows ???? ?? Visual Basic .NET. ??? ????? Form1 ???? ???????.
  2. ??? Form1.vb ?? ????????? ???????? ???? ???????? ???????? ??????? ?? ?? ???? ???????? ???????? ?? ????? ???????:
    Imports System.Data.OleDb
    					
  3. ?? ???? ???????? ???????? ??????? ?? ????? Form1 ?????:
    Dim ex As OleDbException
    Dim cn As OleDbConnection = New OleDbConnection("Provider=SQLOLEDB.1;Data Source=MyWrongServerName")
    Try
        cn.Open()
    Catch ex
        Dim i As Integer
        For i = 0 To ex.Errors.Count - 1
            MessageBox.Show("Index #" + i.ToString() + ControlChars.Cr _
               + "Message: " + ex.Errors(i).Message + ControlChars.Cr _
               + "Native: " + ex.Errors(i).NativeError.ToString() + ControlChars.Cr _
               + "Source: " + ex.Errors(i).Source + ControlChars.Cr _
               + "SQL: " + ex.Errors(i).SQLState + ControlChars.Cr)
        Next i
    End Try
    					
  4. ?? ?????? ???????. ??? ?? ???? ???? ????? ??? 10 ??? 15 ?????.

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

??? ??? ???? ???? ???? "MyWrongServerName" ?? ?? ????? ???.


?????

?????? ??? ???? ?? ????????? ??? ????? .NET ??????? ???? ???? MSDN ??????:
???? .NET ????? ?????
http://msdn.microsoft.com/en-us/library/ms810268.aspx

???????

???? ???????: 308043 - ????? ??? ??????: 28/???? ??????/1435 - ??????: 2.3
????? ???
  • Microsoft ADO.NET (included with the .NET Framework)
  • Microsoft ADO.NET 1.1
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Visual Basic .NET 2003 Standard Edition
????? ??????: 
kbnosurvey kbarchive kbmt kbhowtomaster kbsystemdata KB308043 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????308043

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

 

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