Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Tuesday, March 20, 2012

Cannot open SQLServer Databaer Under IIS

ConnectionString is below.

Dim objDb As New SqlConnection("Data Source='(local)';trusted_connection=true;Initial Catalog=classdb")

This ConnectionString occurs DB-Open-Error. Why?

Show me the Solution.

what xactly is the error message ?
|||

Try this url for samples. Hope this helps.

http://www.carlprothman.net/Default.aspx?tabid=81

Cannot open database requested by the login.

Visual Studio
MS SQL Server
i have this connection string...
Data Source=.\SQLEXPRESS;Initial Catalog=dbName;Integrated Security=SSPI;
but an error appears on my conn.Open();
Cannot open database "dbName" requested by the login. The login failed.
Login failed for user 'SERVER\yshie'.
yshie is my username in the computer i use. just to clarify, there are two
user accounts in my pc but both of them are administrators.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server-connectivity/200703/1
ok.. i'll start from a scratch! kindly help me build my connection string!
pls don't refer me to different websites because i can't understand those
terms(user instance... etc) so its useless for me. all i know is that i have
this visual studio 2005 and isn't it that inside there is ms sql server where
i created my database. what connection string will i use?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server-connectivity/200703/1
|||One of the problems with the approach of "just tell me what
string to use and I don't understand the terms so don't go
into that" is that the problems you are having with the
connection string is from not understanding what those parts
of the string mean. It's like creating classes without
wanting to know what properties or methods are.
You said you are using this string:
Data Source=.\SQLEXPRESS;Initial Catalog=dbName;Integrated
Security=SSPI;
And that you get the error:
Cannot open database "dbName" requested by the login. The
login failed.
Login failed for user 'SERVER\yshie'.
The problem is that the login user (you) do not have access
to the database dbName or the database dbName does not exist
on the server. If the database you are using in your string
really is dbName then that database must exist on the server
and you must have access to it.
Just as a connection test, trying changing your Initial
Catalog to master. Keep the data source as: .\SQLEXPRESS
And keep the Integrated Security set to SSPI
-Sue
On Fri, 30 Mar 2007 04:25:14 GMT, "yshie via droptable.com"
<u32884@.uwe> wrote:

>ok.. i'll start from a scratch! kindly help me build my connection string!
>pls don't refer me to different websites because i can't understand those
>terms(user instance... etc) so its useless for me. all i know is that i have
>this visual studio 2005 and isn't it that inside there is ms sql server where
>i created my database. what connection string will i use?

Cannot open database requested by the login.

Visual Studio
MS SQL Server
i have this connection string...
Data Source=.\SQLEXPRESS;Initial Catalog=dbName;Integrated Security=SSPI;
but an error appears on my conn.Open();
Cannot open database "dbName" requested by the login. The login failed.
Login failed for user 'SERVER\yshie'.
yshie is my username in the computer i use. just to clarify, there are two
user accounts in my pc but both of them are administrators.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...tivity/200703/1ok.. i'll start from a scratch! kindly help me build my connection string!
pls don't refer me to different websites because i can't understand those
terms(user instance... etc) so its useless for me. all i know is that i have
this visual studio 2005 and isn't it that inside there is ms sql server wher
e
i created my database. what connection string will i use?
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...tivity/200703/1|||One of the problems with the approach of "just tell me what
string to use and I don't understand the terms so don't go
into that" is that the problems you are having with the
connection string is from not understanding what those parts
of the string mean. It's like creating classes without
wanting to know what properties or methods are.
You said you are using this string:
Data Source=.\SQLEXPRESS;Initial Catalog=dbName;Integrated
Security=SSPI;
And that you get the error:
Cannot open database "dbName" requested by the login. The
login failed.
Login failed for user 'SERVER\yshie'.
The problem is that the login user (you) do not have access
to the database dbName or the database dbName does not exist
on the server. If the database you are using in your string
really is dbName then that database must exist on the server
and you must have access to it.
Just as a connection test, trying changing your Initial
Catalog to master. Keep the data source as: .\SQLEXPRESS
And keep the Integrated Security set to SSPI
-Sue
On Fri, 30 Mar 2007 04:25:14 GMT, "yshie via droptable.com"
<u32884@.uwe> wrote:

>ok.. i'll start from a scratch! kindly help me build my connection string!
>pls don't refer me to different websites because i can't understand those
>terms(user instance... etc) so its useless for me. all i know is that i hav
e
>this visual studio 2005 and isn't it that inside there is ms sql server whe
re
>i created my database. what connection string will i use?

Monday, March 19, 2012

Cannot open database "aspnetdb.mdf" requested by the login. The login failed.

Hello Guys

This is my connection string

<add name ="ASPNETDBConnectionString1" connectionString ="Data Source= .\SQLEXPRESS; Integrated Security = True; DataBase = ASPNETDB.MDF; User ID = MyWindowsUserName; Password = MyWindowsPassword; User Instance = False; Connect Timeout = 30" providerName ="System.Data.SqlClient"/>

I tried to research on the internet and i got a solution on changing the permissions for this database to enable user SystemName/ASPNET, but iam not able to access this ASPNETDB.MDF from SqlServer and if i go to server explorer in vs2005, i dint know where to chage the permissions.

Can anyone help me on this.

Thanks a lot

The ASPNET account needs to have access both to the server and to the ASPNETDB database. It seems you have granted server access to the account, but not database access.

To grant database access, connect to SQL Server using Management Studio and execute the following SQL statements:

use ASPNETDB
go
create user [SystemName\ASPNET]
go

Thanks
Laurentiu

|||

hi,

Thanks for your info abt the adding of aspnet account in the ASPNETDB Db.

I have created a website using VS 2005, and my SQL Server 2005 -STD Edition(NOT SQLEXPRESS). When ever i try to connect to the database i get this following error : Cannot open database ASPNETDB.MDF requested by the login, login failed. Login failed for user DOMAIN|USERNAME.

FYI, I have added my DOMAIN\username in the Security - Logins of the Database. I have also done the user mappings. That screen reads as follows :
1. Master Database -

Still I get this error. Please help me understand that whether any other permissions is required in the database for me.

Thanks

krans001

|||

hi,

I get this error when i try to execute a website just having a DEFAULT.aspx in which i have added a webpartsmanager. the personalization property of the webpartmanager is set to TRUE and USER. The following steps I did:

1. Installed the Microsoft SQL Server Management Studio 9.00.1399.00 ( STANDERD EDITION).

2. from the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 installed the aspnet_regsql and followed the steps in installing the aspnetdb database.

In the usermappings i have provided permissions to me "DOMAIN\USERNAME" to the following db: 1. master 2. msdb 3. tempdb 4. aspnetdb

3. in the edit global configuration removed the USER INSTANCE=TRUE from the following
Data Source=.\MSSQLSERVER2005;Initial Catalog=aspnetdb.mdf;Integrated Security=True

4. edited the machine.config file under the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
as
<add name="LocalSqlServer" connectionString="Data Source=.\MSSQLSERVER2005;Initial Catalog=aspnetdb.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />

After doing this i tried to execute the website that i have created which holds a default.aspx page in which i have the webpartmanager. I just wanted to view this file in the browser. As soon as i do this i get this error.

Cannot open database "aspnetdb.mdf" requested by the login. The login failed. Login failed for user 'DOMAIN\USERNAME'.

Thanks in advance for the solution. Please help.. if anyone has a solution please send it immediately to my email id : sriranga.kr@.gmail.com

|||

hi

all i did was removed the .mdf in the connection string and run the same. It works like a charm..

great...

|||

hi sreeksdave

all you need to do is to change the following :

<add name ="ASPNETDBConnectionString1" connectionString ="Data Source= .\SQLEXPRESS; Integrated Security = True; DataBase = ASPNETDB.MDF; User ID = MyWindowsUserName; Password = MyWindowsPassword; User Instance = False; Connect Timeout = 30" providerName ="System.Data.SqlClient"/>

AS

<add name ="ASPNETDBConnectionString1" connectionString ="Data Source= .\SQLEXPRESS; Integrated Security = True; Initial Catalog= ASPNETDB" providerName ="System.Data.SqlClient"/>

and see how it works..

Do let me know..

Regards

scotty

|||I think this should be rather aspnetdb than aspnetdb.mdf, if you use a user instance you have to specify the filename but with attached database you can just type in the name of the database.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||

Remember that both files ASPNETDB.MDF and aspnetdb_log.LDF are in a folder call App_Data in you project solution, just make sure that you give the right access privileges to your local MACHINE\ASPNET account

Hope this will help

|||

Hi all,

Thanks for all your contribution. It has worked for me and i have also helped few people.

Thanks & Regards

Raaj

|||

Hello Ranga,

Thanks a lot yar.

Hats off

Saturday, February 25, 2012

Cannot Install SP4 for SQL Server 2000

I am trying to install SP4 for SQL Server 2000.
When I click on the setup.bat, I get the message:
Setup Initialization Error
Access is denied
Source: 'C\SQL2kSP4\x86\setup\saqlsore.ini'
Target: 'C:\Document~1\dave\locals~1\temp\setupsql.ini'
I am installing the standard version of SQL Server on to Windows XP with
latest service packs.
According to the SP instructions, I set Local Security Policy | Local
Policies | Security Options to Silently Succeed for Devices: Unsigned
driver installation behavior.
I even gave "everyone" full control to C:\Documents and Settings\dave\Local
Settings\Temp
Still I get this error.
Does anyone have an ideas what I can do to avoid this error?Hello Dave,
I understand that you encountered error message "Setup Initialization Error
Access is denied" when installing SQL 2000 SP4. Please let me know if it's
not correct.
Based on my experience, the problem is the setupsql.ini file already exist
in that default folder C:\Document~1\dave\locals~1\temp\. You may want to
remove the file from that folder and try to run setup again.
If above method do not work, please try to log on as a different user with
local admin rights to try to install SP4.
If the issue persists, you may want to remove the folder C:\SQL2kSP4\, and
extract the setup file from the compressed exe file again.
Please let's know if this resolve the issue. I look forward to your update.
Thanks.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||That worked.
Thanks for your help!
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:%23$hToamSHHA.3604@.TK2MSFTNGHUB02.phx.gbl...
> Hello Dave,
> I understand that you encountered error message "Setup Initialization
> Error
> Access is denied" when installing SQL 2000 SP4. Please let me know if it's
> not correct.
> Based on my experience, the problem is the setupsql.ini file already exist
> in that default folder C:\Document~1\dave\locals~1\temp\. You may want to
> remove the file from that folder and try to run setup again.
> If above method do not work, please try to log on as a different user with
> local admin rights to try to install SP4.
> If the issue persists, you may want to remove the folder C:\SQL2kSP4\, and
> extract the setup file from the compressed exe file again.
> Please let's know if this resolve the issue. I look forward to your
> update.
> Thanks.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications
> <http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscriptions/support/default.aspx>.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>

Sunday, February 19, 2012

Cannot import Oracle data with OLE DB

I have a column in an Oracle source system with data type NUMBER(38,2). The value "-0.01" is causing problems when trying to import into a SSIS data-flow.

The only way I can import this into my data-flow is by using a Datareader connection manager using the ODBC Data Provider. My DSN is using the Oracle ODBC driver.

If I try and use the "Native OLE DB\Microsoft OLE DB Provider for Oracle" I get an error: "The data value cannot be converted for reasons other than sign mismatch or data overflow"

Judging by this post: http://microsoftdw.blogspot.com/2005/11/final-storyhow-to-get-data-out-of.html there aren't really any other combinations to try that will bring my data in as I want it.

I don't want to use ODBC though as:

    Its an old technology Its slow I have to deploy an additional DSN.

Can anyone tell me why the other options don't work? Why does Microsoft OLE DB Provider for Oracle have a problem with "-0.01"?

-Jamie

When I tried to reproduce the issue reported by you, I encountered different set of problems. I tried to copy data from a Oracle table with NUMBER(38,2) column to a SQL Server 2005 table with a NUMERIC (38,2) column using OraOLEDB (and later using MSDORA) OLE DB connection manager at the source. I dont get any error messages when I execute the package. However, no data is transferred and I do not see any data when I preview the data at the source. May be I am missing something that you did that produced the error message you got.|||

Well I can't even preview the data so I think my problem is more deep seated. My errors occur in the source adapter and hence I think I have a problem in the middleware.

-Jamie

Sunday, February 12, 2012

cannot generate ResultSet code

I am using Visual Studio 2005 and SQL Server mobile edition. From Visual Studio I went to Data->Add New Data Source. From there I created and added an SQL server Mobile database. I want to use result sets instead of data sets. A file was added to my profect called: "databaseNameDataSet.xsd". In the properties for that file, when I change the Custom Tool property to MSResultSetGenerator, I get the following error:

Failed to generate ResultSet code. Typed ResultSets are only valid for Microsoft SQL Server Mobile Edition databases.

But I am using a SQL Server Mobile Edition database. Any help will be appreciated.

We have tried to do the same but everything seems to be working on our side. Can you please let us know the exact repro steps so that I can repro here locally. Also can you try doing yourself the same steps in a fresh project?

Thanks

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

|||I have tried starting a new project and doing it with an existing project. You asked me to tell you the steps I did, but I already told you all the steps. I did finally get it working by starting a new project and adding an example database(northwind). For some reason that worked. I think somehow when it doesn't work, is when I create a new database, and it shows up in my solution explorer and in my server explorer, but not in my data sources. Why would it not be in my data sources when I just added it using the method mentioned where I choose add new data source? Anyway, even though I don't know what I did I finally got it addded as a data source, and it is working for now.|||

Glad that things are working on your end. Thanks for using SQL Mobile.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

|||i had to remove the |DataDirectory| tag in my connection string then it worked , when i add it back in the MSResultSetGenerator fails.

cannot generate ResultSet code

I am using Visual Studio 2005 and SQL Server mobile edition. From Visual Studio I went to Data->Add New Data Source. From there I created and added an SQL server Mobile database. I want to use result sets instead of data sets. A file was added to my profect called: "databaseNameDataSet.xsd". In the properties for that file, when I change the Custom Tool property to MSResultSetGenerator, I get the following error:

Failed to generate ResultSet code. Typed ResultSets are only valid for Microsoft SQL Server Mobile Edition databases.

But I am using a SQL Server Mobile Edition database. Any help will be appreciated.

We have tried to do the same but everything seems to be working on our side. Can you please let us know the exact repro steps so that I can repro here locally. Also can you try doing yourself the same steps in a fresh project?

Thanks

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

|||I have tried starting a new project and doing it with an existing project. You asked me to tell you the steps I did, but I already told you all the steps. I did finally get it working by starting a new project and adding an example database(northwind). For some reason that worked. I think somehow when it doesn't work, is when I create a new database, and it shows up in my solution explorer and in my server explorer, but not in my data sources. Why would it not be in my data sources when I just added it using the method mentioned where I choose add new data source? Anyway, even though I don't know what I did I finally got it addded as a data source, and it is working for now.
|||

Glad that things are working on your end. Thanks for using SQL Mobile.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

|||i had to remove the |DataDirectory| tag in my connection string then it worked , when i add it back in the MSResultSetGenerator fails.

cannot generate ResultSet code

I am using Visual Studio 2005 and SQL Server mobile edition. From Visual Studio I went to Data->Add New Data Source. From there I created and added an SQL server Mobile database. I want to use result sets instead of data sets. A file was added to my profect called: "databaseNameDataSet.xsd". In the properties for that file, when I change the Custom Tool property to MSResultSetGenerator, I get the following error:

Failed to generate ResultSet code. Typed ResultSets are only valid for Microsoft SQL Server Mobile Edition databases.

But I am using a SQL Server Mobile Edition database. Any help will be appreciated.

We have tried to do the same but everything seems to be working on our side. Can you please let us know the exact repro steps so that I can repro here locally. Also can you try doing yourself the same steps in a fresh project?

Thanks

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

|||I have tried starting a new project and doing it with an existing project. You asked me to tell you the steps I did, but I already told you all the steps. I did finally get it working by starting a new project and adding an example database(northwind). For some reason that worked. I think somehow when it doesn't work, is when I create a new database, and it shows up in my solution explorer and in my server explorer, but not in my data sources. Why would it not be in my data sources when I just added it using the method mentioned where I choose add new data source? Anyway, even though I don't know what I did I finally got it addded as a data source, and it is working for now.
|||

Glad that things are working on your end. Thanks for using SQL Mobile.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation

|||i had to remove the |DataDirectory| tag in my connection string then it worked , when i add it back in the MSResultSetGenerator fails.

cannot format numbers to CSV Destination file

Hi,

I would like to know if there is any trick to convert numbers to csv files. I don't have any control to format the numbers.

Source: Sql server

for example:

select cast( 1 as float)/ cast(201 as float)

Destination:CSV file

the output of the file is 4,9751243E-3

i don't want to have scientific notation on the number. I want the result to be 0,00497512437810945. how can i do it?

I tried to change the type of destination columns to String or numeric but nothing works. what is the influence of changing data type in the destination columns e the output to files?

I tried using convert but with the same results.

Can it be because of local settings or something else?

thanks

prb222

I am having this SAME problem and would be very happy if someone could provide a solution. I have found the only way to keep a long string of numbers in text format, is to switch it to text and then click on each individual cell and then the formula bar. This will not work when there are thousands of rows of records - way too much manual work. There has to be some way for the numbers to stay in their original format. HELP!!|||

Hi,

If I use a data viewer, I see the normal value but in the csv it gets converted to scientific.

I found this workaround. In case you do not need more precision, you should be fine.

select cast(cast( 1 as float)/ cast(201 as float) as decimal(28,28)) as myOutput

It generates the csv like this

.0049751243781094500000000000

if I open it in Excel I get this

0.00497512437810945

Philippe

|||I was having the same problem. I asked my co-worker if he knew, and said they put four quotes then concatenate in the select statement like '''' + field_name.

cannot format numbers to CSV Destination file

Hi,

I would like to know if there is any trick to convert numbers to csv files. I don't have any control to format the numbers.

Source: Sql server

for example:

select cast( 1 as float)/ cast(201 as float)

Destination:CSV file

the output of the file is 4,9751243E-3

i don't want to have scientific notation on the number. I want the result to be 0,00497512437810945. how can i do it?

I tried to change the type of destination columns to String or numeric but nothing works. what is the influence of changing data type in the destination columns e the output to files?

I tried using convert but with the same results.

Can it be because of local settings or something else?

thanks

prb222

I am having this SAME problem and would be very happy if someone could provide a solution. I have found the only way to keep a long string of numbers in text format, is to switch it to text and then click on each individual cell and then the formula bar. This will not work when there are thousands of rows of records - way too much manual work. There has to be some way for the numbers to stay in their original format. HELP!!|||

Hi,

If I use a data viewer, I see the normal value but in the csv it gets converted to scientific.

I found this workaround. In case you do not need more precision, you should be fine.

select cast(cast( 1 as float)/ cast(201 as float) as decimal(28,28)) as myOutput

It generates the csv like this

.0049751243781094500000000000

if I open it in Excel I get this

0.00497512437810945

Philippe

|||I was having the same problem. I asked my co-worker if he knew, and said they put four quotes then concatenate in the select statement like '''' + field_name.