Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Thursday, March 29, 2012

Console.WriteLine generates HostProtectionException

Gotcha!

It took a few minutes of staring at my CLR method (it's actually a ServiceBroker service), trying to figure out why I was getting an exception on something that looked pretty innocuous.

It turned out to be the Console.WriteLine(...) statement. In hindsight, not really much of a surprise . However, for debugging purposes, I'd still like to use Console.WriteLine. Is there a HostProtectionAttribute I can apply that will allow it?

Josh

Yes, you are right, Console.WriteLine is not the appropiate output for debugging in SQL Server. What about using any trace source or even to keep it simple the System.Diagnostics namespace ? This one has some method for the output during the debbuging process.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Sunday, March 25, 2012

connot connect to the repository with Analysis Service

I have a problem with Analysis Services.

When I open Analysis Manager and try to connect to the SQL server with Analysis Service, the following error message is displayed:

"connot connect to the repository. Error:Could not use ''; file already in use."

the server and my local machine all both using SQL server 2000 with SP4

any help will be appreciate, thanks in advance.

Benjamin

Looks like your repository is not migrated to SQL Server, but still in msmdrep.mdb file. Do you have enough permissions to open it ? Do you have access to $MsOlapRepository share ?

Connetion VS2003 C# Web Service to Sql Server 2005 Express

Hi,

I'm reaching the end of my tether here. I'm writing a Web Service application for my MCAD course in VS2003 which will connect to a SQL Server 2005 Express instance to access data. I can connect to the instance through the management suite, and through Visual Studio 2003. For some reason, when I try and manually connect through the web service, I get a page cannot be displayed error. When debugging, it falls over at the connection code. Here's what I have:

<appSettings>

<add key="ConnectionString" value="Integrated Security=SSPI;Initial Catalog=OfficeSupplies;Data Source=SGODRICH\SQLEXPRESS;"/>

</appSettings>

in web.config, and in my application:

// Create a connection to SQL Server Express

connection = new SqlConnection(ConnectionInfo);

// Upload Customer data to DataTable

dataadapter1 = new SqlDataAdapter("select * from Customers", connection);

dataadapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey;

Customer_Data = new DataTable("Customers");

dataadapter1.Fill(Customer_Data);

The line in red is where the application falls over and I get a page cannot be displayed error. Any ideas why my application can't connect yet I can through both the manager and the IDE? I have enabled TCP, named pipes and shared memory. I have TCP dynamic port of 1053, I can connect using SQLCMD -S.\SQLEXPRESS from the command prompt (I get a 1> when I do this). I also have both services up and running. Anyone have any idea?

If the error happens in the red line, then your connection string is wrong. The error occurs in the constructor of the sqlconnection class not during connection which would be the .Open() method.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||Ooops. My apologies. I guess working so close to a problem blinds you to its issues. Its working fine now. Well, for now...

Thursday, March 22, 2012

Connectivity issue with SQL 2005 Developer Edition Named Instance

Hi,

I have installed one default and one named instance of SQL Server 2005 Dev. Editition SP2 on my server.

The Named service is configured to use Shared, NamedPipe and TCP (Port 4333).

There is no firewall on the machine. But still i am not able to connect to it form remote computer.

can any one help me with these. this is urgent.

Thanks.

KV

I found it. My SQL Browser service was running under domain account which was not working, i have configured it to run under NetworkService and it has started. Smilesqlsql

Tuesday, March 20, 2012

Connections...

Dear All,
SQL Server 2000, Service Pack 3a
We have a problem with locking where as soon as something deadlocks the
application fails.
There are two solutions that spring to mind, either totally re-writing the
Application or setting the SET LOCK_TIMEOUT command.
Now currently we cannot do the re-write as the developers don't have time (I
was out voted) so we are looking to the Set Lock_Timeout, but here is the
problem.
The Connections used are set by JBOSS and our developers cannot find a way
of setting the SET LOCK_TIMEOUT to the connection through JBOSS.
What I was wondering then was is there a way through SQL, i.e. Whenever a
connection is created it automatically does a SET LOCK_TIMEOUT ?
If not could someone go through how a connection is actually created?, so I
can attempt to put a trigger somewhere.
I would totally agree that this is a 'hack' fix and does not solve the
underlying problem but they want a quick fix :(
JJulie,
changing the Lock timeout won't solve you're problem. The Lock timeout
only defines how long a query wait for a resource until a exlusive lock
is released. By default a query waits indefinetely until the lock is
released.
Deadlocks are different. SQL Server detects if a deadlock occurs and
the kills one process, the deadlock victim. This happens very fast, so
the time the resource is locked would be shorter than your timeout.
You need to catch the error 1205 and the handle it in your application.
I don't think there's a alternative for that.
Markus

Connections...

Dear All,
SQL Server 2000, Service Pack 3a
We have a problem with locking where as soon as something deadlocks the
application fails.
There are two solutions that spring to mind, either totally re-writing the
Application or setting the SET LOCK_TIMEOUT command.
Now currently we cannot do the re-write as the developers don't have time (I
was out voted) so we are looking to the Set Lock_Timeout, but here is the
problem.
The Connections used are set by JBOSS and our developers cannot find a way
of setting the SET LOCK_TIMEOUT to the connection through JBOSS.
What I was wondering then was is there a way through SQL, i.e. Whenever a
connection is created it automatically does a SET LOCK_TIMEOUT ?
If not could someone go through how a connection is actually created?, so I
can attempt to put a trigger somewhere.
I would totally agree that this is a 'hack' fix and does not solve the
underlying problem but they want a quick fix
JJulie,
changing the Lock timeout won't solve you're problem. The Lock timeout
only defines how long a query wait for a resource until a exlusive lock
is released. By default a query waits indefinetely until the lock is
released.
Deadlocks are different. SQL Server detects if a deadlock occurs and
the kills one process, the deadlock victim. This happens very fast, so
the time the resource is locked would be shorter than your timeout.
You need to catch the error 1205 and the handle it in your application.
I don't think there's a alternative for that.
Markus

Monday, March 19, 2012

connections

im writing a service that will be on a app server
this is one of many service's to process Recordsets from Sql Server...
1 service may have 20 Processes to Complete
example
main class PreProcess()
method CleanNames();
method updateNames();
methodr ValidateContracts();
Various things must be completed
Suedo Example below
My question is
in the main class make my connection and keep it for all sub members
or connect in each member
A. This Way opens connection...closes connect

method cleanNames()
1 get connection
2 get recordset
3. Close Connection
4 process Recordset
5. Open Connection
4 Commit Changes
6. Close Connection()
finished cleanames()
or
method cleanNames()
1 get connection
2 get recordset
3 process Recordset
4 Commit Changes
5. Close Connection()
finished cleanames()
or
this final way is in the parent Class or Calling Function
sends in the connections holds it open till the service is
completed of all jobs its Suppose to do
then releases the connection

method cleanNames(oconn) connection as parameter
1 get recordset
2 process Recordset
3 Commit Changes
finished cleanames()

Thanks
DavePDaveP (dvs_bis@.sbcglobal.net) writes:

Quote:

Originally Posted by

im writing a service that will be on a app server
this is one of many service's to process Recordsets from Sql Server...
1 service may have 20 Processes to Complete
example
main class PreProcess()
method CleanNames();
method updateNames();
methodr ValidateContracts();
Various things must be completed
Suedo Example below
My question is
in the main class make my connection and keep it for all sub members
or connect in each member


I'm not really sure I understand, but if the members are intended to
be separate threads, you should definitely have one connection per
member.

If they are just different tasks that a single-threaded service will
perform, it's more of a toss-up, but I think the idiom today is to stick
with local connections. Keep in mind that ADO .Net maintains a connection
pool where it lingers to disconnected connections and then reuse them
if there is a request for a connect with the same properties within
some timefram (60 seconds, I believe).

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Wednesday, March 7, 2012

Connection Timeout

I am trying to upload data to my sql database via a web service installed on
the same machine as sql server. When my upload takes more than about 2
minutes I get a timeout error message from my web service and the data
tranfer was not completed. Transfers taking less time complete
satisfactorily. My web.config file for the web service has httpRuntime
executionTimeout set to 360 and maxRequestLength set to 30720. I continue to
get timeout error messages from my web service. I need my connection to stay
open for upto 5 minutes for those situations when I have large files to move
or my client computer has a slow internet upload capability. Am I forgetting
some setting that still needs to be made?
Thanks,
Fred Herring
there is a proxytimeout setting somewhere increase it like this
proxy.Timeout=2000;
see here
http://www.dotnetbips.com/displayarticle.aspx?id=112
we had the same problem and this fixed it
"Fred Herring" <FredHerring@.discussions.microsoft.com> wrote in message
news:B5CBD211-81B5-4693-A2A3-32FBA66780AF@.microsoft.com...
>I am trying to upload data to my sql database via a web service installed
>on
> the same machine as sql server. When my upload takes more than about 2
> minutes I get a timeout error message from my web service and the data
> tranfer was not completed. Transfers taking less time complete
> satisfactorily. My web.config file for the web service has httpRuntime
> executionTimeout set to 360 and maxRequestLength set to 30720. I continue
> to
> get timeout error messages from my web service. I need my connection to
> stay
> open for upto 5 minutes for those situations when I have large files to
> move
> or my client computer has a slow internet upload capability. Am I
> forgetting
> some setting that still needs to be made?
> Thanks,
> Fred Herring
>
>

Saturday, February 25, 2012

Connection Timeout

I am trying to upload data to my sql database via a web service installed on
the same machine as sql server. When my upload takes more than about 2
minutes I get a timeout error message from my web service and the data
tranfer was not completed. Transfers taking less time complete
satisfactorily. My web.config file for the web service has httpRuntime
executionTimeout set to 360 and maxRequestLength set to 30720. I continue t
o
get timeout error messages from my web service. I need my connection to sta
y
open for upto 5 minutes for those situations when I have large files to move
or my client computer has a slow internet upload capability. Am I forgettin
g
some setting that still needs to be made?
Thanks,
Fred Herringthere is a proxytimeout setting somewhere increase it like this
proxy.Timeout=2000;
see here
http://www.dotnetbips.com/displayarticle.aspx?id=112
we had the same problem and this fixed it
"Fred Herring" <FredHerring@.discussions.microsoft.com> wrote in message
news:B5CBD211-81B5-4693-A2A3-32FBA66780AF@.microsoft.com...
>I am trying to upload data to my sql database via a web service installed
>on
> the same machine as sql server. When my upload takes more than about 2
> minutes I get a timeout error message from my web service and the data
> tranfer was not completed. Transfers taking less time complete
> satisfactorily. My web.config file for the web service has httpRuntime
> executionTimeout set to 360 and maxRequestLength set to 30720. I continue
> to
> get timeout error messages from my web service. I need my connection to
> stay
> open for upto 5 minutes for those situations when I have large files to
> move
> or my client computer has a slow internet upload capability. Am I
> forgetting
> some setting that still needs to be made?
> Thanks,
> Fred Herring
>
>

Sunday, February 12, 2012

Connection provider for DBF file

Hi, I want to upload some DBF files to SQL server using Integration Service.
I already check every provider, but not found provider for DBF file.
Anyone can help me?

Hello,

When you create a data source, just use the provider "Microsoft Jet 4.0 OLE DB ..."

Then try a OLE DB Source or a Datareader source over the data source created.

Hope it helps

|||

Hi!

You can download the FoxPro and Visual FoxPro OLE DB data provider from msdn.microsoft.com/vfoxpro/downloads/updates. It works for all versions of Fox tables.

|||

Hi!

While the Jet OLE DB data provider will work for older Dbase IV formatted DBFs it will not work for Visual FoxPro tables. The FoxPro and Visual FoxPro OLE DB data provider works with all versions of FoxPro DBFs. As I said in my other post, it can be downloaded from msdn.microsoft.com/vfopxor/downloads/updates.

|||You're right.
Thanks a lot.

Connection problems

I just installed 2005 and have an instance of Enterprise on my local machine. My SSAS service appears to be working properly in Services. However, whenever I try to deploy a cube (simple one from tutorial) or try to connect from Management Console, I get rejected. The error message is:

No connection could be made because the target machine actively refused it (System).

I've tried about everything I can think of and can't get past this. Any guidance would be greatly appreciated.

If you have a named instance installed (you can tell by looking at the service name "SQL Server Analysis Services (INSTANCE_NAME)"), then you need to set the Target Server project property (right click on the Analysis Services project in VS, use Properties, go to Deployment tab and set Server to "localhost\INSTANCE_NAME").

If you are disconnected from the network, try using 127.0.0.1 instead of machine name.

Adrian Dumitrascu

|||I'm dealing with the same problem. But as I can se I don't have an instance of Analysis Service running. I have just an instance of Database Engine (my_host_name\SQLExpress). How can I create an instance of Analysis Services? Please!!!|||

If you don't have the "SQL Server Analysis Services" service at all (default instance or named instance), you'll need to re-run Setup to install it.

Adrian Dumitrascu

connection problem...

I have installed SQLEVAL and the service pach 3 on
Windows XP Home edition... now i can't use telnet/ftp
connection because my port23 is closed and i can't
uninstall SQL because there isn't an uninstallation file.
I don't know what i have to do.
thanks to much.
lmcHi
I have never used the EVAL edition, but...
I am not sure why you think that SQLServer will be using port 23?
You may want to check out the server network utitily in the SQL Server
program group.
If there is no add/remove program in control panel, have you check the
installation log to see that it worked? You may find a remove option in the
original setup program?
John
"lmc" <lmc76@.libero.it> wrote in message
news:006e01c3cc97$b1630350$a101280a@.phx.gbl...
quote:

> I have installed SQLEVAL and the service pach 3 on
> Windows XP Home edition... now i can't use telnet/ftp
> connection because my port23 is closed and i can't
> uninstall SQL because there isn't an uninstallation file.
> I don't know what i have to do.
> thanks to much.
> lmc

Connection problem with WinXP SP2

We have several loptops that run Windows XP and have SQL
Server databases, which we access through a Java
application. After WinXP Service Pack 2 was installed,
none of the laptops can connect to the database. We have
tried opening port 1433 for TCP/IP and port 445 for Named
Pipes; still no connection. If we uninstall SP2, the
problem disappears. Has anyone else seen this behavior, or
have any ideas of other approaches to making the
connection with SP2 on the laptop?
apart from 1433, you need to open UDP port 1434 also for SQL Server.
John Wilheim wrote:
> We have several loptops that run Windows XP and have SQL
> Server databases, which we access through a Java
> application. After WinXP Service Pack 2 was installed,
> none of the laptops can connect to the database. We have
> tried opening port 1433 for TCP/IP and port 445 for Named
> Pipes; still no connection. If we uninstall SP2, the
> problem disappears. Has anyone else seen this behavior, or
> have any ideas of other approaches to making the
> connection with SP2 on the laptop?

Friday, February 10, 2012

Connection problem with WinXP SP2

We have several loptops that run Windows XP and have SQL
Server databases, which we access through a Java
application. After WinXP Service Pack 2 was installed,
none of the laptops can connect to the database. We have
tried opening port 1433 for TCP/IP and port 445 for Named
Pipes; still no connection. If we uninstall SP2, the
problem disappears. Has anyone else seen this behavior, or
have any ideas of other approaches to making the
connection with SP2 on the laptop?apart from 1433, you need to open UDP port 1434 also for SQL Server.
John Wilheim wrote:
> We have several loptops that run Windows XP and have SQL
> Server databases, which we access through a Java
> application. After WinXP Service Pack 2 was installed,
> none of the laptops can connect to the database. We have
> tried opening port 1433 for TCP/IP and port 445 for Named
> Pipes; still no connection. If we uninstall SP2, the
> problem disappears. Has anyone else seen this behavior, or
> have any ideas of other approaches to making the
> connection with SP2 on the laptop?

Connection Problem VB.Net 2003 to SQL 2000

Hi,
I have a webservice created in VB.NET 2003 hosted on a Windows 2003
server. This service inserts data into a SQL Server 2000 database also
hosted on a Windows 2003 server. The webserver is in a closed DMZ and
the Database Sever is on the internal network. The firewall is
configured to allow traffic to the DB Server on port 1433. Form the
outside world the request get passed throught to the webserver as it
should be. However when the request from the webserver is passed to
the DB server the request on port 1433 is being passed but two
requests one on port 137 and one on port 445 are being dropped. Can
anyone tell me why a simple sqlCommand.ExecuteNonQuery() would need to
use 137 and 445?
Many thanks
FredFred,
These articles don't apply directly to your situation, but they do explain
those additional ports:
http://support.microsoft.com/kb/841251/
http://support.microsoft.com/kb/841249/
Kerry Moorman
"Fred" wrote:

> Hi,
> I have a webservice created in VB.NET 2003 hosted on a Windows 2003
> server. This service inserts data into a SQL Server 2000 database also
> hosted on a Windows 2003 server. The webserver is in a closed DMZ and
> the Database Sever is on the internal network. The firewall is
> configured to allow traffic to the DB Server on port 1433. Form the
> outside world the request get passed throught to the webserver as it
> should be. However when the request from the webserver is passed to
> the DB server the request on port 1433 is being passed but two
> requests one on port 137 and one on port 445 are being dropped. Can
> anyone tell me why a simple sqlCommand.ExecuteNonQuery() would need to
> use 137 and 445?
> Many thanks
> Fred
>

Connection Problem VB.Net 2003 to SQL 2000

Hi,
I have a webservice created in VB.NET 2003 hosted on a Windows 2003
server. This service inserts data into a SQL Server 2000 database also
hosted on a Windows 2003 server. The webserver is in a closed DMZ and
the Database Sever is on the internal network. The firewall is
configured to allow traffic to the DB Server on port 1433. Form the
outside world the request get passed throught to the webserver as it
should be. However when the request from the webserver is passed to
the DB server the request on port 1433 is being passed but two
requests one on port 137 and one on port 445 are being dropped. Can
anyone tell me why a simple sqlCommand.ExecuteNonQuery() would need to
use 137 and 445?
Many thanks
Fred
Fred,
These articles don't apply directly to your situation, but they do explain
those additional ports:
http://support.microsoft.com/kb/841251/
http://support.microsoft.com/kb/841249/
Kerry Moorman
"Fred" wrote:

> Hi,
> I have a webservice created in VB.NET 2003 hosted on a Windows 2003
> server. This service inserts data into a SQL Server 2000 database also
> hosted on a Windows 2003 server. The webserver is in a closed DMZ and
> the Database Sever is on the internal network. The firewall is
> configured to allow traffic to the DB Server on port 1433. Form the
> outside world the request get passed throught to the webserver as it
> should be. However when the request from the webserver is passed to
> the DB server the request on port 1433 is being passed but two
> requests one on port 137 and one on port 445 are being dropped. Can
> anyone tell me why a simple sqlCommand.ExecuteNonQuery() would need to
> use 137 and 445?
> Many thanks
> Fred
>

Connection Problem

I decide to deattach my database from its original location and i dont know waht i did and now when i tried to open my service to watch my database object it tell me connection failed could not found your default database.Howdy

If you detach a database, its not visible on the server any more, so you wont be able to connect to it.

Cheers,

SG