Re: Help With MS SQL Error: The value's length for key 'data source' exceeds it's limit of '128'.



On Jan 21, 8:22 am, "Ginny Caughey [MVP]"
<ginny.caughey.onl...@xxxxxxxxxxxxxx> wrote:
Loogie,

If you want to open the SQL Compact sdf file on the desktop, you need to use
the System.Data.SqlServerCe namespace for the desktop instead of SqlClient,
which is for SQL Server.

--
Ginny Caughey
Device Application Development MVPwww.wasteworks.com
Software for Solid Waste Management

"Loogie" <boogieloo...@xxxxxxxxx> wrote in message

news:f92c3722-5ce0-4a17-95ef-4883bd2b26a7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

have an .sdf database (MS SQL 2005 Compact) that was created on a
pocket pc. It now resides on the desktop. I wanted to open it and edit
it on the desktop. I am developing with Vb.2005.

I use the same connection string syntax that I use on the Pocket PC
but I get the error:

'The value's length for key 'data source' exceeds it's limit of
'128'.' from the code:

DESKTOP CODE: - Does not work
Dim saveconn As New SqlConnection("Data Source =" &
Application.StartupPath & "\Projects\" &
lvProj.Items(lvProj.SelectedIndices(0)).Text & "\Tally\" &
lvProj.Items(lvProj.SelectedIndices(0)).Text & ".sdf")
saveconn.Open()

PocketPC CODE: - Does work
Dim saveconn As New SqlCEConnection("Data Source = My Documents
\Projects\" & lvProj.Items(lvProj.SelectedIndices(0)).Text & "\Tally\"
& lvProj.Items(lvProj.SelectedIndices(0)).Text & ".sdf")
saveconn.Open()

So I do not understand my error. How do I do this? I have MS SQL
Server 2005 and MS SQL Server Express (which is what I want to use)

I use the following imports:

Imports System.Data
Imports System.Data.Common.DbConnection
Imports System.Data.SqlClient
Imports System.Data.SqlDbType
Imports System.Data.SqlTypes

I am new to this so please be patient with this ole dog!

:L
Please help

Thanks

PBLack

I should further explain that when I click the 'Add References'
button, System.Data.SqlServerCe is not there so I can not get it to
work. I tried to find a download of System.Data.SqlServerCe 9.0.242.0
as I saw in another post that this was the current one. But I am not
even sure that is the problem because I think I have my install
current. I am on XP SP2.

This has been bugging me for a day now and I need to get past it.

Any help appreciated

Thanks

:L
.


Loading