469,602 Members | 1,979 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Windows CE.NET System.Data.SQLCLIENT namespace help

I know that windows CE has a SQLCE client namespace but i do not want to use
it because it needs to download my sql tables to a local sql database on the
CE.NET client machine. I would rather have my client do a stright connection
to my SPROC'S running on my sql server and have my SPROC'S do some work or
send back a resulting record. I have hooked the sqlclient in my vb.net app
and here is my code: (* the solution bombs out on the myconnection.open
statement. no descriptive err message is given.)

<code>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim connectionString As String
connectionString = "Persist Security
Info=False;database=pwms;server=utog9_sql,1433;Use r
Id=sa;password=mypassword;"
' Create Instance of Connection, Command Object
Dim myConnection As New SqlConnection(connectionString)

Dim myCommand As New
System.Data.SqlClient.SqlCommand("JOHNSTEMPTABLEFO RUNITLOADS", myConnection)
'Dim ResultReader As SqlClient.SqlDataReader
Dim SQLString As String
Dim sid As String
i = i + 1
sid = i

' Mark the Command as a SQL
myCommand.CommandType = CommandType.Text

MsgBox("here1")
' Open the database connection and execute the command
myConnection.Open()
MsgBox("here2")

SQLString = "insert into JOHNSTEMPTABLEFORUNITLOADS
(UnitLoadQuery) VALUES ('" & sid & "')"

'execute command

myCommand.CommandText = SQLString
myCommand.ExecuteNonQuery()
MsgBox("DONE")
myConnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
</code>

any suggestions on how to have a sqlclient connect to a sql server from a
CE.NET client by not using the SQLCE namespace. I can't even find examples
on how to do this.

cheers.
JoHn
Apr 13 '06 #1
0 1845

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.