Re: Call a stored proc. from a Smart Device.
From: Sergey Bogdanov (sergey.bogdanov_at_gmail.com)
Date: 01/25/05
- Next message: Sergey Bogdanov: "Re: Unable to deploy application into Pocket PC"
- Previous message: Craig Deelsnyder: "Re: Using the tab control"
- In reply to: SteveInBeloit: "Re: Call a stored proc. from a Smart Device."
- Next in thread: SteveInBeloit: "Re: Call a stored proc. from a Smart Device."
- Reply: SteveInBeloit: "Re: Call a stored proc. from a Smart Device."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 Jan 2005 08:25:22 +0200
If you want to use Integrated Security you must explicitly set User ID
and Password:
"Integrated Security=SSPI;User
ID=<domain>\<username>;Password=<password>;..."
also you may try use SQL Server Authentication:
"User ID=sa;Password=<your password>;Initial Catalog=Northwind;Data
Source=COMPUTER-CD9T4F;"
Hope this help,
Sergey Bogdanov
http://www.sergeybogdanov.com
SteveInBeloit wrote:
> Daniel,
> Thanks for advising me on right clicking and adding the reference. When I
> did that I was able to add the Imports statement. Thanks.
>
> I am still stuck. I have a VB .NET Smart Device project open. I added one
> button, and on the click event I added the following code:
>
> Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
> Dim myConnection As New SqlConnection("Initial Catalog=Northwind;" & _
> "Data Source=COMPUTER-CD9T4F;Integrated Security=SSPI;")
> Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
> myConnection.Open()
> Dim myReader As SqlDataReader
> myReader = myCommand.ExecuteReader()
> While myReader.Read()
> Console.WriteLine((myReader.GetInt32(0) & ", " &
> myReader.GetString(1)))
> End While
> myReader.Close()
> myConnection.Close()
>
> I'm pretty sure the connection is good, I wrote a Window Form app and cut
> the SqlConnection from that. When I deploy this to the CE emulator in VS
> .NET, and when I click the button, I get:
>
> An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
> in System.Data.SqlClient.dll
>
> Additional information: SqlException
>
> I just can't seem to get this thing right. All I want to do is connect from
> a Smart Device app to the SQL server.
>
> Any thoughts?
>
> Thanks,
> Steve
>
> "Daniel Moth" wrote:
>
>
>>The Imports statement saves you from fully qualifying the classes of a
>>namespace. To actually use the namespaces/classes of an assembly you need to
>>reference the assembly they are in. Right click on references in solution
>>explorer and add SqlClient (like Bill suggested).
>>
>>Cheers
>>Daniel
>>--
>>http://www.danielmoth.com/Blog/
>>
- Next message: Sergey Bogdanov: "Re: Unable to deploy application into Pocket PC"
- Previous message: Craig Deelsnyder: "Re: Using the tab control"
- In reply to: SteveInBeloit: "Re: Call a stored proc. from a Smart Device."
- Next in thread: SteveInBeloit: "Re: Call a stored proc. from a Smart Device."
- Reply: SteveInBeloit: "Re: Call a stored proc. from a Smart Device."
- Messages sorted by: [ date ] [ thread ]