You may want make sure that you have at least service pack 3 for SQL Server
2000.
Go to
http://support.microsoft.com/default.aspx?sd=tech&scid=kb;EN-US;q321185 for
information of how to identify your sql server pack version and edition. At
end of the article is info on how to get the latest service pack.
I'm not sure if this will help you, but this is what worked for me on the
PPC 2003 iPAQ 4350:
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Private Sub btnDisplayData_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnDisplayData.Click
Dim ds As New DataSet
Dim strCn As String = "Server=MyServer;Database=Northwind;" & _
"User Id=sa;Password="
Dim sqlConn As SqlConnection
Dim sqlDA As New SqlDataAdapter
Try
sqlConn = New SqlConnection(strCn)
sqlConn.Open()
MessageBox.Show("ServerVersion: " & sqlConn.ServerVersion &
ControlChars.Cr & _
"State: " & sqlConn.State.ToString())
sqlDA = New SqlDataAdapter("SELECT * FROM Customers", sqlConn)
sqlDA.Fill(ds)
'Display the table.
DataGrid1.DataSource = ds.Tables(0)
Catch errSql As SqlException
DisplaySqlErrors(errSql)
End Try
sqlConn.Close()
End Sub
Sub DisplaySqlErrors(ByVal myException As SqlException)
Dim i As Int32
For i = 0 To myException.Errors.Count
MessageBox.Show("Index # " & i & _
"Error: " & myException.Errors(i).ToString())
Next
End Sub
Sub FillError(ByVal sender As Object, ByVal args As FillErrorEventArgs)
If args.Errors.GetType() Is Type.GetType("System.OverflowException")
Then
' Code to handle Precision Loss
args.Continue = True
End If
End Sub
End Class
I hope that this helps.
Gigi
Tomer said:
Hi,
Well I've tried using those classes, but now I get when I try to open a
connection, this exception:
'PlatformNotSupportedException'
The running code is:
Dim strCn As String = "Server=MYSERVER;Database=Northwind;" & _
"User Id=sa;Password="
Dim sqlConn As SqlConnection
sqlConn = New SqlConnection(strCn);