Showing posts with label exe. Show all posts
Showing posts with label exe. Show all posts

Sunday, March 11, 2012

.NET Runtime 2.0 Error

Hi there.
Recently event viewer started showing the .NET Runtime 2.0 error event.
The body is:
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 system, P5
2.0.0.0, P6 45b04225, P7 3a3e, P8 7a, P9 system.unauthorizedaccess, P10 NIL.
Have already reinstalled the 2.0 framework and the 3.0 but no luck here.
It happens when Reporting Services 2005 is somehow invoqued, either in
manager, server, visual studio or for rendering.
This is a cross-post to .NET Framework and Reporting Services since it seems
that is correlated to both.
I'll continue looking at it, but any help appreciated.
TIA,*Update:
Debug of w3wp:
System.UnauthorizedAccessException was unhandled
Message: Access to the port is denied.
Perhaps this are the wrong newsgroups but since the thread was started
better well try to finish it.
"Hugo Figueira" wrote:
> Hi there.
> Recently event viewer started showing the .NET Runtime 2.0 error event.
> The body is:
> EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 system, P5
> 2.0.0.0, P6 45b04225, P7 3a3e, P8 7a, P9 system.unauthorizedaccess, P10 NIL.
> Have already reinstalled the 2.0 framework and the 3.0 but no luck here.
> It happens when Reporting Services 2005 is somehow invoqued, either in
> manager, server, visual studio or for rendering.
> This is a cross-post to .NET Framework and Reporting Services since it seems
> that is correlated to both.
> I'll continue looking at it, but any help appreciated.
> TIA,
>|||Smee again.
Working. Did a couple of iisreset and it started working (this time!)
Strange since i already have done that, including system restarts.
Thx for the thread space :)
Cheers,
Hugo
"Hugo Figueira" wrote:
> *Update:
> Debug of w3wp:
> System.UnauthorizedAccessException was unhandled
> Message: Access to the port is denied.
> Perhaps this are the wrong newsgroups but since the thread was started
> better well try to finish it.
>
> "Hugo Figueira" wrote:
> > Hi there.
> >
> > Recently event viewer started showing the .NET Runtime 2.0 error event.
> > The body is:
> >
> > EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 system, P5
> > 2.0.0.0, P6 45b04225, P7 3a3e, P8 7a, P9 system.unauthorizedaccess, P10 NIL.
> >
> > Have already reinstalled the 2.0 framework and the 3.0 but no luck here.
> >
> > It happens when Reporting Services 2005 is somehow invoqued, either in
> > manager, server, visual studio or for rendering.
> >
> > This is a cross-post to .NET Framework and Reporting Services since it seems
> > that is correlated to both.
> >
> > I'll continue looking at it, but any help appreciated.
> >
> > TIA,
> >
> >

Thursday, March 8, 2012

.NET Data Adapter not taking Alias added in ClientNetwork Utility

I added an alias in Client Network Utility. (cliconfg.exe).
I am in Administrators and hence was able to add the ALias.
Alias Name : MyDatabase
Protocols Enabled : Named Pipes, TCP/IP.
Protocol for Alias : tried both Tcp/ip and Named Pipes
Server : MyServer
From query analyser if I try to open "MyDatabase" it opens the server
From .NET Windows Server, I give it in connection string - it doesnt take
it.
Note : this is not working only on this server. Another similarly configured
server, takes this.
Any Help is much appreciated.
Gan
--
Ganesan Subramanian
Microsoft Technologies and SolutionsI wasn't aware that .NET would even look at the client network utility. Are
you sure that's in its list of things to check (especially considering that
SQL Server / client network utility is not always going to be installed
where .NET is installed)? I thought for most applications it was HOSTS,
then WINS, then DNS... and SQL Server uses the client network utility on its
own?
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
news:eODEacVREHA.4048@.TK2MSFTNGP10.phx.gbl...
>I added an alias in Client Network Utility. (cliconfg.exe).
> I am in Administrators and hence was able to add the ALias.
> Alias Name : MyDatabase
> Protocols Enabled : Named Pipes, TCP/IP.
> Protocol for Alias : tried both Tcp/ip and Named Pipes
> Server : MyServer
> From query analyser if I try to open "MyDatabase" it opens the server
> From .NET Windows Server, I give it in connection string - it doesnt take
> it.
> Note : this is not working only on this server. Another similarly
> configured
> server, takes this.
> Any Help is much appreciated.
> Gan
> --
> Ganesan Subramanian
> Microsoft Technologies and Solutions
>
>|||It was .NET SQL Data adapter for SQL Server.
This was working on another similar box.
I gave "MyDatabase" for datasource in connection string and it was working.
Any idea what setting should be set on to get this working?
Gan
--
Ganesan Subramanian
Microsoft Technologies and Solutions
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OF#DNObREHA.4020@.TK2MSFTNGP11.phx.gbl...
> I wasn't aware that .NET would even look at the client network utility.
Are
> you sure that's in its list of things to check (especially considering
that
> SQL Server / client network utility is not always going to be installed
> where .NET is installed)? I thought for most applications it was HOSTS,
> then WINS, then DNS... and SQL Server uses the client network utility on
its
> own?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
> news:eODEacVREHA.4048@.TK2MSFTNGP10.phx.gbl...
> >I added an alias in Client Network Utility. (cliconfg.exe).
> > I am in Administrators and hence was able to add the ALias.
> >
> > Alias Name : MyDatabase
> > Protocols Enabled : Named Pipes, TCP/IP.
> > Protocol for Alias : tried both Tcp/ip and Named Pipes
> > Server : MyServer
> >
> > From query analyser if I try to open "MyDatabase" it opens the server
> >
> > From .NET Windows Server, I give it in connection string - it doesnt
take
> > it.
> >
> > Note : this is not working only on this server. Another similarly
> > configured
> > server, takes this.
> >
> > Any Help is much appreciated.
> >
> > Gan
> >
> > --
> > Ganesan Subramanian
> > Microsoft Technologies and Solutions
> >
> >
> >
>|||This is nothing more than name resolution issue. When you use cliconfg.exe
and entry is added to:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo]
which should be enumerated by ADO/.Net. Check to see if the running user has
access to read the registry.
-oj
http://www.rac4sql.net
"Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
news:%23GnrrNgREHA.2876@.TK2MSFTNGP09.phx.gbl...
> It was .NET SQL Data adapter for SQL Server.
> This was working on another similar box.
> I gave "MyDatabase" for datasource in connection string and it was
working.
> Any idea what setting should be set on to get this working?
> Gan
> --
> Ganesan Subramanian
> Microsoft Technologies and Solutions
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OF#DNObREHA.4020@.TK2MSFTNGP11.phx.gbl...
> > I wasn't aware that .NET would even look at the client network utility.
> Are
> > you sure that's in its list of things to check (especially considering
> that
> > SQL Server / client network utility is not always going to be installed
> > where .NET is installed)? I thought for most applications it was HOSTS,
> > then WINS, then DNS... and SQL Server uses the client network utility on
> its
> > own?
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >
> >
> >
> >
> > "Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
> > news:eODEacVREHA.4048@.TK2MSFTNGP10.phx.gbl...
> > >I added an alias in Client Network Utility. (cliconfg.exe).
> > > I am in Administrators and hence was able to add the ALias.
> > >
> > > Alias Name : MyDatabase
> > > Protocols Enabled : Named Pipes, TCP/IP.
> > > Protocol for Alias : tried both Tcp/ip and Named Pipes
> > > Server : MyServer
> > >
> > > From query analyser if I try to open "MyDatabase" it opens the server
> > >
> > > From .NET Windows Server, I give it in connection string - it doesnt
> take
> > > it.
> > >
> > > Note : this is not working only on this server. Another similarly
> > > configured
> > > server, takes this.
> > >
> > > Any Help is much appreciated.
> > >
> > > Gan
> > >
> > > --
> > > Ganesan Subramanian
> > > Microsoft Technologies and Solutions
> > >
> > >
> > >
> >
> >
>|||Hi Group
Anyone had this issue before. I am eager to get an answer for this.
--
Ganesan Subramanian
Microsoft Technologies and Solutions
"Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
news:#GnrrNgREHA.2876@.TK2MSFTNGP09.phx.gbl...
> It was .NET SQL Data adapter for SQL Server.
> This was working on another similar box.
> I gave "MyDatabase" for datasource in connection string and it was
working.
> Any idea what setting should be set on to get this working?
> Gan
> --
> Ganesan Subramanian
> Microsoft Technologies and Solutions
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OF#DNObREHA.4020@.TK2MSFTNGP11.phx.gbl...
> > I wasn't aware that .NET would even look at the client network utility.
> Are
> > you sure that's in its list of things to check (especially considering
> that
> > SQL Server / client network utility is not always going to be installed
> > where .NET is installed)? I thought for most applications it was HOSTS,
> > then WINS, then DNS... and SQL Server uses the client network utility on
> its
> > own?
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >
> >
> >
> >
> > "Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
> > news:eODEacVREHA.4048@.TK2MSFTNGP10.phx.gbl...
> > >I added an alias in Client Network Utility. (cliconfg.exe).
> > > I am in Administrators and hence was able to add the ALias.
> > >
> > > Alias Name : MyDatabase
> > > Protocols Enabled : Named Pipes, TCP/IP.
> > > Protocol for Alias : tried both Tcp/ip and Named Pipes
> > > Server : MyServer
> > >
> > > From query analyser if I try to open "MyDatabase" it opens the server
> > >
> > > From .NET Windows Server, I give it in connection string - it doesnt
> take
> > > it.
> > >
> > > Note : this is not working only on this server. Another similarly
> > > configured
> > > server, takes this.
> > >
> > > Any Help is much appreciated.
> > >
> > > Gan
> > >
> > > --
> > > Ganesan Subramanian
> > > Microsoft Technologies and Solutions
> > >
> > >
> > >
> >
> >
>

.NET Data Adapter not taking Alias added in ClientNetwork Utility

I added an alias in Client Network Utility. (cliconfg.exe).
I am in Administrators and hence was able to add the ALias.
Alias Name : MyDatabase
Protocols Enabled : Named Pipes, TCP/IP.
Protocol for Alias : tried both Tcp/ip and Named Pipes
Server : MyServer
From query analyser if I try to open "MyDatabase" it opens the server
From .NET Windows Server, I give it in connection string - it doesnt take
it.
Note : this is not working only on this server. Another similarly configured
server, takes this.
Any Help is much appreciated.
Gan
Ganesan Subramanian
Microsoft Technologies and Solutions
I wasn't aware that .NET would even look at the client network utility. Are
you sure that's in its list of things to check (especially considering that
SQL Server / client network utility is not always going to be installed
where .NET is installed)? I thought for most applications it was HOSTS,
then WINS, then DNS... and SQL Server uses the client network utility on its
own?
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
news:eODEacVREHA.4048@.TK2MSFTNGP10.phx.gbl...
>I added an alias in Client Network Utility. (cliconfg.exe).
> I am in Administrators and hence was able to add the ALias.
> Alias Name : MyDatabase
> Protocols Enabled : Named Pipes, TCP/IP.
> Protocol for Alias : tried both Tcp/ip and Named Pipes
> Server : MyServer
> From query analyser if I try to open "MyDatabase" it opens the server
> From .NET Windows Server, I give it in connection string - it doesnt take
> it.
> Note : this is not working only on this server. Another similarly
> configured
> server, takes this.
> Any Help is much appreciated.
> Gan
> --
> Ganesan Subramanian
> Microsoft Technologies and Solutions
>
>
|||It was .NET SQL Data adapter for SQL Server.
This was working on another similar box.
I gave "MyDatabase" for datasource in connection string and it was working.
Any idea what setting should be set on to get this working?
Gan
Ganesan Subramanian
Microsoft Technologies and Solutions
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OF#DNObREHA.4020@.TK2MSFTNGP11.phx.gbl...
> I wasn't aware that .NET would even look at the client network utility.
Are
> you sure that's in its list of things to check (especially considering
that
> SQL Server / client network utility is not always going to be installed
> where .NET is installed)? I thought for most applications it was HOSTS,
> then WINS, then DNS... and SQL Server uses the client network utility on
its[vbcol=seagreen]
> own?
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
> news:eODEacVREHA.4048@.TK2MSFTNGP10.phx.gbl...
take
>
|||This is nothing more than name resolution issue. When you use cliconfg.exe
and entry is added to:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer \Client\ConnectTo]
which should be enumerated by ADO/.Net. Check to see if the running user has
access to read the registry.
-oj
http://www.rac4sql.net
"Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
news:%23GnrrNgREHA.2876@.TK2MSFTNGP09.phx.gbl...
> It was .NET SQL Data adapter for SQL Server.
> This was working on another similar box.
> I gave "MyDatabase" for datasource in connection string and it was
working.
> Any idea what setting should be set on to get this working?
> Gan
> --
> Ganesan Subramanian
> Microsoft Technologies and Solutions
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OF#DNObREHA.4020@.TK2MSFTNGP11.phx.gbl...
> Are
> that
> its
> take
>
|||Hi Group
Anyone had this issue before. I am eager to get an answer for this.
Ganesan Subramanian
Microsoft Technologies and Solutions
"Ganesan Subramanian" <gansub@.hotmail.com> wrote in message
news:#GnrrNgREHA.2876@.TK2MSFTNGP09.phx.gbl...
> It was .NET SQL Data adapter for SQL Server.
> This was working on another similar box.
> I gave "MyDatabase" for datasource in connection string and it was
working.
> Any idea what setting should be set on to get this working?
> Gan
> --
> Ganesan Subramanian
> Microsoft Technologies and Solutions
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OF#DNObREHA.4020@.TK2MSFTNGP11.phx.gbl...
> Are
> that
> its
> take
>

Friday, February 24, 2012

.exe to insert data in SQLServer database

How can I make an .exe file that can insert data automatically in a
SQLServer database, I can do it in C, but how can I connect to SQLServer
and execute a query.

All data that I have to insert are data that I can have from PC
environment variables.

Thanks

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORGADO or ADO.NET is the API most commonly used to connect to SQLServer from
C++ and other languages. You can use the ADO Command object to execute any
SQL statement, including INSERT statements to insert new data. Lookup ADO in
SQL Server Books Online for some examples.

--
David Portas
SQL Server MVP
--|||Hi

There are various ways to do this if you want to look at a programming
language such as VB then check out the examples that come with the SQL
Server installation. If you want a simple way to do it then you could use
the osql/isql utilities that are shipped with SQL Server. Check out books
online for information on all of these things. An example using osql on the
command line to access environment variables:

C:\>set Name=Fred

C:\>echo %name%
Fred

C:\>osql -E -dTest -S"(local)" -Q"CREATE TABLE Tmp1 ( name varchar (20) )"

C:\>osql -E -dTest -S"(local)" -Q"INSERT INTO Tmp1 ( name ) VALUES (
'%Name%' )
"
(1 row affected)

C:\>osql -E -dTest -S"(local)" -Q"SELECT * FROM Tmp1 "
name
-------
Fred

(1 row affected)

You could also put this into a batch file.

If you are looking to import data in bulk then look at the bcp utitlity or
the BULK INSERT statement.

John

"Santo Santis" <santosanto@.supereva.it> wrote in message
news:94650d3133425f4d14afaeb82a2328e1.114479@.mygat e.mailgate.org...
> How can I make an .exe file that can insert data automatically in a
> SQLServer database, I can do it in C, but how can I connect to SQLServer
> and execute a query.
> All data that I have to insert are data that I can have from PC
> environment variables.
> Thanks
>
> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

.exe from stored procs

Hey guys.

I am wondering if it is possible to execute an .exe from a stored proc. I have an application that calls a stored proc and I am wanting for that stored proc to call up an app to show certain results. I have no way of doing this on the application itself as I dont have the source code. So, since I do have access to the SQL I am wondering if it could be done there.

Thanks
tiboryou can launch an exe from a proc with xp_cmdshell. you can't display any of it's output though, except for whatever it writes to stdout.

if it's a GUI app, there's no point to it. Also, remember that this app would have to be located on the server.

Be very careful with this. If you enable xp_cmdshell, it opens up a fairly large security hole on your db server. Make sure only appropriate logins have perms to execute it. don't give any clients permissions to execute it directly or you may find that a criminal has stolen all your data.|||It's not advisable

You could bring down the server from what I understand

But if you want to try you need to use master..xp_cmdshell

But if you don't know about the sproc, then I'd really advise against it|||Thanks guys

Turns out, I may be able to avoid the project in its entirety but this is good info to know for the future.

Again, very much appreciated :)|||just be careful if you ever decide to use it. xp_cmdshell is a cross between a loaded gun and a vial of nitroglycerin.|||just be careful if you ever decide to use it. xp_cmdshell is a cross between a loaded gun and a vial of nitroglycerin.

pffffftttttt

The real danger is trying to launch an application with it

Hey DROP Database is kinda dangerous as well|||the real danger is that you can use xp_cmdshell to do anything you could do from a command prompt, which is pretty much anything.

if the wrong people have rights to execute xp_cmdshell, you are in trouble. so best left disabled.|||if the wrong people have rights to execute xp_cmdshell, you are in trouble.

Of course, would you give a gun to a toddler?

so best left disabled.

Couldn't disagree more|||Tibor, don't listen to Brett.

he's a wild vocalist (http://www.rockdetector.com/artist,5489.sm) for an all-girl 80's hair-metal band. everyone knows such types can't be trusted.

:)|||belly aching laughter. on the floor. verge of tears.

but really if your shop is not locked down with regards to db server security, shame on you. Although I have been somewhere that refused to be locked down. So I left.

I find xp_cmdshell extremely useful especially combined with osql. I do my database builds that way by doing a fresh dump from source control and letting those rip with a little cursor and some logging. A little Redgate afterwards to be sure and everything is right as rain.|||Hi,

I've quite the same Problem as Tibor.
I also try to call a .exe from a trigger.
The .exe is a VB.Net command line application, that shall invoke a ETL script on a third party BI Application. The VB application first calls the getObject Function and then calls the Reload Function of the BI application.
This application works fine, when I start it in the command line.
But when I try to call it with the xp_cmdshell proc the execution stucks and after a while an exception is thrown ("ActiveX component couldn't be started" or so on)
Until now, I haven't found any way to fix this problem.
Now I'm searching for another way of calling an .exe from a trigger. I don't know, if this helps. Maybe you have any suggestions to deal with this problem
Thanks in advance

Gojo|||you want to call an exe from a trigger? pardon me, but that's a less than good idea. It's quite bad actually.

triggers need to have a very constrained scope - they shouldn't be launching other processes, sending emails, writing data to remote servers, calculating your horoscope, or anything like that.

if you do somehow figure out how to launch an exe from a trigger, the perf or your application will suffer big time.

what are you trying to achieve with this? why do you think launching an exe is the way to do it?|||triggers need to have a very constrained scope - they shouldn't be launching other processes, sending emails, writing data to remote servers, calculating your horoscope, or anything like that.

If you're using SQL Server 2005, you can use the Service Broker to do such "crazy" stuff without ending up with long running transactions.|||Thanks for the fast replies

@. jezemine
I know, the idea sonds weird. My problem is, that I want to keep my data in the dashboard event triggered.
In this case a new DB entry is a event. But when I'm constantly polling the table (as I do now) the solution isn't event triggered. The only way to achieve this, is to call the .exe (which calls the load script), when there is a new entry in the table (therefore the trigger).
Do you have another idea how to accomplish that (I mean how to tell my .exe that there's a new entry, so that the .exe can call the load script)?

@.kaffenils
Unfortunately I have to use the 2000 version

thanks
gojo|||you could write an app that polls the table every so often, and when there's a new row then it executes your load script.

I don't understand what you mean by "the solution isn't even triggered" btw.|||Currently I poll the table every 5 secs. If there's a new row, I execute my script. This works fine, but as I wrote before, this solution is not what I actually want.
I don't want a permanent polling. I want the new Table entry to be the "initiator" of the script execution. When I poll the table, the poll query is the "initiator".
I hope I could make clear, what I want.

thanks
gojo|||Maybe my Problem could be solved another way.
Is there a possibility in SQL Server 2000 to access a class which is written in .NET and which is "stored" in the Global Assembly Cache (GAC)?
Then I could access the reload command.

Thanks gojo|||I'd probably create a SQL Agent job that did whatever "heavy lifting" was required (running the ETL process, etc), then use either sp_start_job (http://msdn2.microsoft.com/En-US/library/aa260289(SQL.80).aspx) or some closely related form of trickery to actually start the job itself.

-PatP|||note that would fail if the job is already running. you can't have two instances of the same job running at once.|||Thanks for the replies.
I've found an interesting site.
http://sqljunkies.com/Article/C5A500EB-B8BE-42C0-B23B-258A342CAAAB.scuk
I think that's exactly what I want.
I hope it works.

thanks gojo|||invoking that kind of thing from a trigger still counts as a no-no in my book.|||I agree, that this shouldn't be implemented in practice.
In my case this solution is more a feasibility study, if that kind of idea (new entry as trigger of a new Data Load) can be implemented in a technical way.|||note that would fail if the job is already running. you can't have two instances of the same job running at once.Failure to start the second instance would be a bad thing? I can't imagine a case where you'd want two separate ETL loads running at once. I suppose that you could queue the subsequent jobs somehow if there was any chance that you really wanted that to happen.

-PatP|||I have no idea if that would be a bad thing or not - depends on OP's requirements. I just stated is as a fyi for the OP.|||Ok so I have been playing around some with xp_cmdshell(yes, I know...not good, lol) but when I run the .exe, my query analyzer hangs up for about 10 minutes.

exec master..xp_cmdshell 'C:\test.exe'

It is just a little vb app i created to test with but it hangs up and does not execute.

I know that I have permissions and such as i can do a simple dos directory seach with it.

Any ideas as to why it hangs up?

Thanks|||It seems to be running it in the processes list of task manager but not actually running the application. Is it possible to actually run the app?|||If your application is expecting someone to click an OK button, you will be waiting a long time.|||Yeah, I just found out that it wont allow it...so i withdraw my question. heh|||If your application is expecting someone to click an OK button, you will be waiting a long time.. ;)|||If your application is expecting someone to click an OK button, you will be waiting a long time.

really? whenever I write a trigger, i have it pop a message box to ask the user if they really want to commit the data. it works great!

:)|||In order to pass a moderate SOX audit, you would have to ask that question twice. "Are you sure you want to commit that data?" "Really sure?"