Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Thursday, March 29, 2012

Can I Import/Export Database Designs between Visual Studio 2003 and SQL Server 2005 Tools?

Title says it all, really.

Visual Studio has a "Reverse Engineer" option but the only export option appears to be to a graphics-definition database.

Regards,

Nick Samuel

These designs are just graphical representations of the physical structures, they are stored in a series of tables whose names start with dt. If you then copy that database to SQL 2005 and set the compat level to 90 then the 2005 diagram tool should be able to read it.|||

Hi Euan,

Thank you for your response.

I cannot find an option to set a compat level.

Regards,

Nick Samuel

Can I import a deployed report back into Visual Studio?

I created and deployed a report to my Report Server and everything is functioning fine. However, my laptop was inadvertantly wiped when I was having it serviced and I had not backed up this report to VSS. Is there a way to import that deployed report back in to Visual Studio or do I have to basically rebuild my report from scratch?

Hello,

If you go to the Properties tab for your report in Report Manager, there should be a link called 'Edit' in the Report Definition section. If you click this, you can save the RDL file as it is on the server. Then, just import that report back into Visual Studio.

Hope this helps.

Jarret

|||

No, fortunately you don′t need to :-)

You can either download the RDL using the webinterface ("Edit item") or write an pplication which pulls the information from the report server. There are some samples in the samples directory which show how to do this.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Yes, thank you very much. That did the trick!|||I will take a look at the samples and learn how to do it programmatically. In the meantime, my butt is out of the proverbial sling. Many thanks!

Sunday, March 25, 2012

Can I distribute MSDE 2000 with visual Studio 6.0 Enterprise Editi

Hello,
I have purchased Visual Studio 6.0 Enterprise Edition which has SQL 6.5
Server Developer Edition bundeled with it:
- Do I have the right to use and distribute MSDE 2000?
- Do I have the right to upgrade to SQL 2000 server? If so, which version
of SQL 2000 Server I can upgrade to and how can I get it?
- Do I have the right to upgrade to Visual Studio.NET. If so, which version
of visual studio.Net I can upgrade to and how can I get it?
--
SalahAnytime you area dealing with licensing issues, you should always consult
your local Microsoft representation for an official answer. With that
disclaimer in mind, here's how I might answer you questions:

Yes...MSDE is the free, redistributable version of SQL Server. See the
following for more information
http://www.microsoft.com/sql/msde/default.mspx
[vbcol=seagreen]
Assuming that you've purchased a licensed version of one of the SQL Server
2000 Server editions, then yes, you may freely upgrade you databases to this
version. As to which version is right for you, that depends on what features
you need. Here's a matrix that may help you decide
http://www.microsoft.com/sql/evalua.../choosing.mspx.
[vbcol=seagreen]
Like SQL Server, assuming that you've purchased a licensed version of Visual
Studio.NET, then yes, you are free to upgrade you application. Also like my
answer for choosing a SQL Server version, choosing a version of Visual
Studio.NET depends on what features you need. The following URL may help
you decide
http://msdn.microsoft.com/vstudio/p...s/default.aspx.
--Brian
(Please reply to the newsgroups only.)
"Salah" <Salah@.discussions.microsoft.com> wrote in message
news:625F0DAD-EB9D-4831-9A66-A6366815AB86@.microsoft.com...[vbcol=seagreen]
> Hello,
> I have purchased Visual Studio 6.0 Enterprise Edition which has SQL 6.5
> Server Developer Edition bundeled with it:
> - Do I have the right to use and distribute MSDE 2000?
> - Do I have the right to upgrade to SQL 2000 server? If so, which version
> of SQL 2000 Server I can upgrade to and how can I get it?
> - Do I have the right to upgrade to Visual Studio.NET. If so, which
> version
> of visual studio.Net I can upgrade to and how can I get it?
> --
> Salah

Can I distribute MSDE 2000 with visual Studio 6.0 Enterprise Editi

Hello,
I have purchased Visual Studio 6.0 Enterprise Edition which has SQL 6.5
Server Developer Edition bundeled with it:
- Do I have the right to use and distribute MSDE 2000?
- Do I have the right to upgrade to SQL 2000 server? If so, which version
of SQL 2000 Server I can upgrade to and how can I get it?
- Do I have the right to upgrade to Visual Studio.NET. If so, which version
of visual studio.Net I can upgrade to and how can I get it?
Salah
Anytime you area dealing with licensing issues, you should always consult
your local Microsoft representation for an official answer. With that
disclaimer in mind, here's how I might answer you questions:
[vbcol=seagreen]
Yes...MSDE is the free, redistributable version of SQL Server. See the
following for more information
http://www.microsoft.com/sql/msde/default.mspx
[vbcol=seagreen]
Assuming that you've purchased a licensed version of one of the SQL Server
2000 Server editions, then yes, you may freely upgrade you databases to this
version. As to which version is right for you, that depends on what features
you need. Here's a matrix that may help you decide
http://www.microsoft.com/sql/evaluat...choosing.mspx.
[vbcol=seagreen]
Like SQL Server, assuming that you've purchased a licensed version of Visual
Studio.NET, then yes, you are free to upgrade you application. Also like my
answer for choosing a SQL Server version, choosing a version of Visual
Studio.NET depends on what features you need. The following URL may help
you decide
http://msdn.microsoft.com/vstudio/pr.../default.aspx.
--Brian
(Please reply to the newsgroups only.)
"Salah" <Salah@.discussions.microsoft.com> wrote in message
news:625F0DAD-EB9D-4831-9A66-A6366815AB86@.microsoft.com...
> Hello,
> I have purchased Visual Studio 6.0 Enterprise Edition which has SQL 6.5
> Server Developer Edition bundeled with it:
> - Do I have the right to use and distribute MSDE 2000?
> - Do I have the right to upgrade to SQL 2000 server? If so, which version
> of SQL 2000 Server I can upgrade to and how can I get it?
> - Do I have the right to upgrade to Visual Studio.NET. If so, which
> version
> of visual studio.Net I can upgrade to and how can I get it?
> --
> Salah

Can I distribute MSDE 2000 with visual Studio 6.0 Enterprise Editi

Hello,
I have purchased Visual Studio 6.0 Enterprise Edition which has SQL 6.5
Server Developer Edition bundeled with it:
- Do I have the right to use and distribute MSDE 2000?
- Do I have the right to upgrade to SQL 2000 server? If so, which version
of SQL 2000 Server I can upgrade to and how can I get it?
- Do I have the right to upgrade to Visual Studio.NET. If so, which version
of visual studio.Net I can upgrade to and how can I get it?
--
SalahAnytime you area dealing with licensing issues, you should always consult
your local Microsoft representation for an official answer. With that
disclaimer in mind, here's how I might answer you questions:
>>Do I have the right to use and distribute MSDE 2000?
Yes...MSDE is the free, redistributable version of SQL Server. See the
following for more information
http://www.microsoft.com/sql/msde/default.mspx
>>Do I have the right to upgrade to SQL 2000 server? If so, which version
>>of SQL 2000 Server I can upgrade to and how can I get it?
Assuming that you've purchased a licensed version of one of the SQL Server
2000 Server editions, then yes, you may freely upgrade you databases to this
version. As to which version is right for you, that depends on what features
you need. Here's a matrix that may help you decide
http://www.microsoft.com/sql/evaluation/features/choosing.mspx.
>>Do I have the right to upgrade to Visual Studio.NET. If so, which version
>>of visual studio.Net I can upgrade to and how can I get it?
Like SQL Server, assuming that you've purchased a licensed version of Visual
Studio.NET, then yes, you are free to upgrade you application. Also like my
answer for choosing a SQL Server version, choosing a version of Visual
Studio.NET depends on what features you need. The following URL may help
you decide
http://msdn.microsoft.com/vstudio/productinfo/features/default.aspx.
--
--Brian
(Please reply to the newsgroups only.)
"Salah" <Salah@.discussions.microsoft.com> wrote in message
news:625F0DAD-EB9D-4831-9A66-A6366815AB86@.microsoft.com...
> Hello,
> I have purchased Visual Studio 6.0 Enterprise Edition which has SQL 6.5
> Server Developer Edition bundeled with it:
> - Do I have the right to use and distribute MSDE 2000?
> - Do I have the right to upgrade to SQL 2000 server? If so, which version
> of SQL 2000 Server I can upgrade to and how can I get it?
> - Do I have the right to upgrade to Visual Studio.NET. If so, which
> version
> of visual studio.Net I can upgrade to and how can I get it?
> --
> Salahsql

Thursday, March 22, 2012

can i develop on a different machine?

I have just installed reporting services on our web server and am able
to create report projects from there, but I don't generally create
visual studio projects on the web server. I use a development machine
that does not have IIS installed. Is there any way to create report
projects on my development machine and point it to the report server?
I can't find any information on this, all of the examples I find tell
me to open a new report project, but the template only exists on the
report server. Is there some client tool I need to install?When you installed on the web server you installed both server and client
tools. Normally you would not have VS installed on the production machine
and only install the server part. Although it can be handy to be developing
on a machine that has both installed it is not necessary. When you preview a
report in VS it is not using IIS. Just install the client tools from the RS
installation on a machine that has Visual Studio on it.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"malpous" <porterdn@.email.uc.edu> wrote in message
news:97b85c30.0411221031.6907a8e2@.posting.google.com...
> I have just installed reporting services on our web server and am able
> to create report projects from there, but I don't generally create
> visual studio projects on the web server. I use a development machine
> that does not have IIS installed. Is there any way to create report
> projects on my development machine and point it to the report server?
> I can't find any information on this, all of the examples I find tell
> me to open a new report project, but the template only exists on the
> report server. Is there some client tool I need to install?

Can I Deploy a report to a client who doesn't have SQL server license.

How can I Deploy a report with my visual Studio.Net application to a company
who doesn't have SQL server license?
I plan to use SQL Server 2005 Express.SQL Server Express does not yet have support for this. Supposedly Q1. Then
the data needs to reside locally as well.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Roberto Hernández" <robertohh@.newsgroups.nospam> wrote in message
news:%23uQARosIGHA.1760@.TK2MSFTNGP10.phx.gbl...
> How can I Deploy a report with my visual Studio.Net application to a
> company who doesn't have SQL server license?
> I plan to use SQL Server 2005 Express.
>|||VS2005 provide a report viewer control which allow you to render reports.
does your application is web or windows based?
"Roberto Hernández" <robertohh@.newsgroups.nospam> wrote in message
news:%23uQARosIGHA.1760@.TK2MSFTNGP10.phx.gbl...
> How can I Deploy a report with my visual Studio.Net application to a
> company who doesn't have SQL server license?
> I plan to use SQL Server 2005 Express.
>|||Hi Roberto,
As Bruce mentioned, the SQL Server reporting service is not available for
EXPRESS edition so far. Also, what's your application's detailed structure,
does it require a local SQL Server instance? If it is just a client
application which can consume reporting service reports through those
remote accessible programming interfaces, we can consider separate the
application from the backend SQL Server database... Thus, there need a
certain DataBase server which have SQL Server 2005 instance installed
already...
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| From: "Jéj? <willgart@.BBBhotmailAAA.com>
| References: <#uQARosIGHA.1760@.TK2MSFTNGP10.phx.gbl>
| Subject: Re: Can I Deploy a report to a client who doesn't have SQL
server license.
| Date: Thu, 26 Jan 2006 21:35:45 -0500
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| Message-ID: <emzDhpuIGHA.424@.TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: modemcable008.41-80-70.mc.videotron.ca 70.80.41.8
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67651
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| VS2005 provide a report viewer control which allow you to render reports.
| does your application is web or windows based?
|
| "Roberto Hernández" <robertohh@.newsgroups.nospam> wrote in message
| news:%23uQARosIGHA.1760@.TK2MSFTNGP10.phx.gbl...
| > How can I Deploy a report with my visual Studio.Net application to a
| > company who doesn't have SQL server license?
| >
| > I plan to use SQL Server 2005 Express.
| >
|
|
||||RDLC reports doesn't required any server.
its standalone reports generated on the client side, not the server side.
Also, I think that the report control can render RDL reports without using a
reportserver.
"Steven Cheng[MSFT]" <stcheng@.online.microsoft.com> wrote in message
news:TUqDfawIGHA.1236@.TK2MSFTNGXA02.phx.gbl...
> Hi Roberto,
> As Bruce mentioned, the SQL Server reporting service is not available for
> EXPRESS edition so far. Also, what's your application's detailed
> structure,
> does it require a local SQL Server instance? If it is just a client
> application which can consume reporting service reports through those
> remote accessible programming interfaces, we can consider separate the
> application from the backend SQL Server database... Thus, there need a
> certain DataBase server which have SQL Server 2005 instance installed
> already...
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
> --
> | From: "Jéj? <willgart@.BBBhotmailAAA.com>
> | References: <#uQARosIGHA.1760@.TK2MSFTNGP10.phx.gbl>
> | Subject: Re: Can I Deploy a report to a client who doesn't have SQL
> server license.
> | Date: Thu, 26 Jan 2006 21:35:45 -0500
> | Lines: 12
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
> | X-RFC2646: Format=Flowed; Response
> | Message-ID: <emzDhpuIGHA.424@.TK2MSFTNGP12.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: modemcable008.41-80-70.mc.videotron.ca 70.80.41.8
> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl
> microsoft.public.sqlserver.reportingsvcs:67651
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | VS2005 provide a report viewer control which allow you to render
> reports.
> | does your application is web or windows based?
> |
> | "Roberto Hernández" <robertohh@.newsgroups.nospam> wrote in message
> | news:%23uQARosIGHA.1760@.TK2MSFTNGP10.phx.gbl...
> | > How can I Deploy a report with my visual Studio.Net application to a
> | > company who doesn't have SQL server license?
> | >
> | > I plan to use SQL Server 2005 Express.
> | >
> |
> |
> |
>

Can I Debug Remote SQL Server 2000 Stored Procedure in Visual Studio 2005

I can debug an SQL Server 2005 stored procedure in Visual Studio 2005 from a local database (e.g. AdventureWorks).

However, when I try to debug a stored procedure on a remote server running SQL Server 2000 the debug process is not accessible (i.e. I can choose 'Step Into Stored Procedure' and it seems to run but I cannot debug it).

Am I trying to do something that just can't be done? Is this a compatibility issue between Visual Studio 2005 and SQL Server 2000? Or am I missing something?

Thanks for any advice on this.

Richard

you can do this by using the server explorer (ctrl+alt+s)

in the server explorer right clcik the object in the server explorer

then click modify

|||

As far as I can see, Server Explorer in Visual Studio does not give me a 'Modify' option. It gives me a 'Step into Stored Procedure' option that does not seem work for remote SQL Server 2000 stored procedures.

The 'Modify' option is available in SQL Server Management Studio Object Explorer but provides no debugging.

Maybe I have something set up wrong?

|||

As far as I can see, Server Explorer in Visual Studio does not give me a 'Modify' option. It gives me a 'Step into Stored Procedure' option that does not seem work for remote SQL Server 2000 stored procedures.

The 'Modify' option is available in SQL Server Management Studio Object Explorer but provides no debugging.

Maybe I have something set up wrong?

|||

the modify option is available on the server explorer if you are

creating an ASP.net/web project.

if you are developing windows application project

use the open option instead for tables its

open table definition

|||

As far as I can see, Server Explorer in Visual Studio does not give me a 'Modify' option. It gives me a 'Step into Stored Procedure' option that does not seem work for remote SQL Server 2000 stored procedures.

The 'Modify' option is available in SQL Server Management Studio Object Explorer but provides no debugging.

Maybe I have something set up wrong?

|||

right click the SP. then click on OPEN on vs2005 server explorer.

Can i create reports using VB Express and SQL Server Express?

Hi,

i ve installed visual basic express and sql server express. my question is can i create reports in my database application?

An update for SQL Server Express that includes a limited edition of Report Server is expected to become available in 2006. Its features are described here: http://www.microsoft.com/sql/technologies/reporting/rsfeatures.mspx

-- Robert

Monday, March 19, 2012

Can I add parameters to a report in the Microsoft Report Builder.

Hi,
I'm using SQL Server 2005 Reporting Services and Visual Studio 2005.
I'm just wondering if I can add parameters to a report with the Report
Builder or is this facility only available in the VS2005 report editor? If
it's possible what are the steps I need to follow?
Alternatively, assuming that I can't add parameters in the report
builder directly, I was wondering if parameters could be defined in a report
model and then after it's published the parameters could be included in the
Report Builder report using the model?
Thanks in advance,
Mark.Hi Mark
You can add parameters by adding a Filter.
When building the filter expression click on the operator in the expression
and choose "Prompt" this will generate a parameter. I guess this operator is
not available for all filtering expressions and depends on attribute
ValueSelection property.
Hope this helps,
Jordi Rambla
SQL Server MVP (Reporting Services)
SolidQualityLearning Iberoamericana
"Mark Hayes" <MarkHayes@.discussions.microsoft.com> escribió en el mensaje
news:75FEDA12-7594-4EB4-A035-F93C9A3E6979@.microsoft.com...
> Hi,
> I'm using SQL Server 2005 Reporting Services and Visual Studio 2005.
> I'm just wondering if I can add parameters to a report with the Report
> Builder or is this facility only available in the VS2005 report editor? If
> it's possible what are the steps I need to follow?
> Alternatively, assuming that I can't add parameters in the report
> builder directly, I was wondering if parameters could be defined in a
> report
> model and then after it's published the parameters could be included in
> the
> Report Builder report using the model?
> Thanks in advance,
> Mark.|||I read your response, I am trying to Add a filter or Parameter to a report. I
don't see any expression Builder, just a list of values? Which in my case has
18,000 rows. Where does one build an expression for a filter?
"Jordi Rambla" wrote:
> Hi Mark
> You can add parameters by adding a Filter.
> When building the filter expression click on the operator in the expression
> and choose "Prompt" this will generate a parameter. I guess this operator is
> not available for all filtering expressions and depends on attribute
> ValueSelection property.
> Hope this helps,
> Jordi Rambla
> SQL Server MVP (Reporting Services)
> SolidQualityLearning Iberoamericana
> "Mark Hayes" <MarkHayes@.discussions.microsoft.com> escribió en el mensaje
> news:75FEDA12-7594-4EB4-A035-F93C9A3E6979@.microsoft.com...
> > Hi,
> > I'm using SQL Server 2005 Reporting Services and Visual Studio 2005.
> > I'm just wondering if I can add parameters to a report with the Report
> > Builder or is this facility only available in the VS2005 report editor? If
> > it's possible what are the steps I need to follow?
> > Alternatively, assuming that I can't add parameters in the report
> > builder directly, I was wondering if parameters could be defined in a
> > report
> > model and then after it's published the parameters could be included in
> > the
> > Report Builder report using the model?
> >
> > Thanks in advance,
> > Mark.
>
>

can I add a row to a data base table with VWD Express

I have a data table I have adabted for my own use and want to add a row to the table. Can I do that with Visual Web developer Express?

I can add update modify the colums and data in the exciting table but I cannot figure out how to add a row.

This is just a simple datalist of names. firstname lastname. there are 18 of them and i want to add more names

jayirvin wrote:

I have a data table I have adabted for my own use and want to add a row to the table. Can I do that with Visual Web developer Express?

I can add update modify the colums and data in the exciting table but I cannot figure out how to add a row.

This is just a simple datalist of names. firstname lastname. there are 18 of them and i want to add more names

I am using ASP.NET 2.0 GridView to show the data. I have found some code to incert a row into an ASP DetailsView that even has an auto generate incert button. the code below may work for my gridview if I can create my own incert button: Can anyone help me add a relative to my list of relatives?

Can anyone help me adapt this code

'

<asp:SqlDataSourceID="SqlDataSource"runat="server"ConnectionString="<%$ ConnectionStrings:MyConnectionString1 %>"

DeleteCommand="DELETE FROM [relatives] WHERE

[RelativesID] = @.original_RelativesID"FilterExpression="RelativesID='{0}'"

InsertCommand="INSERT INTO [Relatives] ([RelativesID], [FirstName],

[LastName]) VALUES (@.RelativesID, @.FirstName,

@.LastName)"SelectCommand="SELECT * FROM [Relatives]">

<FilterParameters>

<asp:ControlParameterControlID="GridView1"Name="RelativesID"PropertyName="SelectedValue"/>

</FilterParameters>

<InsertParameters>

<asp:ParameterName="RelativesID"Type="String"/>

<asp:ParameterName="FirstName"Type="String"/>

<asp:ParameterName="LastName"Type="String"/>

</InsertParameters>

</asp:SqlDataSource>

|||

I have solved my own probelm I can incert a row with ASP:FormView

ASP:GridView does not support incert

|||

jayirvin wrote:

ASP:GridView does not support incert

Hi Jay,

The GridView does support database inserts. Did you have an InsertItemTemplate setup?

Marcie

|||

datagridgirl wrote:

jayirvin wrote:

ASP:GridView does not support incert

Hi Jay,

The GridView does support database inserts. Did you have an InsertItemTemplate setup?

Marcie

I was working with edit delete update and select template. WVD only wrote the SQL statements for the select. No incert new

|||

Hi Marcie,

Can you please tell me where I can find more information on inserting a record using GridView?

I have edit and delete functioning fine.

Thanks,

Doug

|||

Hi Doug,

This article has some good info on inserting with a GridView: http://fredrik.nsquared2.com/viewpost.aspx?PostID=155

Also visit the GridView articles section of my site: http://www.gridviewgirl.com/GridViewGirl/articles.aspx

Marcie

|||I had to use and ASP Details view component and add insert delete and new while configuring its data scorce go to advanced

Sunday, February 12, 2012

Can .NET Application access SQL 2005 Express remotely?

I am tring to access the SQL 2005 Express which installed in remote machine. Front end app is on Visual Studio 2005. Try to connect SQL Express using the application Layer which is installed on the computer where SQL Express is installed. Could not fetch data from the SQL Express. What could be the problem?

With Regards,

ADK

hi,

SQLExpress installs by default disabling remote connections..

have a look at the resources listed by Arnie,

Configuration -Configure SQL Server 2005 to allow remote connections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Configuration -Connect to SQL Express from "downlevel clients"
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx

Configuration -Connect to SQL Express and ‘Stay Connected’
http://betav.com/blog/billva/2006/06/getting_and_staying_connected.html

Configuration - Guideline for Connectivity Question Posting
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1

regards

calling web service in stored procedure (SQL 2005)

I need to create a stored procedure (SQL 2005). I did it in C# (Visual Studio). The .dll file (inside) uses web services of Project Server 2007 (I just need to log on, create a project and log out). I prepared 2 files (exactly the same code): dll an exe. the .exe works fine. the problem is with .dll file (stored procedure in SQL)...

by the way: I created serialization file with sgen tool.

the problems start when I am trying to register these 2 .dlls in SQL server. I can do that in unsafe mode only. when I am trying to register them in externall access (normal dll) and safe mode (serialization .dll) I am getting errors:

CREATE ASSEMBLY failed because method "add_QueueCheckInProjectCompleted" on type "ConsoleApplication11.ProjectWebSvc.Project" in external_access assembly "ConsoleApplication11" has a synchronized attribute. Explicit synchronization is not allowed in external_access assemblies

thus I did it in unsafe mode (both of them). than I created the procedure.

Now, I tried to call that procedure. I am getting error:

A .NET Framework error occurred during execution of user defined routine or aggregate 'Main':

System.Net.WebException: The request failed with the error message:

--

<html><head><title>Object moved</title></head><body>

<h2>Object moved to <a href="http://my_comp:22278/projectserver/_layouts/1033/error.aspx?ErrorText=Object%20reference%20not%20set%20to%20an%20instance%20of%20an%20object%2E">here</a>.</h2>

</body></html>

--.

System.Net.WebException:

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

at ConsoleApplication11.ProjectWebSvc.Project.QueueCreateProject(Guid jobUid, ProjectDataSet dataset, Boolean validateOnly)

at ConsoleApplication11.Program.Main()

That means "Object reference not set to an instance of an object". the problem occurs when calling QueueCreateProject method

I dont understand that error. I wrote the same code for .dll and .exe. the .exe file is working ok (no errors) but .dll (as a stored procedure) shows this error

my code in C#:

using System;

using System.Collections.Generic;

using System.Text;

using System.Data.SqlClient;

using System.Net;

using PSLibrary = Microsoft.Office.Project.Server.Library;

namespace ConsoleApplication11

{

public class Program

{

public static void Main()

{

const string LOGINWINDOWS = "_vti_bin/PSI/LoginWindows.asmx";

string baseUrl = "http://localhost:22278/projectserver/";

CookieContainer cookies = new CookieContainer();

LoginWindowsWebSvc.LoginWindows loginWindows = new LoginWindowsWebSvc.LoginWindows();

loginWindows.Url = baseUrl + LOGINWINDOWS;

loginWindows.Credentials = CredentialCache.DefaultCredentials;

loginWindows.Login();

ProjectWebSvc.Project project = new ProjectWebSvc.Project();

project.Credentials = loginWindows.Credentials;

project.Url = baseUrl + "_vti_bin/psi/project.asmx";

ProjectWebSvc.ProjectDataSet dsProject = new ProjectWebSvc.ProjectDataSet();

ProjectWebSvc.ProjectDataSet.ProjectRow projectRow = dsProject.Project.NewProjectRow();

Guid projectGuid = Guid.NewGuid();

projectRow.PROJ_UID = projectGuid;

projectRow.PROJ_TYPE = 0;

projectRow.PROJ_NAME = "Jakis";

projectRow.PROJ_SESSION_UID = Guid.NewGuid();

dsProject.Project.AddProjectRow(projectRow);

Guid jobGuid = Guid.NewGuid();

project.QueueCreateProject(jobGuid, dsProject, false);

System.Threading.Thread.Sleep(5000);

loginWindows.Logoff();

project.Credentials = null;

}

}

}

any help will be appreciated. my email is: stro.na@.interia.pl

Dear fcjh,

I too am trying to call a web service from a stored procedure in SQL Server 2005. I have followed the advice in the following very useful article:

http://www.awprofessional.com/articles/article.asp?p=473457&seqNum=10&rl=1

I have built a solution in Visual Studio 2005 to do this. In order to follow the article as closely as possible, I have three projects in the solution:

1) The web site including the web service.

2) A SQL Server Project for the Stored Procedure, which calls a User Defined Function, defined in the same project. This successfully deploys both to SQL Server 2005 and allows me to step into them to debug. The code of the User Defined Function (from the above article) is:

[Microsoft.SqlServer.Server.SqlFunction]
[return: SqlFacet(Precision = 9, Scale = 2)]
public static decimal GetStockWS(string symbol)
{
Decimal price;
using (WindowsIdentity id = SqlContext.WindowsIdentity)
{
WindowsImpersonationContext c = id.Impersonate();
StockService s = new StockService();
// use the current credentials
s.Credentials =
System.Net.CredentialCache.DefaultNetworkCredentials;
price = s.GetStockPrice(symbol);
c.Undo();
}
return price;
}

3) A SQL Server Project for the Web Service Proxy. This also appears to deploy to SQL Server successfully.

However, at the point where the User Defined Function invokes the constructor of the Web Service Proxy (statement StockService s = new StockService(); above), I get an exception as follows:

.NET Framework execution was aborted. The UDP/UDF/UDT did not revert thread token.

I can't find anything useful about the cause of this. Has anyone else succeeded in calling a web service from SQL Server 2005?

Any help would be much appreciated.

|||Hi there,

You might find Vineet's post here useful.

Cheers,|||

Dear Isaac,

Vineet's post is excellent. Everything now works perfectly and turns out to be very simple, thanks to the power of the Visual Studio 2005 SQL Server Project type and the use of a Web Reference.

Thanks very much for pointing me to that article.

Calling Visual Foxpro 7 COM

Dear Experts,

We are creating instances of COM Objects written in Visual FoxPro 7 in our SQL Server 2005 stored procedures.
The problem is that VFP Automation Manager which shows number of connections to number of objects is showing 3 connections to 3 objects(instead 1 to 1).

We are releasing the object in SQL Server 2005 using the sp_OADestroy @.Object but the Automation Manager leaves 1 connection to 1 object.

The Automation manager connection doesn't release all the connections.

What effects is this having to our SQL Server 2005 installation and how can we avoid it?

We noticed that when we stop the SQL Service, connections to the Automation Manager are also released.

Thank you for your time.

Regards,

Spyros Christodoulou

You could stop the OLE Automation execution environment itself by calling sp_OAStop. Note that this affects the execution environment at the server-level. Generally, you should avoid using OLE automation extensively since it is resource intensive and running these in-proc can destabilize the server. Try creating the ole server out-of-proc for better reliability with some performance penalty. What is the reason for calling the VFP object from TSQL? Is this absoultely necessary? Note that you can perform queries against VFP databases/tables using linked servers. This is something you should look at also.|||Dear Umachandar,

Thanks for your reply.

Unfortunately we cannot stop OLE Automation execution environment because other users may executing OLE Methods as well.

The reason we are calling VFP from TSQL is that we need VFP to export some files.
I know that we could use a linked server, but in our case it doesn't apply because of the following:
1) VFP database and tables are changing a lot and we don't want the SQL team to be involved every time the VFP team changes tables required for the Import in SQL.
2) The export process is very complicated and it may need to call 2 or 3 VFP methods which means on a change we need to look into these methods as well. (Both VFP and SQL Teams)

For these reasons and the fact that it is much faster to develop the export method in VFP it is better to call VFP method to export data for SQL server.

Have you tried calling VFP out-of-proc COM objects? Does it properly release memory when you call sp_OADestroy @.Object ?

Regards,

Spyros Christodoulou
|||I was suggesting out-of-proc instantiation for better reliability/isolation on the server-side. Some of this might be just behavior of OLE automation. Can you try similar test from say VB and see if the connections are released properly after the OLE object is destroyed?|||Hi Umachandar,

Thanks for your reply,

I found a post you made at microsoft.public.sqlserver.programming on august of 2001.

"I have used this. It works perfectly fine. Are you making a EXE? Does it

have UI? Make sure it doesn't have any of those. Here is one sample:

NOTE -- Save this to a file called "VFPOLE.PRG" in "C:\TEMP"
DEFINE CLASS vfpole AS Custom OLEPUBLIC
prop1 = 'VFPOLE'
ENDDEFINE

NOTE Run these in the VFP command window
CD C:\Temp
BUILD PROJECT VFPOLE FROM VFPOLE.PRG
BUILD DLL VFPOLE FROM VFPOLE

-- Now run this on the SQL Server

declare @.o int, @.h int, @.p varchar( 255 )

exec @.h = sp_OACreate 'VFPOLE.VFPOLE', @.o out

if @.@.error|@.h <> 0 exec sp_displayoaerrorinfo @.o, @.h

print @.o

exec @.h = sp_OAGetProperty @.o, 'Prop1', @.p OUT

if @.@.error|@.h <> 0 exec sp_displayoaerrorinfo @.o, @.h

print @.p

exec sp_oadestroy @.o"

I tried it and it works as an in-process OLE server. It seems that it concumes some SQL Server memory every time I run it. How to register and call the dll if it resides on a different server. (like when you register the VFP .vbr file using clireg32.exe)

Do you know how to make it an out of process and called it based on the following scenario:

Server 1: VFP Database
Server 2: SQL Server

I need to run (SP on Server 2) the dll or exe using Ole Automation on Server 1. (Server 2 will have share access on Server 1)

Any help will be greatly appreciated.

Thanks again,

Spyros Christodoulou

|||The third parameter to sp_OACreate specifies the context for the OLE server. If you specify it as 4 then out-of-proc activation will take place. See Books Online for more details on the parameter.|||

Hi Umachandar and Spyros:

I am trying to do something very similar in SQL Server 2000 with VFP 8 objects.

The remaining problem is also similar as the one Spyros described:

"(...)

Server 1: VFP Database
Server 2: SQL Server

I need to run (SP on Server 2) the dll or exe using Ole Automation on Server 1. (Server 2 will have share access on Server 1)

(...)"

In server 1, I have the COM+ application o package correctly installed and working since years

In Clients computers various front end consume the server classes via, for example in VB

CreateObject('AppMastervs.cOrga', mtsServer1)

or in VFP

CreateObjectEx('AppMastervs.cOrga', mtsServer1)

These clients has registered the corresponding .vbr & tlb via CliReg32

I also registered the server classes in the Server 2 (the one with SQLServer) and it work fine with the Front ends, but was impossible to me to create the class in SQLServer using

EXEC @.hr = sp_OACreate 'AppMastervs.cOrga', @.object OUT ,1

EXEC @.hr = sp_OACreate 'AppMastervs.cOrga', @.object OUT ,4

EXEC @.hr = sp_OACreate 'AppMastervs.cOrga', @.object OUT ,5

Then I copied and registered the class as local in the the Server 2 (as COM+ app in Component services) and then it worked fine (with the 3rd parameter in 4 or 5), but the problem is that must not be done beacuse this carges the sqlServer, generate unnecesary traffic and dificults the server update process.

So, please let me know if is really possible to create, in SQL Server 2000, a server class working as COM+ application in other server, without register it locally as COM+ Application.

Thanks in advance;

Claudio Facundo Lacivita

Calling Visual Foxpro 7 COM

Dear Experts,

We are creating instances of COM Objects written in Visual FoxPro 7 in our SQL Server 2005 stored procedures.
The problem is that VFP Automation Manager which shows number of connections to number of objects is showing 3 connections to 3 objects(instead 1 to 1).

We are releasing the object in SQL Server 2005 using the sp_OADestroy @.Object but the Automation Manager leaves 1 connection to 1 object.

The Automation manager connection doesn't release all the connections.

What effects is this having to our SQL Server 2005 installation and how can we avoid it?

We noticed that when we stop the SQL Service, connections to the Automation Manager are also released.

Thank you for your time.

Regards,

Spyros Christodoulou

You could stop the OLE Automation execution environment itself by calling sp_OAStop. Note that this affects the execution environment at the server-level. Generally, you should avoid using OLE automation extensively since it is resource intensive and running these in-proc can destabilize the server. Try creating the ole server out-of-proc for better reliability with some performance penalty. What is the reason for calling the VFP object from TSQL? Is this absoultely necessary? Note that you can perform queries against VFP databases/tables using linked servers. This is something you should look at also.|||Dear Umachandar,

Thanks for your reply.

Unfortunately we cannot stop OLE Automation execution environment because other users may executing OLE Methods as well.

The reason we are calling VFP from TSQL is that we need VFP to export some files.
I know that we could use a linked server, but in our case it doesn't apply because of the following:
1) VFP database and tables are changing a lot and we don't want the SQL team to be involved every time the VFP team changes tables required for the Import in SQL.
2) The export process is very complicated and it may need to call 2 or 3 VFP methods which means on a change we need to look into these methods as well. (Both VFP and SQL Teams)

For these reasons and the fact that it is much faster to develop the export method in VFP it is better to call VFP method to export data for SQL server.

Have you tried calling VFP out-of-proc COM objects? Does it properly release memory when you call sp_OADestroy @.Object ?

Regards,

Spyros Christodoulou
|||I was suggesting out-of-proc instantiation for better reliability/isolation on the server-side. Some of this might be just behavior of OLE automation. Can you try similar test from say VB and see if the connections are released properly after the OLE object is destroyed?|||Hi Umachandar,

Thanks for your reply,

I found a post you made at microsoft.public.sqlserver.programming on august of 2001.

"I have used this. It works perfectly fine. Are you making a EXE? Does it

have UI? Make sure it doesn't have any of those. Here is one sample:

NOTE -- Save this to a file called "VFPOLE.PRG" in "C:\TEMP"
DEFINE CLASS vfpole AS Custom OLEPUBLIC
prop1 = 'VFPOLE'
ENDDEFINE

NOTE Run these in the VFP command window
CD C:\Temp
BUILD PROJECT VFPOLE FROM VFPOLE.PRG
BUILD DLL VFPOLE FROM VFPOLE

-- Now run this on the SQL Server

declare @.o int, @.h int, @.p varchar( 255 )

exec @.h = sp_OACreate 'VFPOLE.VFPOLE', @.o out

if @.@.error|@.h <> 0 exec sp_displayoaerrorinfo @.o, @.h

print @.o

exec @.h = sp_OAGetProperty @.o, 'Prop1', @.p OUT

if @.@.error|@.h <> 0 exec sp_displayoaerrorinfo @.o, @.h

print @.p

exec sp_oadestroy @.o"

I tried it and it works as an in-process OLE server. It seems that it concumes some SQL Server memory every time I run it. How to register and call the dll if it resides on a different server. (like when you register the VFP .vbr file using clireg32.exe)

Do you know how to make it an out of process and called it based on the following scenario:

Server 1: VFP Database
Server 2: SQL Server

I need to run (SP on Server 2) the dll or exe using Ole Automation on Server 1. (Server 2 will have share access on Server 1)

Any help will be greatly appreciated.

Thanks again,

Spyros Christodoulou

|||The third parameter to sp_OACreate specifies the context for the OLE server. If you specify it as 4 then out-of-proc activation will take place. See Books Online for more details on the parameter.|||

Hi Umachandar and Spyros:

I am trying to do something very similar in SQL Server 2000 with VFP 8 objects.

The remaining problem is also similar as the one Spyros described:

"(...)

Server 1: VFP Database
Server 2: SQL Server

I need to run (SP on Server 2) the dll or exe using Ole Automation on Server 1. (Server 2 will have share access on Server 1)

(...)"

In server 1, I have the COM+ application o package correctly installed and working since years

In Clients computers various front end consume the server classes via, for example in VB

CreateObject('AppMastervs.cOrga', mtsServer1)

or in VFP

CreateObjectEx('AppMastervs.cOrga', mtsServer1)

These clients has registered the corresponding .vbr & tlb via CliReg32

I also registered the server classes in the Server 2 (the one with SQLServer) and it work fine with the Front ends, but was impossible to me to create the class in SQLServer using

EXEC @.hr = sp_OACreate 'AppMastervs.cOrga', @.object OUT ,1

EXEC @.hr = sp_OACreate 'AppMastervs.cOrga', @.object OUT ,4

EXEC @.hr = sp_OACreate 'AppMastervs.cOrga', @.object OUT ,5

Then I copied and registered the class as local in the the Server 2 (as COM+ app in Component services) and then it worked fine (with the 3rd parameter in 4 or 5), but the problem is that must not be done beacuse this carges the sqlServer, generate unnecesary traffic and dificults the server update process.

So, please let me know if is really possible to create, in SQL Server 2000, a server class working as COM+ application in other server, without register it locally as COM+ Application.

Thanks in advance;

Claudio Facundo Lacivita

Friday, February 10, 2012

Calling vb script from SQL job

I am trying to execute a visual basic script using a SQL job. I can schedul
e
this as a scheduled task and then use a separate SQL job to compelte the
formatting tasks, but prefer to keep all steps consolidated so it is easier
to trouble shoot.
I tried using xp_cmdshell 'job.vbs', no_output
but it gives the error that this is not a recognized internal command.
Any help would be greatly appreciated.>I am trying to execute a visual basic script using a SQL job. I can
>schedule
> this as a scheduled task and then use a separate SQL job to compelte the
> formatting tasks,
Why don't you have the VBScript task call a stored procedure?
A|||Hello Derekman:
You wrote on Mon, 26 Jun 2006 12:12:03 -0700:
D> I am trying to execute a visual basic script using a SQL job. I can
D> schedule this as a scheduled task and then use a separate SQL job to
D> compelte the formatting tasks, but prefer to keep all steps consolidated
D> so it is easier to trouble shoot.
D> I tried using xp_cmdshell 'job.vbs', no_output
D> but it gives the error that this is not a recognized internal command.
You can run only an executable; sql server won't look into the registry to
see what is the application handling file extension. In Explorer, this is
most likely specified as
WScript.exe "%1" %*
That's how it should be in sql job as well.
Vadim Rapp