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




www.connectionstrings.com has all the syntaxes.

be anal about spaces semi colons and single quotes.




"Radu" <cuca_macaii2000@xxxxxxxxx> wrote in message
news:1178560955.270436.154800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi. This code worked fine with SQL2005, but has a problem with
SQL2000.... Which one ????

cnSQL = New

SqlConnection(System.Configuration.ConfigurationManager.AppSettings("Connect
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="ConnectionString"
value="Data Source='SQLDEV001\SQLDEV001;Initial Catalog='SOP';User
ID=SOP_DEV;Password=AAA;"
/>

and

<add
name="OrderingProcess"
connectionString="server='SQLDEV001\SQLDEV001';database='SOP';User
ID=SOP_DEV;Password=AAA;"
providerName="System.Data.SqlClient"
/>

which is used in some page as:

<asp:SqlDataSource
ID="LocationSqlDataSource"
SelectCommand="SELECT
Measures.[Measure ID] as ID,
Measures.[Measure Description] as Measure,
Locations_BY_Measure.[Locations] as Location
FROM Locations_BY_Measure INNER JOIN Measures
ON Locations_BY_Measure.[Measure ID] = Measures.[Measure ID]"
EnableCaching="True"
ConnectionString="<%$ ConnectionStrings:OrderingProcess %>"
CacheDuration="60"
FilterExpression="ID = {0}"
RunAt="server">


while the exact same code works great with the 2005 settings:

<!-- SQL2005, with Username/Password....-->
<add
key="ConnectionString"
value="Data Source='myOtherComputer\SQLEXPRESS';Initial
Catalog='SOP';User ID=SOP_DEV;Password=AAA;"
/>

and

<add
name="OrderingProcess"
connectionString="server='SQLDEV001\SQLDEV001';database='SOP';User
ID=SOP_DEV;Password=AAA;"
providerName="System.Data.SqlClient" />

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.



.



Relevant Pages

  • Simple code worked fine with SQL2005, but now has a problem with SQL2000.
    ... cnSQL = New ... fails with the error ... "Format of the initialization string does not conform to specification ... using Enterprise Manager I can connect using the SOP_DEV ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Setting number format by multiplication - possible bug?
    ... I suspect the value that fails isn't being recognized as a number. ... "Tom Ogilvy" wrote: ... Recommendations on how to format ... Dim i As Integer ...
    (microsoft.public.excel.programming)
  • Re: GetDC fails with dderr_cantcreatedc from a directdrawsurface
    ... It works with RGB and I don't know if an HDC can represent the format. ... Currently I copy the surface to a second temp-surface (with an RGB ... >> I don't understand why it fails. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • RE: Syntax Error - Missing Operator - When Using Date !
    ... with single quotes: ... format. ... I get the "Syntax Error " Error displayed. ... Set conn = New ADODB.Connection ...
    (microsoft.public.vb.database)
  • Re: datevalue
    ... "Govind" wrote: ... > Your first two values were within single quotes and hence they wont ... On the third format, am not sure of the reason why it doesnt work, ... >> When I try to use the function DateValue, I keep getting an error message of ...
    (microsoft.public.excel.worksheet.functions)

Quantcast