Showing posts with label solutions. Show all posts
Showing posts with label solutions. Show all posts

Wednesday, March 28, 2012

Named Pipes Provider, error: 40 - AAAAAAAAAAAAAAARGH!

Hi,

I have been getting this error for about 6 hours now. I have read every article from google about it and absolutely none of the solutions work for me.

I am running Windows XP Home Edition

I downloaded and installed Visual Studio Web Developer Express about a week ago.

I downloaded SQL Server Express 2005 yesterday.

It installed fine.

I got my first error trying to add New Item->Sql Server Database only to find out the default instance SQLExpress was not working and i was running a different instance.

Anyway, I am trying to connect to sql server with the below code:

 SqlConnection myConnection =new SqlConnection("server=mycomp/mssqlserver;database=mydb;Trusted_Connection=yes"); SqlCommand myCommand =new SqlCommand("select category, title, article from articles where id=15");// + article + ");", myConnection); myConnection.Open();

Which give me the below error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 30: SqlCommand myCommand = new SqlCommand("select category, title, article from articles where id=15");// + article + ");", myConnection);Line 31:Line 32: myConnection.Open();Line 33: Line 34:

I have followed all the instructions online like enabling 445 firewall stuff, making sure i accept local and remote connection, enabling TCP/IP Named pipes and heaps of protocols ect but nothing works.

I am about to uninstall sql server and .net and call it quits.

This stupid server is too hard to configure.

If anyone could help me get it running it would be gretly appreciated however, this question seems to be asked all over the net and i have read gazzilions of threads with all kinds of answers but nothing works.

Thanks

Did you try to re-install SQL? and install it as default instance?

|||

Ok, I got your problem. You have to do some more configuration
Go to SQL Server - SQL Server Configuration Manager.
Check the protocols Named Pipes and TCP/IP should be enabled
then go to Client Protocols, and check Named Pipes and TCP/IP should be enabled

Please check it, I hope it works.
Let me know in case of any difficulties.

|||

Thanks guys.

As you can see in my first post i have tried all the common solutions like configuring the client protocols ect.

I think i will just reinstall and see how it goes.

Cheers

|||

Let us know how it turns out

Monday, March 19, 2012

MyTable, ServerTimeDimension, Null-Values

Hello experts,

I’ve got one Problem and four solutions, but none is a good one =(

My entire problem:

I’ve got a Dimension with a column Production_Date. I would like to relate it with a ServerTimeDimension. I created a ServerTimeDimension and related about the Dimension Usage it to my Dimension. In the Production_Date column are some Null values and now I’ve got some Problems.

My four solutions:

  1. to alter my dimension through one query and take just this rows with correct date à not good, because I don’t want to lose some Information
  2. to create a new named Calculation and alter all Null values through a very old date. Something like this:
    case when (INS_PRODUCTION_DATE is null)
    then '01.01.1969'
    else (CONVERT(VARCHAR(10), INS_PRODUCTION_DATE, 104))
    end à there are some wrong information now, that’s not so good too
  3. make a time dimension one this column à not so good, because I can’t make a hierarchy right now
  4. and to work with the ErrorConfiguration and KeyErrorLimit is the worst solution

Have somebody another good idea?

Best regards

Tschi2001

As a best practice, it is recommended you implement a date dimension table in your data warehouse and then add foreign key references to your fact table. The NULL date can be represented easily with this approach.

If that is not an option here, what is wrong with the UnknownMember/ErrorConfiguration option (Option 4)? This type of situation is just what that is for.

B.

|||

Hello Bryan,

You are right, that’s not a option here.

In my Opinion a correct cube have to work without use ErrorConfiguration.

And the Option UnknownMember doesn’t work with my cube or I make something wrong.

The way I try to solve this problem with UnknownMember:

- I take the Production Time Dimension (it’s my ServerTimeDimension)

- Went to Dimension Structure

- Look at the Date-Properties (it’s the Key of this Dimension)

- Went to KeyColumns

- Set NullProcessing to “ZeroOrBlank”

- Try to deploy

Came the old failure…

Made I something wrong or could it be that I misunderstand something?

Best regards

Alexander

|||

So, the first thing you need to do is configure the UnknownMember in your time dimension. To do this, set the UnknownMember property on the dimension to either Hidden of Visible. Then, open the cube and move to the Cube Structure tab and select each measure group referencing the time dimension. Set up the ErrorConfiguration as follows:

NullKeyConvertedToUnknown = IgnoreError

KeyErrorLimitAction = Stop Logging

Try that and see if that fixes the problem for you.

B.

|||

Thank you very much, it works very good !!!!

MyTable, ServerTimeDimension, Null-Values

Hello experts,

I’ve got one Problem and four solutions, but none is a good one =(

My entire problem:

I’ve got a Dimension with a column Production_Date. I would like to relate it with a ServerTimeDimension. I created a ServerTimeDimension and related about the Dimension Usage it to my Dimension. In the Production_Date column are some Null values and now I’ve got some Problems.

My four solutions:

  1. to alter my dimension through one query and take just this rows with correct date à not good, because I don’t want to lose some Information
  2. to create a new named Calculation and alter all Null values through a very old date. Something like this:
    case when (INS_PRODUCTION_DATE is null)
    then '01.01.1969'
    else (CONVERT(VARCHAR(10), INS_PRODUCTION_DATE, 104))
    end à there are some wrong information now, that’s not so good too
  3. make a time dimension one this column à not so good, because I can’t make a hierarchy right now
  4. and to work with the ErrorConfiguration and KeyErrorLimit is the worst solution

Have somebody another good idea?

Best regards

Tschi2001

As a best practice, it is recommended you implement a date dimension table in your data warehouse and then add foreign key references to your fact table. The NULL date can be represented easily with this approach.

If that is not an option here, what is wrong with the UnknownMember/ErrorConfiguration option (Option 4)? This type of situation is just what that is for.

B.

|||

Hello Bryan,

You are right, that’s not a option here.

In my Opinion a correct cube have to work without use ErrorConfiguration.

And the Option UnknownMember doesn’t work with my cube or I make something wrong.

The way I try to solve this problem with UnknownMember:

- I take the Production Time Dimension (it’s my ServerTimeDimension)

- Went to Dimension Structure

- Look at the Date-Properties (it’s the Key of this Dimension)

- Went to KeyColumns

- Set NullProcessing to “ZeroOrBlank”

- Try to deploy

Came the old failure…

Made I something wrong or could it be that I misunderstand something?

Best regards

Alexander

|||

So, the first thing you need to do is configure the UnknownMember in your time dimension. To do this, set the UnknownMember property on the dimension to either Hidden of Visible. Then, open the cube and move to the Cube Structure tab and select each measure group referencing the time dimension. Set up the ErrorConfiguration as follows:

NullKeyConvertedToUnknown = IgnoreError

KeyErrorLimitAction = Stop Logging

Try that and see if that fixes the problem for you.

B.

|||

Thank you very much, it works very good !!!!