Do not use on any shared computer
[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

06/10/2009 at 05:32AM PDT, ID: 24479076
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

2.6

There was an error Parsing the Query. [Token Line number = 1, Token Line offset =1, Token in error = 1 ].

Tags:

Sql Server Compact Framework 3.5 edition .NET Compact Framework 3.5, windows mobile 6.

I am Using SqlcedataReader in Sql server Compact Edition 3.5, but when the application runs the Execute reader Method. It is throwing the error message as There was an error Parsing the Query. [Token Line number = 1, Token Line offset =1, Token in error = 1 ]. If i execute the query in Management Studio it is working.  If any body knows the answer request to help me in this regards,

Regards,
Arul Kumar
1:
2:
3:
4:
sSql = "SELECT * From TMOBIHUBCE;"
            cmdSKU = New SqlCeCommand(sSql, oNewConnection)
            cmdSKU.CommandText = CommandType.Text
            rdrReadSKU = cmdSKU.ExecuteReader(CommandBehavior.Default)
Sign up now to view this solution
Question Stats
Zone: Programming
Question Asked By: arulkumarske
Solution Provided By: RiteshShah
Participating Experts: 2
Solution Grade: B
Views: 92
Loading Advertisement...
06/10/09 05:41 AM, ID: 24590677

Rank: Sage

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 05:57 AM, ID: 24590825

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 06:05 AM, ID: 24590904

Rank: Sage

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 06:08 AM, ID: 24590945

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 06:11 AM, ID: 24590973

Rank: Genius

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 06:11 AM, ID: 24590974

Rank: Sage

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 08:37 AM, ID: 24592881

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/10/09 07:55 PM, ID: 24598443

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
06/11/09 05:14 PM, ID: 24608152

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
 
Loading Advertisement...
 
Microsoft
  • Applications
  • Development
  • Hardware
  • Internet Protocols
  • MS Forefront-ISA
  • OS
  • Server Applications
Apple
  • Hardware
  • Networking
  • Operating Systems
  • Programming
  • Software
Internet
  • Anti Spam
  • Anti-Spyware
  • Anti-Virus
  • Chat / IM
  • Email Clients
  • File Sharing
  • New Net Users
  • Search Engines
  • Web Browsers
  • Web Development
  • Web Servers
  • WebTrends / Stats
Gamers
  • Action / Adventure
  • Computer Games
  • Consoles
  • Emulators
  • Game Programming
  • Misc
  • Online / MMORPG
  • Puzzle
  • Role Playing
  • Sports
  • Strategy
  • Tips
Digital Living
  • Apple
  • Automotive
  • Digital Music
  • Gaming World
  • Hardware
  • Home Security
  • Networking Hardware
  • New Net Users
  • New Users
  • Software
Virus & Spyware
  • Anti Spam
  • Anti-Spyware
  • Anti-Virus
  • Cell Phones
  • Encryption
  • Hardware Firewalls
  • HijackThis
  • IDS
  • Internet Security
  • Latest Threats
  • Operating Systems Security
  • Software Firewalls
  • Vulnerabilities
  • WebApplications
Hardware
  • Apple
  • Components
  • Desktops
  • Displays / Monitors
  • Embedded Hardware
  • Handhelds / PDAs
  • Laptops/Notebooks
  • Misc
  • Networking Hardware
  • New Users
  • Peripherals
  • Servers
  • Storage
Software
  • Business Management
  • CYGWIN
  • Database
  • Development
  • Firewalls
  • Industry Specific
  • Internet / Email
  • Message Queue
  • Misc
  • MultiMedia Applications
  • Network Management
  • Office / Productivity
  • OS
  • OS/2 Apps
  • Page Layout
  • Photos / Graphics
  • Quality Assurance
  • Security
  • Server Software
  • System Utilities
  • Virtualization
  • VMware
  • Voice Recognition
  • Web Development
ITPro
  • Anti Spam
  • Anti-Spyware
  • Anti-Virus Apps
  • Apple Hardware
  • Chat / IM
  • Consulting
  • Devices
  • Displays / Monitors
  • Email Clients
  • Encryption
  • File Sharing
  • Firewalls
  • IDS
  • IT Administration
  • Laptops & Notebooks
  • Networking
  • Networking Hardware
  • Operating Systems Security
  • OS
  • Peripherals
  • Search Engines
  • Servers
  • Storage
  • Vulnerabilities
  • Web Browsers
  • Web Servers
  • Web/Cloud Computing
  • WebApplications
  • WebTrends / Stats
Developer
  • Application Servers
  • Content Management
  • CYGWIN
  • Database
  • Dev Tools
  • File Sharing
  • Game Programming
  • Industry Specific
  • Office / Productivity
  • Programming
  • Protocols
  • Search Engines
  • Web Browsers
  • Web Development
  • Web Servers
  • WebTrends / Stats
Storage
  • Backup / Restore
  • Disaster Recovery
  • Grid
  • Hard Drives
  • Misc
  • Remote Access
  • Removable Backup Media
  • Servers
  • Storage Technology
OS
  • Apple
  • AS / 400
  • BeOS
  • Development
  • Linux
  • MainFrame OS
  • Microsoft
  • Miscellaneous
  • OS / 2
  • Security
  • Unix
  • VMS / OpenVMS
  • VMware
Database
  • 4GL
  • Berkeley DB
  • Clarion
  • Contact Management
  • Data Manipulation
  • DB2
  • dBase
  • Embedded Databases
  • Enterprise Software
  • Filemaker Pro
  • FoxPro
  • GIS & GPS
  • Health Care / MUMPS
  • Informatica
  • Informix
  • Interbase / Firebird
  • InterSystems Cache
  • LDAP
  • Miscellaneous
  • MS Access
  • MS SQL Server
  • MySQL Server
  • OLAP
  • Oracle
  • PostgreSQL
  • Reporting
  • SAS
  • Siebel
  • SQLBase
  • Sybase
Security
  • Anti Spam
  • Anti-Spyware
  • Anti-Virus
  • Chat / IM
  • Digital Forensics
  • Email Clients
  • Encryption
  • File Sharing
  • IDS
  • Internet Security
  • Misc
  • Operating Systems Security
  • Software Firewalls
  • VPN
  • Vulnerabilities
  • Web Browsers
  • WebApplications
Programming
  • Algorithms
  • Automation
  • Database
  • Editors IDEs
  • Game
  • Handhelds / PDAs
  • Installation
  • Languages
  • Misc
  • Multimedia Programming
  • Open Source
  • Processor Platforms
  • Project Management
  • Signal Processing
  • System / Kernel
  • Theory
Web Development
  • Authoring
  • Blogs
  • Components
  • Digital Camera Software
  • Document Imaging
  • Fonts
  • Illustration
  • Images
  • Images & Photo Software
  • Internet Marketing
  • Misc Web Development
  • Scripting
  • Search Engines
  • Web Dev Software
  • Web Frameworks
  • Web Graphics
  • Web Languages/Standards
  • Web Servers
  • Web Services
  • Web-Based CMS
  • WebApplications
  • WebTrends / Stats
Networking
  • Apple Networking
  • Application Servers
  • Backup / Restore
  • Broadband
  • Content Management
  • Email Servers
  • File Servers
  • Grid
  • ISPs & Hosting
  • Java Editors & IDEs
  • Linux Networking
  • Message Queue
  • Misc
  • Network Management
  • Networking Hardware
  • Novell Netware
  • Operating Systems
  • OS / 2
  • Protocols
  • Removable Backup Media
  • Security
  • Servers
  • Storage Technology
  • System Utilities
  • Telecommunications
  • Unix Networking
  • Web Servers
  • Web/Cloud Computing
  • Windows Networking
  • Wireless
Other
  • Automotive
  • Business Travel
  • Community Support
  • Expert Lounge
  • Lounge
  • Math / Science
  • Miscellaneous
  • New Net Users
  • Philosophy / Religion
  • Politics
  • Puzzles / Riddles
  • URLs
Community Support
  • Announcements
  • Article Tips
  • Beta Feedback
  • CleanUp
  • EE Bugs
  • Feedback
  • General
  • Input
  • New to EE
  • New Zones
  • Suggestions
 
06/10/09 05:41 AM, ID: 24590677

Rank: Sage

can you please try this one?

sSql = "SELECT * From TMOBIHUBCE"
cmdSKU = New SqlCeCommand(sSql, oNewConnection)
cmdSKU.CommandText = CommandType.Text
rdrReadSKU = cmdSKU.ExecuteReader()

Accepted Solution
 
06/10/09 05:57 AM, ID: 24590825
Hi Ritesh,
Still Same Error Persists, Attached the Changed Code for reference. Request to help me in this regards.
Regards,
Arul Kumar

1:
2:
3:
4:
sSql = "SELECT * From TMOBIHUBCE"
            cmdSKU = New SqlCeCommand(sSql, oNewConnection)
            cmdSKU.CommandText = CommandType.Text
            rdrReadSKU = cmdSKU.ExecuteReader()
 
06/10/09 06:05 AM, ID: 24590904

Rank: Sage

this error is popular error and used to come when you have something wrong in SQL Syntax but in your case I can't find any wrong syntax, are you using the same code? or it is a part of bigger query?
 
06/10/09 06:08 AM, ID: 24590945
Hi Ritesh,

1. This is the Query i am using. There will be always only record only.
Request to help me in this regards.

Thanks in Advance.
Regards,
Arul Kumar.


 
06/10/09 06:11 AM, ID: 24590973

Rank: Genius

Hello arulkumarske,

sSql = "SET NOCOUNT ON ; SELECT * From dbo.TMOBIHUBCE"
            cmdSKU = New SqlCeCommand(sSql, oNewConnection)
            cmdSKU.CommandText = CommandType.Text
            rdrReadSKU = cmdSKU.ExecuteReader()


Regards,

Aneesh
Assisted Solution
 
06/10/09 06:11 AM, ID: 24590974

Rank: Sage

can you please post your full code? I just wanted to sure whether you are missing something. moreover, can you try by using field name instead of "*" in query? I know this is not a solution but just give it a try.
 
06/10/09 08:37 AM, ID: 24592881
Hi ritesh,

1. Attached the Code Snippet, request to help me in this regards,

Arul Kumar
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
    Private Sub BCRReceive_BarcodeRead(ByVal sender As System.Object, ByVal bre As Intermec.DataCollection.BarcodeReadEventArgs) Handles BCRReceive.BarcodeRead
        Dim rdrReadSKU As SqlCeDataReader = Nothing
        Dim sDeviceName As String = System.Net.Dns.GetHostName()
        Dim oNewConnection As SqlCeConnection = Nothing
        Dim ceEng As SqlCeEngine = Nothing
        Dim iQty As Integer = 0
        Dim sBatchCode As String = String.Empty
        'Code For Reading Barcode and Fetch the SKU Details
        Dim sConnectionString As String = "Data Source= " + GetAppPath() + "\MOBIHUB.sdf;"
 
        Try
            txtSKU.Text = bre.strDataBuffer.ToString
            Dim sSql As String = String.Empty
            Dim sActCode As String = String.Empty
            Dim cmdSKU As SqlCeCommand
 
            sConnectionString = "Data Source= " + GetAppPath() + "\MOBIHUB.sdf;"
            oNewConnection = New SqlCeConnection(sConnectionString)
            oNewConnection.Open()
            sSql = "SELECT * From TMOBIHUBCE"
            cmdSKU = New SqlCeCommand(sSql, oNewConnection)
            cmdSKU.CommandText = CommandType.Text
            rdrReadSKU = cmdSKU.ExecuteReader()
            While rdrReadSKU.Read
                rdrReadSKU.Read()
                sBatchCode = rdrReadSKU.GetValue(2)
                iQty = rdrReadSKU.GetValue(3)
                txtBatchCode.Text = sBatchCode
                txtPUOMQty.Text = iQty
            End While
            If rdrReadSKU.IsClosed = False Then
                rdrReadSKU.Close()
                rdrReadSKU.Dispose()
            End If
        Catch ex As Exception
            MsgBox(ex.ToString)
            '            ManageMobileHub.cManageLogs.ManageLogs(System.Guid.NewGuid.ToString, ex.ToString)
        Finally
            oNewConnection.Close()
        End Try
    End Sub
 
 
 
        Public Shared Function GetAppPath() As String
            Dim fullPath As String = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)
            GetAppPath = fullPath
        End Function
 
06/10/09 07:55 PM, ID: 24598443
hI aneeshattingal

I have tried set nocount on: it is throwing the same error. I am using Sqlce 3.5, .NET Compact Framework 2.0 SP2 and VS 2005. Request ot help me in this regards, Attached Code Reference

Regards,
Arul Kumar.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
Private Sub BCRReceive_BarcodeRead(ByVal sender As System.Object, ByVal bre As Intermec.DataCollection.BarcodeReadEventArgs) Handles BCRReceive.BarcodeRead
        Dim rdrReadSKU As SqlCeDataReader = Nothing
        Dim sDeviceName As String = System.Net.Dns.GetHostName()
        Dim oNewConnection As SqlCeConnection = Nothing
        Dim ceEng As SqlCeEngine = Nothing
        Dim iQty As Integer = 0
        Dim sBatchCode As String = String.Empty
        'Code For Reading Barcode and Fetch the SKU Details
        Dim sConnectionString As String = "Data Source= " + GetAppPath() + "\MOBIHUB.sdf;"
 
        Try
            txtSKU.Text = bre.strDataBuffer.ToString
            Dim sSql As String = String.Empty
            Dim sActCode As String = String.Empty
            Dim cmdSKU As SqlCeCommand
 
            sConnectionString = "Data Source= " + GetAppPath() + "\MOBIHUB.sdf;"
            oNewConnection = New SqlCeConnection(sConnectionString)
            oNewConnection.Open()
            sSql = "SELECT * From TMOBIHUBCE"
            cmdSKU = New SqlCeCommand(sSql, oNewConnection)
            cmdSKU.CommandText = CommandType.Text
            rdrReadSKU = cmdSKU.ExecuteReader()
            While rdrReadSKU.Read
                rdrReadSKU.Read()
                sBatchCode = rdrReadSKU.GetValue(2)
                iQty = rdrReadSKU.GetValue(3)
                txtBatchCode.Text = sBatchCode
                txtPUOMQty.Text = iQty
            End While
            If rdrReadSKU.IsClosed = False Then
                rdrReadSKU.Close()
                rdrReadSKU.Dispose()
            End If
        Catch ex As Exception
            MsgBox(ex.ToString)
            '            ManageMobileHub.cManageLogs.ManageLogs(System.Guid.NewGuid.ToString, ex.ToString)
        Finally
            oNewConnection.Close()
        End Try
    End Sub
 
 
 
        Public Shared Function GetAppPath() As String
            Dim fullPath As String = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)
            GetAppPath = fullPath
        End Function
 
06/11/09 05:14 PM, ID: 24608152
at last i have found the Solution for it. The Solution is That the Change the Declarations to the top of the Function and Put te ssql above the connection Initialization.  Then it works. I don't know it is the reason. but any how it works.  Thank you very much for all who posted the comments and give me the suggestions.

Thanks & regards,
Arul Kumar
 
 
20080206-EE-VQP-25 - Hierarchy / EE_QW_3_20080625