473,881 Members | 1,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple code worked fine with SQL2005, but now has a problem with SQL2000.

Hi. This code worked fine with SQL2005, but has a problem with
SQL2000.... Which one ????

cnSQL = New
SqlConnection(S ystem.Configura tion.Configurat ionManager.AppS ettings("Connec tionString"))
cnSQL.Open()

fails with the error

"Format of the initialization string does not conform to specification
starting at index 0."

if in web.config I have

<!-- SQL2000, with Username/Password....-->
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient"
/>

which is used in some page as:

<asp:SqlDataSou rce
ID="LocationSql DataSource"
SelectCommand=" SELECT
Measures.[Measure ID] as ID,
Measures.[Measure Description] as Measure,
Locations_BY_Me asure.[Locations] as Location
FROM Locations_BY_Me asure INNER JOIN Measures
ON Locations_BY_Me asure.[Measure ID] = Measures.[Measure ID]"
EnableCaching=" True"
ConnectionStrin g="<%$ ConnectionStrin gs:OrderingProc ess %>"
CacheDuration=" 60"
FilterExpressio n="ID = {0}"
RunAt="server">
while the exact same code works great with the 2005 settings:

<!-- SQL2005, with Username/Password....-->
<add
key="Connection String"
value="Data Source='myOther Computer\SQLEXP RESS';Initial
Catalog='SOP';U ser ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient" />

Of course, using Enterprise Manager I can connect using the SOP_DEV
and AAA info to both databases.

Could you help me, please ?

Thanks, Alex.

May 7 '07 #1
8 1522
'SOP' - try removing the single quotes.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Radu" wrote:
Hi. This code worked fine with SQL2005, but has a problem with
SQL2000.... Which one ????

cnSQL = New
SqlConnection(S ystem.Configura tion.Configurat ionManager.AppS ettings("Connec tionString"))
cnSQL.Open()

fails with the error

"Format of the initialization string does not conform to specification
starting at index 0."

if in web.config I have

<!-- SQL2000, with Username/Password....-->
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient"
/>

which is used in some page as:

<asp:SqlDataSou rce
ID="LocationSql DataSource"
SelectCommand=" SELECT
Measures.[Measure ID] as ID,
Measures.[Measure Description] as Measure,
Locations_BY_Me asure.[Locations] as Location
FROM Locations_BY_Me asure INNER JOIN Measures
ON Locations_BY_Me asure.[Measure ID] = Measures.[Measure ID]"
EnableCaching=" True"
ConnectionStrin g="<%$ ConnectionStrin gs:OrderingProc ess %>"
CacheDuration=" 60"
FilterExpressio n="ID = {0}"
RunAt="server">
while the exact same code works great with the 2005 settings:

<!-- SQL2005, with Username/Password....-->
<add
key="Connection String"
value="Data Source='myOther Computer\SQLEXP RESS';Initial
Catalog='SOP';U ser ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient" />

Of course, using Enterprise Manager I can connect using the SOP_DEV
and AAA info to both databases.

Could you help me, please ?

Thanks, Alex.

May 7 '07 #2

www.connectionstrings.com has all the syntaxes.

be anal about spaces semi colons and single quotes.


"Radu" <cu************ *@yahoo.comwrot e in message
news:11******** **************@ h2g2000hsg.goog legroups.com...
Hi. This code worked fine with SQL2005, but has a problem with
SQL2000.... Which one ????

cnSQL = New
SqlConnection(S ystem.Configura tion.Configurat ionManager.AppS ettings("Connec t
ionString"))
cnSQL.Open()

fails with the error

"Format of the initialization string does not conform to specification
starting at index 0."

if in web.config I have

<!-- SQL2000, with Username/Password....-->
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient"
/>

which is used in some page as:

<asp:SqlDataSou rce
ID="LocationSql DataSource"
SelectCommand=" SELECT
Measures.[Measure ID] as ID,
Measures.[Measure Description] as Measure,
Locations_BY_Me asure.[Locations] as Location
FROM Locations_BY_Me asure INNER JOIN Measures
ON Locations_BY_Me asure.[Measure ID] = Measures.[Measure ID]"
EnableCaching=" True"
ConnectionStrin g="<%$ ConnectionStrin gs:OrderingProc ess %>"
CacheDuration=" 60"
FilterExpressio n="ID = {0}"
RunAt="server">
while the exact same code works great with the 2005 settings:

<!-- SQL2005, with Username/Password....-->
<add
key="Connection String"
value="Data Source='myOther Computer\SQLEXP RESS';Initial
Catalog='SOP';U ser ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient" />

Of course, using Enterprise Manager I can connect using the SOP_DEV
and AAA info to both databases.

Could you help me, please ?

Thanks, Alex.

May 7 '07 #3
On May 7, 8:02 pm, Radu <cuca_macaii2.. .@yahoo.comwrot e:
>
<!-- SQL2000, with Username/Password....-->
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>

and

<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient"
/>
they are the same strings, why the syntax is different?

I've tried to connect using such strings to my local SQL 2000 server
and I have no problem with quotes.

Alex, what about the named instance? Are you sure about the name?

May 7 '07 #4
On May 7, 3:07 pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On May 7, 8:02 pm, Radu <cuca_macaii2.. .@yahoo.comwrot e:


<!-- SQL2000, with Username/Password....-->
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>
and
<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient"
/>

they are the same strings, why the syntax is different?

I've tried to connect using such strings to my local SQL 2000 server
and I have no problem with quotes.

Alex, what about the named instance? Are you sure about the name?- Hide quoted text -

- Show quoted text -

Hi. Finally.... it works.... Hmmmmmmm..... I took out all quotes, thus
the string (working for 2005)

<add name="OrderingP rocess"
connectionStrin g="server='C227 226\SQLEXPRESS' ;database='SOP' ;User
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

became for 2000

<add name="OrderingP rocess"
connectionStrin g="server=SQLDE V001\SQLDEV001; database=SOP;Us er
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

Note that the string (otherwise correct, from a 2005 standpoint)

<add name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

with single quotes did *NOT* work, so, to make it work,
'SOP'
became
SOP
and
'SQLDEV001\SQLD EV001'
became
SQLDEV001\SQLDE V001

Very strange, indeed.... looks like the strings are parsed
differently.... Again, as I was saying, Hmmmmmmmm......

I lost almost a whole morning fighting this problem !
Anyway, it works now. Thank you all very much for your kind
answers :-)))))

Alex.

May 7 '07 #5
On May 7, 10:53 pm, Radu <cuca_macaii2.. .@yahoo.comwrot e:
>
Hi. Finally.... it works.... Hmmmmmmm..... I took out all quotes, thus
the string (working for 2005)

<add name="OrderingP rocess"
connectionStrin g="server='C227 226\SQLEXPRESS' ;database='SOP' ;User
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

became for 2000

<add name="OrderingP rocess"
connectionStrin g="server=SQLDE V001\SQLDEV001; database=SOP;Us er
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

Note that the string (otherwise correct, from a 2005 standpoint)

<add name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

with single quotes did *NOT* work, so, to make it work,
'SOP'
became
SOP
and
'SQLDEV001\SQLD EV001'
became
SQLDEV001\SQLDE V001

Very strange, indeed.... looks like the strings are parsed
differently.... Again, as I was saying, Hmmmmmmmm......

I lost almost a whole morning fighting this problem !
Anyway, it works now. Thank you all very much for your kind
answers :-)))))

Alex.
I don't get it.

The following code (using single quotes) works for me:

<asp:GridView ID="GridView1" DataSourceID="S qlDataSource1"
runat="server" />
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
SelectCommand=" SELECT ... FROM ..."
ConnectionStrin g="Data Source='localho st';Initial
Catalog='databa sename';User ID=sa;Password= pass;" />

as well as:

<asp:GridView ID="GridView1" DataSourceID="S qlDataSource1"
runat="server" />
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
SelectCommand=" SELECT ... FROM ... "
ConnectionStrin g="<%$ ConnectionStrin gs:OrderingProc ess %>" />

in web.config

<connectionStri ngs>
<add name="OrderingP rocess"
connectionStrin g="Data Source='localho st';Initial
Catalog='databa sename';User ID=sa;Password= pass;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

--ASP.NET 2.0, SQL 2000

where is the difference?

May 7 '07 #6
The connection string name=value pairs do not take 'quotation' marks. Unless
of course your database name really is 'SOP' instead of SOP.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Radu" wrote:
On May 7, 3:07 pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On May 7, 8:02 pm, Radu <cuca_macaii2.. .@yahoo.comwrot e:


<!-- SQL2000, with Username/Password....-->
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>
and
<add
name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;"
providerName="S ystem.Data.SqlC lient"
/>
they are the same strings, why the syntax is different?

I've tried to connect using such strings to my local SQL 2000 server
and I have no problem with quotes.

Alex, what about the named instance? Are you sure about the name?- Hide quoted text -

- Show quoted text -


Hi. Finally.... it works.... Hmmmmmmm..... I took out all quotes, thus
the string (working for 2005)

<add name="OrderingP rocess"
connectionStrin g="server='C227 226\SQLEXPRESS' ;database='SOP' ;User
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

became for 2000

<add name="OrderingP rocess"
connectionStrin g="server=SQLDE V001\SQLDEV001; database=SOP;Us er
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

Note that the string (otherwise correct, from a 2005 standpoint)

<add name="OrderingP rocess"
connectionStrin g="server='SQLD EV001\SQLDEV001 ';database='SOP ';User
ID=SOP_DEV;Pass word=AAA;" providerName="S ystem.Data.SqlC lient" />

with single quotes did *NOT* work, so, to make it work,
'SOP'
became
SOP
and
'SQLDEV001\SQLD EV001'
became
SQLDEV001\SQLDE V001

Very strange, indeed.... looks like the strings are parsed
differently.... Again, as I was saying, Hmmmmmmmm......

I lost almost a whole morning fighting this problem !
Anyway, it works now. Thank you all very much for your kind
answers :-)))))

Alex.

May 7 '07 #7
Hi Alex,

just to add to the other posters: Unless it's a typo, the first
connection string is missing the closing quotation mark after the
instance name (apart from the fact that you don't need quotation marks).

Radu wrote:
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>
Roland
May 8 '07 #8
On May 8, 8:00 am, Roland Dick <bris...@web.de wrote:
Hi Alex,

just to add to the other posters: Unless it's a typo, the first
connection string is missing the closing quotation mark after the
instance name (apart from the fact that you don't need quotation marks).

Radu wrote:
<add
key="Connection String"
value="Data Source='SQLDEV0 01\SQLDEV001;In itial Catalog='SOP';U ser
ID=SOP_DEV;Pass word=AAA;"
/>

Roland


Hi, all.

It's true, and it's strange. The same string worked great in 2005, but
stopped working with the above-mentioned error in 2000 (of course, I
have changed the name of the instance to match). At least this is the
way it behaved on my computer at work - I'm curious to test it at
home. Anyway, it all works now (without any quotation marks), and
that's what counts - I already forgot this aggravation, like so many
others :-))))))) This is the nature of this beast, I guess.

Thank you all for spending the time reading this. I honestly
appreciate it !

Alex.

PS. Yes, Roland, it was a typo :-)

May 9 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1809
by: ad | last post by:
The user of my asp.net program use Sql2005 or Sql2005 express as database, both are possible. I have try both version of data base, I found: If I use Sql2005 express, the Data Source in connection string will be ..\SQLEXPRESS, like: Data Source=.\SQLEXPRESS;Initial Catalog=myDB;Integrated Security=True But I use Sql2005 , the Data Source in connection string can be use (local), like:
2
1014
by: WebBuilder451 | last post by:
I'd like to know if anyone here is using the betas in a light production environment and how usable thay are. Also if anyone is using 2.0 and sql2000. thanks kes
1
1292
by: Benny Ng | last post by:
The error is shown by the following connection string.£®But it can be runs properly in SQL2000£© PROVIDER=MSDATASHAPE;DRIVER={SQL SERVER};SERVER=ibmdept;DATABASE=CY_20060208;UID=sa;PWD=111111; The following is the error message: <<<<<<<<<<<<< Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
4
1814
by: john.orlando | last post by:
Hello, I'm a newbie to Python (literally, within the last two weeks), and I am playing around with Tkinter to build some simple GUIs. I am attempting to build a simple class that displays a GIF. Here is the code: #start of code from Tkinter import * class DisplayPict(Frame):
2
1699
by: PointMan | last post by:
i make a project in vs2005 that use ASPNETDB.MDF and use <asp:LoginView ID="LoginView1" runat="server" > server control for vs2005 in this case , i'd like to use hosting service but this hosting company does not support sql2005 that's why i have to use sql2000 so my quetion is how can i migration this for sql2000??
1
1119
by: Peter Newman | last post by:
Im looking for a working modal / example on how to execute a business object package on a 2005 server from vb.net ( 2003) , parming in parameters much the same as vb6 and SQL2000 DTS
5
3917
by: Mike | last post by:
I'm having trouble accessing SQL2005 Standard Edition as a second instance of SQL Server where the first instance is SQL 2000 Enterprise Edition. I installed SQL 2005 as a named instance "SQL2005". The server is running Windows 2000 SP4 ON A 32-Bit machine. When I look in Services I see the SQL Server (SQL2005), SQL Server Agent (SQL2005) services there. I went into SQL Server Configuration manager and disabled the named pipes protocol...
7
6514
by: Olegus | last post by:
Hello, in order to perform backup/restore MSSQL database using SMO, one needs to reference several namespaces in a backup class : using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Smo; Unfortunately, MSSQL 2005 and MSSQL Express keep them in different place. For MSSQL2005 they are located in C:\Program Files\Microsoft SQL Server \90\SDK\Assemblies and for MSSQL Express you can find them in C:
0
2008
by: nic829 | last post by:
Hi, I was upgrading a instance from SQL2000 to SQL2005. During SQL2005 setup I accidently allow the files to be installed in C drive, but I should have them all installed in D drive. My databases are still sits in D drive, but other files (Management studio, analysis service, etc.) all sits in C drive. Is there anyway that I can move SQL2005 from C to D drive? I thought of uninstalling current SQL2005, install it back and load current...
0
9931
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10724
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7113
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5978
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4599
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.