473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DAAB and Connection to SQL 2000

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>

Oct 31 '07 #1
5 1634
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.

"<M>" <m_******@hotmail.comwrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
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>

Oct 31 '07 #2
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>

Oct 31 '07 #3
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>

Oct 31 '07 #4
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.S ql.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.C onfiguration.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.S ql.SqlDatabase,
Microsoft.EntLib.Data" />
<databaseType name="OleDB"
type="Microsoft.Practices.EnterpriseLibrary.Data.O leDbLib.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>

Oct 31 '07 #5

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.

"<M>" <m_******@hotmail.comwrote in message
news:11**********************@y42g2000hsy.googlegr oups.com...
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>

Oct 31 '07 #6

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

Similar topics

0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
3
by: veera sekhar kota | last post by:
hi, im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked...
0
by: veera sekhar kota | last post by:
im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked me to...
7
by: hansiman | last post by:
I'm unsure if I should call the close method (dr.Close()) of the sqldatareader after the following code: Dim dr As SqlDataReader = SqlHelper.ExecuteReader(strConn, CommandType.StoredProcedure,...
0
by: veera sekhar kota | last post by:
im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked me to...
6
by: ABC | last post by:
Follow my project, the connection database will not use Trused Connection from web server to database server. How to set DAAB's connection string with No Credentials Access?
18
by: Chubbly Geezer | last post by:
Now I'm coming from a VB6 background so I may be overlooking something here. I have functionality that is contained with 2 VB 2005 dll's. WARC_Subs_Reporting.dll which handles report functions...
2
by: =?Utf-8?B?TWlrZVo=?= | last post by:
I created a function to use DAAB return a datareader. The connection must keep opening when I consume the datareader. 1. I tested the function, it works. Even I use the datareader after 10...
3
by: Abhishek Tripathi | last post by:
Hi, I am using a code similar to Database db = DatabaseFactory.CreateDatabase("MyDB") in every function of my DAL that interacts directly to database. But recently I have started getting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.