A
amiga500
Hello,
I have a cdb file called data.cdb stored into my PocketPC. Below is my
code, I am using msgbox for debugging purpose:
' Here we I do all the necessary coding to display the contents in
Dim strHandHeld As String = TheReaderData.Text
Dim Conn As New SqlConnection("User
ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial
Catalog=Direct Source System;Persist Security Info=False;Packet
Size=4096")
Dim objDataReader As SqlDataReader = Nothing
Dim myCommand As New SqlCommand()
Dim strSQL As String = "SELECT Item_Number FROM Product WHERE
UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " "
& Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'"
txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld,
2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1)
Dim strLocation As String = ""
MsgBox("1")
Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand =
Nothing
MsgBox("2")
Dim objSQLCeConnection As New
System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb")
MsgBox("3")
Dim objSQLCeDataReader As
System.Data.SqlServerCe.SqlCeDataReader = Nothing
MsgBox("4")
objSQLCeConnection.Open()
MsgBox("5")
objSQLCeCommand = New
System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection)
MsgBox("6: " & strSQL)
objSQLCeDataReader = objSQLCeCommand.ExecuteReader
MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read)
MsgBox(objSQLCeDataReader("Item_Number"))
MsgBox("8")
objSQLCeConnection.Close()
MsgBox("9")
MsgBox("Arrived safely")
Anyways as soon as the line hits for number 4 it refuses to open the
connection...this is how I am connecting to my data.cdb:
Dim objSQLCeConnection As New
System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb")
is this wrong? If so how do I connect to my .cdb file in my PocketPC?
Thanks, appreciate it big time.
I have a cdb file called data.cdb stored into my PocketPC. Below is my
code, I am using msgbox for debugging purpose:
' Here we I do all the necessary coding to display the contents in
Dim strHandHeld As String = TheReaderData.Text
Dim Conn As New SqlConnection("User
ID=DSUSER;PASSWORD=silentk;Data Source=NTSERVER-2;Initial
Catalog=Direct Source System;Persist Security Info=False;Packet
Size=4096")
Dim objDataReader As SqlDataReader = Nothing
Dim myCommand As New SqlCommand()
Dim strSQL As String = "SELECT Item_Number FROM Product WHERE
UPC = '" & Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld, 2, 5) & " "
& Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1) & "'"
txtUPC.Text = Mid(strHandHeld, 1, 1) & " " & Mid(strHandHeld,
2, 5) & " " & Mid(strHandHeld, 7, 5) & " " & Mid(strHandHeld, 12, 1)
Dim strLocation As String = ""
MsgBox("1")
Dim objSQLCeCommand As System.Data.SqlServerCe.SqlCeCommand =
Nothing
MsgBox("2")
Dim objSQLCeConnection As New
System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb")
MsgBox("3")
Dim objSQLCeDataReader As
System.Data.SqlServerCe.SqlCeDataReader = Nothing
MsgBox("4")
objSQLCeConnection.Open()
MsgBox("5")
objSQLCeCommand = New
System.Data.SqlServerCe.SqlCeCommand(strSQL, objSQLCeConnection)
MsgBox("6: " & strSQL)
objSQLCeDataReader = objSQLCeCommand.ExecuteReader
MsgBox("7: " & objSQLCeCommand.ExecuteReader.Read)
MsgBox(objSQLCeDataReader("Item_Number"))
MsgBox("8")
objSQLCeConnection.Close()
MsgBox("9")
MsgBox("Arrived safely")
Anyways as soon as the line hits for number 4 it refuses to open the
connection...this is how I am connecting to my data.cdb:
Dim objSQLCeConnection As New
System.Data.SqlServerCe.SqlCeConnection("Data Source=\Data.cdb")
is this wrong? If so how do I connect to my .cdb file in my PocketPC?
Thanks, appreciate it big time.