Re: Help With MS SQL Error: The value's length for key 'data source' exceeds it's limit of '128'.
- From: "Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx>
- Date: Mon, 21 Jan 2008 07:22:04 -0500
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 MVP
www.wasteworks.com
Software for Solid Waste Management
"Loogie" <boogieloogie@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
.
- Follow-Ups:
- References:
- Prev by Date: Help With MS SQL Error: The value's length for key 'data source' exceeds it's limit of '128'.
- Next by Date: Re: Help With MS SQL Error: The value's length for key 'data source' exceeds it's limit of '128'.
- Previous by thread: Help With MS SQL Error: The value's length for key 'data source' exceeds it's limit of '128'.
- Next by thread: Re: Help With MS SQL Error: The value's length for key 'data source' exceeds it's limit of '128'.
- Index(es):
Relevant Pages
|
Loading