DAAB and Connection to SQL 2000

G

Guest

Hi,

I'm having difficulty connecting my .NET web app to my SQL2000
database via the DAAB. I'm using VS2003 with .NET 1.1.

I'm currently trying names such as Initial Catalog, Data Source, User
ID and Password. But i have previously attempted server, database,
user, uid, Pwd, etc. all to no avail.

The user and password i've supplied do provide access to the database
in question as I can log into QA using those credentials. But I can't
seem to configure the DAAB to accept them.

In my new web page I have created a db object using the
DataFactory.CreateDatabase method and can retreive the
ConfigurationName, so I must be on the right lines somewhere.

Any tips on how I should configure my DAAB so that I no longer get a
[SqlException: SQL Server does not exist or access denied.] error?

Cheers,

<M>
 
S

sloan

Are you using the DAAB? or the EnterpriseLibrary.Data?

//DataFactory.CreateDatabase//

That exists only in the EnterpriseLibrary.Data I believe.

................

Which version of the EnterpriseLibrary(.Data) are you using?

There are several permutations involved, and I think you may be using the
wrong name(s) for things.

Throw out a little more (detailed) information please.
 
S

sloan

If you're using the EnterpriseLibrary.Data...and the 1.1 version.

What does your dataConfiguration.config file look like??



sloan said:
Are you using the DAAB? or the EnterpriseLibrary.Data?

//DataFactory.CreateDatabase//

That exists only in the EnterpriseLibrary.Data I believe.

...............

Which version of the EnterpriseLibrary(.Data) are you using?

There are several permutations involved, and I think you may be using the
wrong name(s) for things.

Throw out a little more (detailed) information please.





Hi,

I'm having difficulty connecting my .NET web app to my SQL2000
database via the DAAB. I'm using VS2003 with .NET 1.1.

I'm currently trying names such as Initial Catalog, Data Source, User
ID and Password. But i have previously attempted server, database,
user, uid, Pwd, etc. all to no avail.

The user and password i've supplied do provide access to the database
in question as I can log into QA using those credentials. But I can't
seem to configure the DAAB to accept them.

In my new web page I have created a db object using the
DataFactory.CreateDatabase method and can retreive the
ConfigurationName, so I must be on the right lines somewhere.

Any tips on how I should configure my DAAB so that I no longer get a
[SqlException: SQL Server does not exist or access denied.] error?

Cheers,

<M>
 
G

Guest

Good questions. In short I'm not too sure.

I created a DAAB configuration and saved it to the project. I then
added references to the EnterpriseLibrary to the project for Data,
Configuration and Common. I was attempting to follow the help files
that came with the Microsoft Patterns and Practices (June 2005)
install, but my interpretation of them lead me to my current position.

According to the properties pane in VS the EnterpriseLibrary(.Data)
version is v1.1.4322.

Any thoughts as to what additional information may be of use? I.e.
contents of dataconfiguration.config, code on the web page, etc?

<M>
 
G

Guest

Ah,

Think I may have solved it.
Both my IIS and SQL server services are running on the same
(development) PC. I had assumed (Doh!) that therefore my Data Source
would be (local). Wrong. I needed to replace this value with that of
the name of my PC for it to succeed.

Thanks for your assistance, i'll try not to be so assuming next
time :)

<M>
 
S

sloan

Below is my dataConfiguration.config.

It'll get you started for google searching;



If you call the
DataFactory.CreateDatabase(); //no value passed in
you'll get the defaultInstance of "pubsInstance1". YOU CARE ABOUT THE
INSTANCE NAME, not the connection string name.

DataFactory.CreateDatabase("pubsInstance2") ; // youll get the the second
string, because you're explicitly telling it which one you want.

You also need to google
<databaseType name="Sql Server"
type="Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase,
Microsoft.EntLib.Data" />
(or at least the first half)

Because I think I shorted the filenames some.....aka ... my
"Microsoft.EntLib.Data" is too short from the default name. Find the
correct one thru google or sample code.
Basically, Microsoft.EntLib.Data is the dll name without the ".dll" with it.
Microsoft.EntLib.Data.dll is mine. The default is different.
...

Last tip.
If you're in webforms (which I assume you are because of this newsgroup),
then you put dataConfiguration.config in the root directory where web.config
is.
If you're in winforms, YOU NEED TO DO A POST BUILD EVENT, putting the
dataConfiguration.config file into the running folder /bin/ usually. (Just
mentioned for non web people)

Remember, the INSTANCE name is important. Not the connectionstring name,
not the connection string itself, just the instance name. (the
DataFactory.CreateDatabase method )

All of this should be in the quickstarts. But now you know what youre'
looking for.





start dataconfiguraiton.config file...




<?xml version="1.0" encoding="utf-8" ?>
<dataConfiguration>
<xmlSerializerSection
type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
Microsoft.EntLib.Data, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=null">
<enterpriseLibrary.databaseSettings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
defaultInstance="pubsInstance1"
xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/data">
<databaseTypes>
<databaseType name="Sql Server"
type="Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase,
Microsoft.EntLib.Data" />
<databaseType name="OleDB"
type="Microsoft.Practices.EnterpriseLibrary.Data.OleDbLib.OleDbDatabase,
Microsoft.EntLib.Data, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null" />
</databaseTypes>
<instances>
<instance name="pubsInstance1" type="Sql Server"
connectionString="pubsConnectionString1" />
<instance name="pubsInstance2" type="Sql Server"
connectionString="pubsConnectionString2" />

-->
</instances>
<connectionStrings>
<connectionString name="pubsConnectionString1">
<parameters>
<parameter name="database" value="pubs" isSensitive="false" />
<parameter name="Integrated Security" value="True" isSensitive="false"
/>
<!--
<parameter name="password" value="mypassword" isSensitive="true" />
<parameter name="user id" value="myusername" isSensitive="false" />
-->
<parameter name="server" value="SERVER1" isSensitive="false" />
</parameters>
</connectionString>


<connectionString name="pubsConnectionString2">
<parameters>
<parameter name="database" value="pubs" isSensitive="false" />
<parameter name="Integrated Security" value="True" isSensitive="false"
/>
<!--
<parameter name="password" value="mypassword" isSensitive="true" />
<parameter name="user id" value="myusername" isSensitive="false" />
-->
<parameter name="server" value="SERVER2" isSensitive="false" />
</parameters>
</connectionString>



</connectionStrings>
</enterpriseLibrary.databaseSettings>
</xmlSerializerSection>
</dataConfiguration>




end dataConfiguration.data file


start entries need to ADD to web.config



<configSections>
<section name="enterpriselibrary.configurationSettings"
type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>





<enterpriselibrary.configurationSettings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
applicationName="Application"
xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
<configurationSections>
<configurationSection name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File
Storage Provider" path="dataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml
Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<includeTypes />
</enterpriselibrary.configurationSettings>
 
S

sloan

Ok.

Stop calling the Enterprise.Data stuff "DAAB". (please).

That's where you'll get wires crossed.

DAAB 2.0 was the last one, and was sql server specific.

EnterpriseLibrary.Data is more abstract, and allows multiple backend rdbms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top