Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Monday, March 19, 2012

another simple question, please help, thx a lot!

I have some issues for remotely connection a sqlexpress server 2005 with a c# desktop app,

in my local network, after I set a port forwarding service for the computer which runs sqlexpress server, I want my c# app connect to the sqlexpress server in another machine under same local network, the connection string is:

"server= 62.31.81.210.\SQLEXPRESS,1921; Database='EvoHealthSQLex'; Integrated Security=True"

however, that one only work in the sqlexpress server machine, if I try to use it in another machine, i got error 'Login failed for user 'BRISTOL-1\Guest', BRISTOL-1 is the full computer name of sqlexpress server machine, I found out the solution is to create a login for 'BRISTOL-1\Guest' (in sever management studio express):

CREATE LOGIN [BRISTOL-1\Guest] FROM WINDOWS; GO

then it fixed the problem I mentioned above, However, what I want to ask is when I change the server authentication from 'windows authentication mode' to 'Sql server and windows authtication mode', then i try to create a user like this:

CREATE LOGIN Ross WITH PASSWORD = 'changeme'; USE EvoHealthSQLex; CREATE USER Ross; GO 
Then I change my connection string to:
"server= 62.31.81.210.\SQLEXPRESS,1921; user id='Ross'; password='changeme'; Database='EvoHealthSQLex';
then I got the following error even when I user 'sa' user:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
 
I wonder why this happening ? it should be a stupid connectionstring problem just I don't know ..
I wonder can I use 'windows authentication' for remote access (outside local network)? if so, how do i specified the username, all BRISTOL-1\Guest ?
 
thanks a lot for your reading!
Can you post the extire exception stack trace?|||

sorry, it was a syntax program, I was being silly again...

it should be:

"server= 62.31.81.210.\SQLEXPRESS,1921; user id='Ross'; password='changeme'; Database='EvoHealthSQLex' "

I put a extra ';' in the end of the statement :

"server= 62.31.81.210.\SQLEXPRESS,1921; user id='Ross'; password='changeme'; Database='EvoHealthSQLex' ; "

now above error message disappear!

thanks very much for your help, learn a lot for this forum, as a newbie :)

|||

Hi, got a last question of this remote connection problem:

I send my program to my friend and ask him run it (as all my computer is within the same local network, although I use the router Ip address 62.31.81.210 instead of local ip address 168.192.0.3) and he got a error say' SQL server is not exist or access denied', I wonder whatelse can cause that happen ? anything to do with the port forwarding service? he does can browse my test website hosting in the same machine using the same ip address http://62.31.81.210(I also do a port forwarding service with port 80 as well), I wonder why he failed to connect to sqlexpress server...

Many thanks!

|||

You can find lots of troubleshooting info through

http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

In your case, the errormsg indicates that the client do not have connecitivity to the server. "168.192.0.3" mean host local address, which normally mean the host does not haveconnecitvity to the network. I am surprised that with 168.192.0.3, you can browse the server.

One you made sure you have network connectivity, you can try to "telnet 62.31,81,210 port" to see if TCP connectivity is ok between your client host and remote server. "use ctrl +]" and "quit" to exit the telnet console.

Once you have telnet test passes, you may try your sql connection.

|||

hi, thanks for your reply again, I just ask my another friend to try it and it works! I didn't use the local Ip address '168.192.0.3', I use the '62.31,81,219 1921', and I connect it with tcp/ip with no problem, so probably is my first friend's computer problem.

so far so good, thanks so much for your help, really appreciated !

Sunday, February 19, 2012

Analyzing a Query in SQL Server

I have to duplicate a bunch of reports that were produced by a VB6 app. Now I'm using C#, ASP.net and Crystal Reports via VS2003. Each executes a stored procedure in SQL Server (before and now).

For each report I have a Stored Procedure and a View. The View's SQL code is identical to the Stored Procedure except that the two input parameters (startDate and endDate) are removed because Views don't allow parameters.

Some of the reports work perfectly right off the bat. But others are timing out. My initial test of the timing out is to just display the View. If it fails then I know that the the report engine will fail too.

So now I'm trying out the SQL Query Analyzer tool to execute the code in one of the Views. It's now at 29 minutes and still going - at least it hasn't timed out!

My question is this: Is there a way I could examine what's going on with the query to see why it's taking so long?

Robert WernerHave a look at the query execution plan in the query analyzer, do you see any bottlenecks there ? During execution you might encounter a deadlock. looking in the appropiate node in SQL Server Enterprise Manager (Current Activity) you might be able to find the blocking process.

HTH, Jens K. Suessmeyer.

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

Thank you for your suggestion. I've never used that Execution Plan before so just tried it out on one of the queries that's timing out. I took the liberty of taking a screen capture and posting it here:

http://pocketpollster.com/downloads/public/WBMCST11_Execution_Plan.jpg

Does this communicate anything to you?

Robert Werner
Vancouver, BC|||THe information which is sensitive while moving over the individual objects is missing for us, so its hard to tell. This is the estimated execution plan not the actual executed one, but as a rule of thumb you should have a look on the highest cost in the plan as well as actions like table scans. They are often costly if made for huge tables but are on the opposite cheaper then using indexes in smaller tables. There are some other thing you could check like setting the STATISTICS_IO to on or the SHOWPLAN to make the execution plan shippable to other peers with more information.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Thursday, February 16, 2012

Analysis Services web application authentication problem

In the following sceanrio
Web application uses Analysis Services to present data.
Web App (IIS) is installed on a different server to the SQL Server instance.
Web app uses Windows Integrated authentication.
It appears that the authentication is not correctly passed to AS and that
the app then fails.
This does not seem to be the case where AS and IIS are installed on the same
machine.
Does this sound familiar and if so are you aware of any fixes/workaroundsBTW: If the web app uses basic authentication then everything works......
"Andrew Wiles" <ajw@.nospam.please> wrote in message
news:edNjY9rhEHA.1964@.tk2msftngp13.phx.gbl...
> In the following sceanrio
>
> Web application uses Analysis Services to present data.
> Web App (IIS) is installed on a different server to the SQL Server
instance.
> Web app uses Windows Integrated authentication.
>
> It appears that the authentication is not correctly passed to AS and that
> the app then fails.
>
> This does not seem to be the case where AS and IIS are installed on the
same
> machine.
>
> Does this sound familiar and if so are you aware of any fixes/workarounds
>

Analysis Services web application authentication problem

In the following sceanrio
Web application uses Analysis Services to present data.
Web App (IIS) is installed on a different server to the SQL Server instance.
Web app uses Windows Integrated authentication.
It appears that the authentication is not correctly passed to AS and that
the app then fails.
This does not seem to be the case where AS and IIS are installed on the same
machine.
Does this sound familiar and if so are you aware of any fixes/workarounds
BTW: If the web app uses basic authentication then everything works......
"Andrew Wiles" <ajw@.nospam.please> wrote in message
news:edNjY9rhEHA.1964@.tk2msftngp13.phx.gbl...
> In the following sceanrio
>
> Web application uses Analysis Services to present data.
> Web App (IIS) is installed on a different server to the SQL Server
instance.
> Web app uses Windows Integrated authentication.
>
> It appears that the authentication is not correctly passed to AS and that
> the app then fails.
>
> This does not seem to be the case where AS and IIS are installed on the
same
> machine.
>
> Does this sound familiar and if so are you aware of any fixes/workarounds
>
|||Hi Andrew,
I realise this post is getting quite old now, but We are experiencing the same problem here,
Did you manage to get it resolved?

Quote:

Originally posted by Andrew Wiles
In the following sceanrio
Web application uses Analysis Services to present data.
Web App (IIS) is installed on a different server to the SQL Server instance.
Web app uses Windows Integrated authentication.
It appears that the authentication is not correctly passed to AS and that
the app then fails.
This does not seem to be the case where AS and IIS are installed on the same
machine.
Does this sound familiar and if so are you aware of any fixes/workarounds