Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Sunday, March 25, 2012

Accessing Delivery Extension UI WebControls

hi,
We are developing a custom web application that will interact with the
Reporting Services web service (instead of using the ReportManager). I need
to manage subscriptions from my custom web app just like ReportManager does.
I would like to programmatically access the web controls located in each
extension dll (e-mail, fileshare, or my own custom dlls) used to gather
information from the client instead of having to write new ones. I know the
ReportManager accesses these objects (for example, the
PrinterDeliveryUIProvider in the printer delivery sample), so there must be a
way to do this. (Reflection?)
I couldn't find any helpful documentation (might have missed something), and
wondered if anyone knew how the best way to go about this.
Thanks,
MattThe Report Manager obtains the list of the registered UI controls from the
<DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
by loading dynamically the user control presumably by calling LoadControl().
Since the UI controls implement ISubscriptionBaseUIUserControl the Report
Manager knows how to manipulate them in a standard fashion.
You may find my custom Web Service delivery extension (included in the book
source code) useful to understand how the UI controls work.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:14595C36-8130-481F-8DC9-7C356DF66314@.microsoft.com...
> hi,
> We are developing a custom web application that will interact with the
> Reporting Services web service (instead of using the ReportManager). I
need
> to manage subscriptions from my custom web app just like ReportManager
does.
> I would like to programmatically access the web controls located in each
> extension dll (e-mail, fileshare, or my own custom dlls) used to gather
> information from the client instead of having to write new ones. I know
the
> ReportManager accesses these objects (for example, the
> PrinterDeliveryUIProvider in the printer delivery sample), so there must
be a
> way to do this. (Reflection?)
> I couldn't find any helpful documentation (might have missed something),
and
> wondered if anyone knew how the best way to go about this.
> Thanks,
> Matt|||Ah, that would be the link I was looking for. I focused on obtaining the
info straight from the ReportServer and didn't think of using my own config
file. And after the time I've already spent with the config files while
getting my custom delivery extension to work...
I will also look into the LoadControl() method.
Thanks for your help.
Matt
"Teo Lachev [MVP]" wrote:
> The Report Manager obtains the list of the registered UI controls from the
> <DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
> by loading dynamically the user control presumably by calling LoadControl().
> Since the UI controls implement ISubscriptionBaseUIUserControl the Report
> Manager knows how to manipulate them in a standard fashion.
> You may find my custom Web Service delivery extension (included in the book
> source code) useful to understand how the UI controls work.
> --
> Hope this helps.
>|||LoadControl() won't work - it loads a UserControl where a control used for a
delivery extension UI is a WebControl.
I'll look into this more - maybe try loading it with reflection.
"mshumaker" wrote:
> Ah, that would be the link I was looking for. I focused on obtaining the
> info straight from the ReportServer and didn't think of using my own config
> file. And after the time I've already spent with the config files while
> getting my custom delivery extension to work...
> I will also look into the LoadControl() method.
> Thanks for your help.
> Matt
>
> "Teo Lachev [MVP]" wrote:
> > The Report Manager obtains the list of the registered UI controls from the
> > <DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
> > by loading dynamically the user control presumably by calling LoadControl().
> > Since the UI controls implement ISubscriptionBaseUIUserControl the Report
> > Manager knows how to manipulate them in a standard fashion.
> >
> > You may find my custom Web Service delivery extension (included in the book
> > source code) useful to understand how the UI controls work.
> >
> > --
> > Hope this helps.
> >
>|||My bad :-)
Than, it is probably dynamically loading the assembly using Load or LoadFrom
and adding the control to a placeholder, e.g.
PlaceHolder1.Controls.Add(ctrl);
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:01BF60A4-B199-4A2C-B494-5741ADAD650E@.microsoft.com...
> LoadControl() won't work - it loads a UserControl where a control used for
a
> delivery extension UI is a WebControl.
> I'll look into this more - maybe try loading it with reflection.
> "mshumaker" wrote:
> >
> > Ah, that would be the link I was looking for. I focused on obtaining
the
> > info straight from the ReportServer and didn't think of using my own
config
> > file. And after the time I've already spent with the config files while
> > getting my custom delivery extension to work...
> >
> > I will also look into the LoadControl() method.
> >
> > Thanks for your help.
> > Matt
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > The Report Manager obtains the list of the registered UI controls from
the
> > > <DeliveryUI> element in the RSWebApplication.config file. Then, it
proceeds
> > > by loading dynamically the user control presumably by calling
LoadControl().
> > > Since the UI controls implement ISubscriptionBaseUIUserControl the
Report
> > > Manager knows how to manipulate them in a standard fashion.
> > >
> > > You may find my custom Web Service delivery extension (included in the
book
> > > source code) useful to understand how the UI controls work.
> > >
> > > --
> > > Hope this helps.
> > >
> >

accessing database problem

Hello friends when I am working in VWD and accessing sql data this error came?

I am using asp.net visual web developer edition and sql server 2005 expressedition.

plz check it out and help me.

The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

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

Exception Details:System.Data.SqlClient.SqlException: The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): The log scan number (588:85:1) passed to log scan in database 'D:\GCAP\APP_DATA\GRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
Could not open new database 'D:\GCAP\APP_DATA\GRIET_IT.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file D:\GCAP\App_Data\GRIET_IT.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +171
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +223
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +371
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +184
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +501
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
System.Data.SqlClient.SqlConnection.Open() +159
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +118
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +82
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1653
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82
System.Web.UI.WebControls.ListControl.PerformSelect() +18
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5684



Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

Hi radhekrishna,

The error message indicates that either the database file you are trying to attached has already been attached in sql express or there is data corruption in your database file(.mdf file) , thus the db file could not be attached. I would suggest you connect to your sql express server through management studio to make a verification (Note here that since Sql Express use customer instance, in management studio, you must login using the same account as the one you used in your application). If that db file has been attached, detach it and take another try.

If there is no such file attached already in your sql express, I would suggest you first attach that mdf file to your database. If you still get this error, it means that the mdf file is data corrupted (information in ldf file and mdf file does not match) and cannot be used anymore--You need to restore it then.

Hope my suggestion helps

accessing data from a web page

Hi all,
I need to create a web application.
I will probably need to web pages in this application. On the first
page, I would like to query a Sql table and list the rows returned by the
query in a List.
When user will click on any of the listed rows and click on Edit, I
would like to display the second page which will allow the user to edit the
selected record and save it back into the Sql table.
I know, I can easily create this app using ASP.Net. But the problem is
that the web pages will need to be accessed locally from laptops. IIS will
not be available to serve the pages. Each laptop will have Sql server
installed locally. So my app probably would have to use only
HTML,javascript/vbscript. It can't use ASP/ASP.Net.
I will appreciate it if you can provide me suggestions or links to
tutorials/samples that can help me with this application.
Thanks.Nikhil Patel wrote:
> Hi all,
> I need to create a web application.
> I will probably need to web pages in this application. On the first
> page, I would like to query a Sql table and list the rows returned by
> the query in a List.
> When user will click on any of the listed rows and click on Edit, I
> would like to display the second page which will allow the user to
> edit the selected record and save it back into the Sql table.
> I know, I can easily create this app using ASP.Net. But the
> problem is that the web pages will need to be accessed locally from
> laptops. IIS will not be available to serve the pages. Each laptop
> will have Sql server installed locally. So my app probably would have
> to use only HTML,javascript/vbscript. It can't use ASP/ASP.Net.
> I will appreciate it if you can provide me suggestions or links to
> tutorials/samples that can help me with this application.
> Thanks.
How about writing a fat client app to do this, instead of a web app.
David Gugick
Imceda Software
www.imceda.com|||Nikhil,
If you can't use IIS, then it kills the idea of creating a web solution.
Do you have access to any other tools such as VB/.Net or VC++/.Net? Are the
local laptops on the same domain as the web server? If so, you could add a
header for the website in IIS and build/serve the pages as you normally woul
d.
"Nikhil Patel" wrote:

> Hi all,
> I need to create a web application.
> I will probably need to web pages in this application. On the first
> page, I would like to query a Sql table and list the rows returned by the
> query in a List.
> When user will click on any of the listed rows and click on Edit, I
> would like to display the second page which will allow the user to edit th
e
> selected record and save it back into the Sql table.
> I know, I can easily create this app using ASP.Net. But the problem is
> that the web pages will need to be accessed locally from laptops. IIS will
> not be available to serve the pages. Each laptop will have Sql server
> installed locally. So my app probably would have to use only
> HTML,javascript/vbscript. It can't use ASP/ASP.Net.
> I will appreciate it if you can provide me suggestions or links to
> tutorials/samples that can help me with this application.
> Thanks.
>
>|||Thanks. But this application has to be a web app. because it is inteded to
be used in a browser of a third party app.
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:eLjje1gCFHA.3928@.TK2MSFTNGP15.phx.gbl...
> Nikhil Patel wrote:
> How about writing a fat client app to do this, instead of a web app.
> --
> David Gugick
> Imceda Software
> www.imceda.com

Thursday, March 22, 2012

Accessing ASPNETDB from outside web application

Hi there,

I have a slight problem. I have a web service running on my server. In this, I need to access values in User's profiles. The problem is of course, that Profile, ProfileCommon, ProfileBase, etc... are not available to me here.

What can I do?

Is using an SQL command best? If so, could someone post an example SQL command - I am getting confused by how to structure the command, since I need Membership data like UserName, and Profile data (an object serialized as binary in the Profile).

Kind regards,

kreid

Hi Kreid,

To share the ASPNETDB to another application, you will need to attach the database to an instance of SQL Server. Then change the connection string of both applications to point to that database.

|||

Hi Kevin,

I'm having the sampe problem even though I have my ASPNETDB in an SQL-server. After thoroughly checking the interfaces, and forums, there is apparently no way to access the Profile from a console application. Certainly, I can do a LINQ query and get the Profile properties string and values string from the ASPNETDB, but then parse them myself etc.? There must be a better way? Any tips/examples out there?

Thanks!

Richard

|||

The Solution:

http://blogs.msdn.com/msdnts/archive/2006/12/16/asp-net-2-0-membership-role-management-out-of-asp-net-context.aspx

accessing asp.net app on client

I keep getting this "the request failed with http status 401: Unauthorized." error when i access the web app from a client machine.
my configuration:
client - client1
asp.net app - dev1
rs server/db - dev2
sql db - dev3
i'm using nt authentication
the following vb.net code is used for creditentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
and yes i do have impersonate = true
however, i do have aIf you impersonate client in you Web App you are hitting the limitation of
NT authentications. NTLM impersonation only survives one machine hop.
client->dev1 is OK, however dev1->dev2 is not possible after that. You need
to enable Kerberos delegations for this.
If you are not impersonating client in your web app, you need to run your
web app under account, known to machine dev2, such as domain account and
give that account rights to report server.
--
Dmitry Vasilevsky, SQL Server Reporting Services Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
---
"mg" <mg@.discussions.microsoft.com> wrote in message
news:6B13373C-36E8-409A-BE6A-1FE8EBF6F31D@.microsoft.com...
> I keep getting this "the request failed with http status 401:
Unauthorized." error when i access the web app from a client machine.
> my configuration:
> client - client1
> asp.net app - dev1
> rs server/db - dev2
> sql db - dev3
> i'm using nt authentication
> the following vb.net code is used for creditentials
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> and yes i do have impersonate = true
> however, i do have a
>

Accessing an SSRS report from the web, being prompted for Guest signon screen

I have a sql server 2005 application that uses asp and some canned reports that I built using SSRS. All reports run from the server but not when to try accessing from another computer on the network. I get a prompt from windows that requests me to enter a password for the Gurest account. The Guest account is not selectable. Does anyone know how to supress the signon page? I am using sql 2005 workgroup edition. I would like the users to go directly to the ssrs report without any logon screen.

Thanks

Rich

Hi,

I guess you enabled Simple File Shring on the computer you want to have access to. Switch it off by using the Explorer Menu --> Options --> Advanced --< Disable "Simple File Sharing". The computer will now prompt you for credentials as you will be not authenticated as a guest user.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Jens,

I looked at my internet explorer optiions under in advanced settings, and do not see an oprion for "Simple File Sharing" to uncheck?

Thanks

|||

That in the service hosting machine, in the Options of the Explorer, not the internet explorer.

-jens.

|||

Jens,

What explorer are you talk about? Could you be more specific. Been looking all over for that option on my server machine.

Thanks

Rich

|||Are you running on an WinXP box? Are you using Windows authentication on your virtual directories? If so try forcing NTLM (see workaround section in http://support.microsoft.com/default.aspx?scid=kb;en-us;871179). If it works for you then we can be pretty certain that it is a kerberos issue. Either follow the "workaround" or the "resolution" in the KB article.|||

James,

I am running windows XP, and Windows Authentication on virtual Directories. The web application works fine reading and writing to sql server. It only prompts me for guest signon screen when I select a report that was published to reporting services report. The TreeNode code that runs the report s displayed below:

<asp:TreeNode NavigateUrl="http://promsvr/ReportServer/Pages/ReportViewer.aspx?%2fPromshop+Reports%2fSalesReceipt&rs:Command=Render" target="content" Text="Sales Receipt" Value="SalesRpt"></asp:TreeNode>

I ran the workaround from the article and got the following results that matched the article. The following text was returned:

NTAuthenticationProviders : (STRING) "NTLM"

I have the same problem when accessing the report from a client machine. I could not do the resolution from the article as I do not know how to get

IIS_computer's_NetBIOS_name DomainName\UserName
computer's_FQDN DomainName\UserName

My Virtual Web Settings are:

Virtual Web Server:

Anonymous access checked; User Name: IUSR_PROMSVR; Password: *********; Allow IIS to control password is selected; Integrated Windows authentication is selected

Virtual Reports

Only Integrated Windows authentication is checked

Virtual ReportServer

Only Integrated Windows authentication is checked

|||

Just want to confirm: did the workaround solve your problem? What are the OS on your client machine and RS server machine?

I don't know a definitive way of finding out NetBIOS and FQDN. For NetBIOS name, run "nbtstat -n". It is basically the shortname of your server. For FQDN, find out your DNS suffix by running "ipconfig /all", and prepend the NetBIOS name to DNS suffix. For example, you NetBIOS name may be "myserver", and FQDN may be "myserver.mycompany.com". The DomainName\UserName is the domain account that the RS app pool is running under.

You mentioned Virtual Web Server. What is this?

|||

I figured it out, I turned simple file sharing off in explorer.

Thanks everyone for all there help....

Accessing a web service using clr in SQL 2005

I need to access a billing webservice from SQL. I createde a new c# class project and made a web refrence to the web service "ProdBilling".

Here is the code of my assembly

using System.Data;
using Microsoft.SqlServer.Server;
using System.Data.SqlTypes;
namespace PaymentProc
{
public class PaymentProc
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void ChargeCard(int account, int amount)
{
string Response;
ProdBilling.Service serv = new ProdBilling.Service();
Response = serv.ChargeCard(account, amount);
SqlContext.Pipe.Send(Response);
}
}
}

I then ran WSDL

wsdl /oStick out tongueaymentProc.cs /nStick out tongueaymentProc http://ProdWeb1/PaymentProc/PaymentProc.asmx

Then compliled

csc /target:library PaymentProc.cs

and added the assembly
CREATE ASSEMBLY PaymentProc from 'D:\ProdCode\PaymentProc.dll' WITH
PERMISSION_SET = UNSAFE

I cannot figure out how to refrence the chargecard method

I have tried

CREATE PROCEDURE PaymentProc
@.Account int,
@.Amount int
AS
EXTERNAL NAME PaymentProc.[PaymentProc.PaymentProc].ChargeCard

It seems wsdl.exe put all this serialization code

namespace PaymentProc {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;

///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="ServiceSoap", Namespace="http://ProdWeb1/PaymentProc")]
public partial class PaymentProc : System.Web.Services.Protocols.SoapHttpClientProtocol {

private System.Threading.SendOrPostCallback ChargeCardOperationCompleted;

///
public PaymentProc()
{
this.Url = "http://ProdWeb1/PaymentProc/PaymentProc.asmx";
}

///
public event ChargeCardCompletedEventHandler ChargeCardCompleted;

///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://ProdWeb1/PaymentProc/ChargeCard", RequestNamespace="http://ProdWeb1/PaymentProc", ResponseNamespace="http://ProdWeb1/PaymentProc", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string ChargeCard(int account, int amount) {
object[] results = this.Invoke("ChargeCard", new object[] {
account,
amount});
return ((string)(results[0]));
}
.................

When I run

CREATE PROCEDURE PaymentProc
@.Account int,
@.Amount int
AS
EXTERNAL NAME PaymentProc.[PaymentProc.PaymentProc].ChargeCard

I get error

Method, property or field 'ChargeCard' of class 'PaymentProc.PaymentProc' in assembly 'PaymentProc' is not static.

Any ideas? This seemsed so straitforward in the beginning.

Change your ChargeCard CLR method (the one you are marking as a proc) to some other name, and then change the CREATE PROCEDURE statement to use that changed name. That should hopefully do it.

Niels
|||

I think my problem originates from the fact that you cannot complie an assembly using a web refrence using csc. I redesigned my assembly with a web refrence to http://ProdWeb1/PaymentProc/PaymentProc.asmx called ProdBilling which I can test operation ChargeCard successfully.

using System;

using System.Collections.Generic;

using System.Text;

namespace PayProcAssembly

{

public class PaymentProcessing

{

[Microsoft.SqlServer.Server.SqlProcedure]

public static string ChargeCard(int Account, float Amount)

{

ProdBilling.PayProcessing serv = new ProdBilling.PayProcessing();

string result = serv.ChargeCard(Account, Amount);

SqlContext.Pipe.Send(result);

}

}

}

When I run

csc /target:library PaymentProcessing.cs

I get

Error: The type or namespace name 'ProdBilling could not be found (are you missing a using directive or an assembly reference?)

I was told I needed to create a proxy using WSDL.exe but it seems when I ran

wsdl /o PaymentProc.cs /n PaymentProc http://ProdWeb1/PaymentProc/PaymentProc.asmx

It messed up my code. I cant even find the web refrence anymore. Is this correct that I have to use wsdl or is there an easier way?

Accessing a web service using clr in SQL 2005

I need to access a billing webservice from SQL. I createde a new c# class project and made a web refrence to the web service "ProdBilling".

Here is the code of my assembly

using System.Data;
using Microsoft.SqlServer.Server;
using System.Data.SqlTypes;
namespace PaymentProc
{
public class PaymentProc
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void ChargeCard(int account, int amount)
{
string Response;
ProdBilling.Service serv = new ProdBilling.Service();
Response = serv.ChargeCard(account, amount);
SqlContext.Pipe.Send(Response);
}
}
}

I then ran WSDL

wsdl /oStick out tongueaymentProc.cs /nStick out tongueaymentProc http://ProdWeb1/PaymentProc/PaymentProc.asmx

Then compliled

csc /target:library PaymentProc.cs

and added the assembly
CREATE ASSEMBLY PaymentProc from 'D:\ProdCode\PaymentProc.dll' WITH
PERMISSION_SET = UNSAFE

I cannot figure out how to refrence the chargecard method

I have tried

CREATE PROCEDURE PaymentProc
@.Account int,
@.Amount int
AS
EXTERNAL NAME PaymentProc.[PaymentProc.PaymentProc].ChargeCard

It seems wsdl.exe put all this serialization code

namespace PaymentProc {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;

///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="ServiceSoap", Namespace="http://ProdWeb1/PaymentProc")]
public partial class PaymentProc : System.Web.Services.Protocols.SoapHttpClientProtocol {

private System.Threading.SendOrPostCallback ChargeCardOperationCompleted;

///
public PaymentProc()
{
this.Url = "http://ProdWeb1/PaymentProc/PaymentProc.asmx";
}

///
public event ChargeCardCompletedEventHandler ChargeCardCompleted;

///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://ProdWeb1/PaymentProc/ChargeCard", RequestNamespace="http://ProdWeb1/PaymentProc", ResponseNamespace="http://ProdWeb1/PaymentProc", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string ChargeCard(int account, int amount) {
object[] results = this.Invoke("ChargeCard", new object[] {
account,
amount});
return ((string)(results[0]));
}
.................

When I run

CREATE PROCEDURE PaymentProc
@.Account int,
@.Amount int
AS
EXTERNAL NAME PaymentProc.[PaymentProc.PaymentProc].ChargeCard

I get error

Method, property or field 'ChargeCard' of class 'PaymentProc.PaymentProc' in assembly 'PaymentProc' is not static.

Any ideas? This seemsed so straitforward in the beginning.

Change your ChargeCard CLR method (the one you are marking as a proc) to some other name, and then change the CREATE PROCEDURE statement to use that changed name. That should hopefully do it.

Niels
|||

I think my problem originates from the fact that you cannot complie an assembly using a web refrence using csc. I redesigned my assembly with a web refrence to http://ProdWeb1/PaymentProc/PaymentProc.asmx called ProdBilling which I can test operation ChargeCard successfully.

using System;

using System.Collections.Generic;

using System.Text;

namespace PayProcAssembly

{

public class PaymentProcessing

{

[Microsoft.SqlServer.Server.SqlProcedure]

public static string ChargeCard(int Account, float Amount)

{

ProdBilling.PayProcessing serv = new ProdBilling.PayProcessing();

string result = serv.ChargeCard(Account, Amount);

SqlContext.Pipe.Send(result);

}

}

}

When I run

csc /target:library PaymentProcessing.cs

I get

Error: The type or namespace name 'ProdBilling could not be found (are you missing a using directive or an assembly reference?)

I was told I needed to create a proxy using WSDL.exe but it seems when I ran

wsdl /o PaymentProc.cs /n PaymentProc http://ProdWeb1/PaymentProc/PaymentProc.asmx

It messed up my code. I cant even find the web refrence anymore. Is this correct that I have to use wsdl or is there an easier way?

Tuesday, March 20, 2012

accessing a config file from rdlc

How do I access information in a config file - web.config, app.config, etc. - from within an local report?

Thanks!

I accomplished this in a roundabout way by passing the info I wanted as a parameter.

Accessing 2005 Reports from asp.net 1.1

Our web based Application is based on ASP.NET 1.1 and SQL Server 2005.
Can we use 2005 Reporting Services (ASP.NET 2.0) to create and publish
reports and use them in the 1.1 Application?
(We need to change the Data Source at run time, which is not easy or not
possible in 2000 Reporting Services).
Thanks in advance,
BenjaminIn order to display a report you need just an URL. What seems to be a
problem?
You can view any url in your 1.1 application, even from a different web
site.
Just redirect to it or grab an ouput and display it in your application.
If you have a way of changing datasource in runtime in RS 2005, just create
a 2.0 web page, which does it on load and redirect/transfer from it to the
the report of your choice.
"Benjamin" <benjamin@.servue.com> wrote in message
news:ORZ$mvz9GHA.4196@.TK2MSFTNGP03.phx.gbl...
> Our web based Application is based on ASP.NET 1.1 and SQL Server 2005.
> Can we use 2005 Reporting Services (ASP.NET 2.0) to create and publish
> reports and use them in the 1.1 Application?
> (We need to change the Data Source at run time, which is not easy or not
> possible in 2000 Reporting Services).
> Thanks in advance,
> Benjamin
>

Monday, March 19, 2012

Access web application is slow, should I upgrade to SQL server?

Hi,
first time poster/newbie here.
I've got a football (soccer for the yanks!) predictions league website that is driven by and Access database. It basically calculates points scored for a user getting certain predictions correct. This is the URL:
http://www.pool-predictions.co.uk/home/index.asp
There are two sections of the site however that have almost ground to halt now that more users have registered throught the season. The players section and league table section have gone progressively slower to load throughout the year and almost taking 2 minutes to load.
http://www.pool-predictions.co.uk/home/players.asp?tab=a_d
http://www.pool-predictions.co.uk/home/table.asp
All the calculations are performed in the Access database Ive written and there are Access SQL queries to get the data out.
My question is, is how can I speed the bloody thing up! ! Somone has alos suggested to me that I use stored procedures and SQL Server to speed things up? Ive never used SQL Server before so I am bit scared about using it (Im only a hobbyist), and I dont even know what a SP is or does. How easy will it be upgrading the whole thing to SQL Server and will it be worth the hassle, bearing in mind I expect my userbase to keep growing? Do SP help speed things up significantly? Would appreciate some advice!
Thanks in advance,
John.

This is one of those how long is a piece of string questions....

In general I woudl recomend Access Db apps with more than 5/20 users upgrade to a version of SQL Server.

An SP is a way of capturing logic and running it inside the server, if your app brings back lots of data and then processes in the web page then its likely that an SP will be faster, but it depends on the logic. Its faster because you can be more selective with the data, you are not pullng a lot of unused data over the wire etc.

Do you know which parts of the app are slow? specific queries? you could try running it ona local machine using both access and sqlexpress and compare the perf to see.

Access vs. MSDE

I understand how msde is more powerfull than assess but is the only way to use MSDE through the web matrix. If I want to update a table or change data how can I open the file and work with it or is this when I buy SQL server. I travel full time and do all my work from my laptop so I do not want to install any server software on it. Or should I just us access and use the upsize wizard to use MSDE.

Adam TaylorCould use a little more info.

It all depends:

Are you developing applications for other people?
Is it for personal/business use, contact management, etc?
What exactly is it that you are trying to accomplish?

Thanks.|||You can get to the tables etc using Access (At least you can with access 2002)

start Access
select the New Project (Existing Data)

Then select the machine (or type it) where the tables are
Supply login details (should be same as you require when using web matrix)

click the drop down to select a database to work on

It should work - does on mine

then you can use all access tools to manipulate the data - plus add tables and stored procedures

Pk

Access Violation What does it mean?

My web app (with SSL for every page) that uses VBCOM+ components to access
SQLServer2000 SP3 via SPs had an access violation the other day when two
users were simultaneously looking at the precisely the same information on
the same customer (one was training the other using two machines and going
through each step synchronously) and I received the Access violation error
(below). This has not happened before in two years (but no one probably
every came close to simulaneous use) and these two folks were the ONLY ones
who were even using the db and what they attempted to do (a data view) works
fine after this happened. There is nothing in the SQL Server error log about
this or are there any .dmp files in LOG. I saw an old FIX re: Access
violation during SSL but I'm at SP3 already, although this clearly wasn't an
exception error.
After Googling the web, I'm not even sure what "access violation" means,
although it sounds like it has nothing to do with my T-SQL code and is more
serious.
So, what does this mean?
Thanks.
Source: Microsoft OLE DB Provider for SQL Server
Error Number: -2147217900
Description: Syntax error or access violationAn AV is generally a bug in SQL Server... Look for the error message on MS
web site (using the long number that comes with the AV), and/or open a call
to MS... IF you are identifying a bug there will be no service charge.
"Don Miller" <nospam@.nospam.com> wrote in message
news:efbjxkyQDHA.2832@.TK2MSFTNGP10.phx.gbl...
> My web app (with SSL for every page) that uses VBCOM+ components to access
> SQLServer2000 SP3 via SPs had an access violation the other day when two
> users were simultaneously looking at the precisely the same information on
> the same customer (one was training the other using two machines and going
> through each step synchronously) and I received the Access violation error
> (below). This has not happened before in two years (but no one probably
> every came close to simulaneous use) and these two folks were the ONLY
ones
> who were even using the db and what they attempted to do (a data view)
works
> fine after this happened. There is nothing in the SQL Server error log
about
> this or are there any .dmp files in LOG. I saw an old FIX re: Access
> violation during SSL but I'm at SP3 already, although this clearly wasn't
an
> exception error.
> After Googling the web, I'm not even sure what "access violation" means,
> although it sounds like it has nothing to do with my T-SQL code and is
more
> serious.
> So, what does this mean?
> Thanks.
> Source: Microsoft OLE DB Provider for SQL Server
> Error Number: -2147217900
> Description: Syntax error or access violation
>
>

Sunday, March 11, 2012

Access to the ADO.net Managed Provider SqlClientFactory was denied

In a previous post in Installation and Setup I was having problems just getting an ASP.NET 2.0 app to run on my web server. Now I'm having some different weird security issues.

I'm getting this message when just trying to open a database and put its contents into a gridview.

Access to the ADO.net Managed Provider 'SqlClientFactory' was denied in the data source with ID 'sqlEmployees' because of security settings.

I think this may have to do with our web server and our SQL server being separate machines. That always gives us issues. But I have impersonation=true in my web.config along with windows authentication and I have SQL Server configured with Windows and SQL authentication so things should be right, I'm thinking.

Any ideas??

I guess I stumped everyone. Thanks anyways.|||

Did you find the solution? If so please post it, so that it will help others :)

|||Had the same problem. There was a web.config in the root directory, deleted it and solved the problem

access to sqlserver database from web

Hi
I do not want to install SQL server client on every user machine.
I want to give users access from browser to the sqlserver 2000 database.
Is it possible?
I saw sqlserver webadministrator?
From the name it looks like a administration tool?
Thanks
Mangesh
"SQL Server Web Data Administrator"
http://www.microsoft.com/downloads/d...displaylang=en
Cristian Lefter, SQL Server MVP
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:8B328C00-790E-4FD0-82F3-022F3C6ABA40@.microsoft.com...
> Hi
> I do not want to install SQL server client on every user machine.
> I want to give users access from browser to the sqlserver 2000 database.
> Is it possible?
> I saw sqlserver webadministrator?
> From the name it looks like a administration tool?
> Thanks
> Mangesh

access to sqlserver database from web

Hi
I do not want to install SQL server client on every user machine.
I want to give users access from browser to the sqlserver 2000 database.
Is it possible?
I saw sqlserver webadministrator?
From the name it looks like a administration tool'
Thanks
Mangesh"SQL Server Web Data Administrator"
http://www.microsoft.com/downloads/details.aspx?FamilyID=C039A798-C57A-419E-ACBC-2A332CB7F959&displaylang=en
Cristian Lefter, SQL Server MVP
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:8B328C00-790E-4FD0-82F3-022F3C6ABA40@.microsoft.com...
> Hi
> I do not want to install SQL server client on every user machine.
> I want to give users access from browser to the sqlserver 2000 database.
> Is it possible?
> I saw sqlserver webadministrator?
> From the name it looks like a administration tool'
> Thanks
> Mangesh

access to sqlserver database from web

Hi
I do not want to install SQL server client on every user machine.
I want to give users access from browser to the sqlserver 2000 database.
Is it possible?
I saw sqlserver webadministrator?
From the name it looks like a administration tool'
Thanks
Mangesh"SQL Server Web Data Administrator"
http://www.microsoft.com/downloads/...&displaylang=en
Cristian Lefter, SQL Server MVP
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:8B328C00-790E-4FD0-82F3-022F3C6ABA40@.microsoft.com...
> Hi
> I do not want to install SQL server client on every user machine.
> I want to give users access from browser to the sqlserver 2000 database.
> Is it possible?
> I saw sqlserver webadministrator?
> From the name it looks like a administration tool'
> Thanks
> Mangesh

Tuesday, March 6, 2012

Access to MSDE database

Hi
I am just starting my first .NET project using the web matrix and an MSDE database. I am pretty much at the limit of my knowledge - all very interesting. I have some data in an Access spreadsheet (6 columns and 365 rows) which in the past I have copied and pasted into an Access database table. How do I get it into a MSDE database table? This process does not need to be automated/programmed as I will only have to do it once a year. Any ideas on the easiest way forward would be much appreciated.
Thanks in advance.
MikeUse the Upsizing Wizard in Access. Tools/Database Utilities/Ubsizig Wizard, as I recall.|||Douglas
Very many thanks for the advise - it got me going along the righttracks. In the end I used File/Export (which seemed well suitedto transfering data in a single table). I had to configure someODBC connections (which took me a while to understand and setup). Anyway, it seems to work now.
Thanks again.
Mike

Access to fields in a table

I am trying to access the fields in a table using Visual Basic in Web Developer .NET

Start with the link below and click on SelectCommand, InsertCommand, DeleteCommand and UpdateCommand to get tbe basic of manipulating data in the database through ADO.NET. Hope this helps.

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx

Saturday, February 25, 2012

Access SQL Server Behind Firewall

Web Services
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<harel.davidm@.gmail.com> wrote in message
news:1151082261.350657.124850@.m73g2000cwd.googlegroups.com...
>I have an SQL server that resides on my local LAN. My local LAN is
> behind a firewall that we do not maintain. We have been told that we
> cannot have any additional ports opened on the firewall, meaning that
> the ports used by SQL server are and will remain closed.
> My dilemma is that I need to provide people outside my company view
> only access, via our internet site, to data that is on my local SQL
> server. My web server resides on a public network that is outside my
> firewall. Is there a way that this can be done without opening the
> ports on the firewall?
>Arnie Rowland wrote:
> Web Services
>
Can you be a little more specific? Your answer doesn't really help as
is.|||Web Services, by design (and definition) use port 80 (http). Almost all
firewalls have port 80 open. Web Services are normally 'inside' the firewall
running on a web server (IIS).
With Visual Studio, you can create one or more web services (applications
that run on an IIS server). The web service receives a http post from the
web application, and then the web service retrieves the data from SQL Server
and passes it back to the web application in the response.
Also, SQL 2005 has the capability to host stored procedures as web services.
However, this should only be done when one is in complete understanding of
the security issues.
This is a lengthy and complicated discussion, inappropriate for this forum.
I suggest that you investigate Web Services in Visual Studio. Here is a
place to start.
http://msdn.microsoft.com/webservices/
Good luck.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<harel.davidm@.gmail.com> wrote in message
news:1151082723.343995.161530@.g10g2000cwb.googlegroups.com...
> Arnie Rowland wrote:
> Can you be a little more specific? Your answer doesn't really help as
> is.
>|||I have an SQL server that resides on my local LAN. My local LAN is
behind a firewall that we do not maintain. We have been told that we
cannot have any additional ports opened on the firewall, meaning that
the ports used by SQL server are and will remain closed.
My dilemma is that I need to provide people outside my company view
only access, via our internet site, to data that is on my local SQL
server. My web server resides on a public network that is outside my
firewall. Is there a way that this can be done without opening the
ports on the firewall?|||Web Services
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<harel.davidm@.gmail.com> wrote in message
news:1151082261.350657.124850@.m73g2000cwd.googlegroups.com...
>I have an SQL server that resides on my local LAN. My local LAN is
> behind a firewall that we do not maintain. We have been told that we
> cannot have any additional ports opened on the firewall, meaning that
> the ports used by SQL server are and will remain closed.
> My dilemma is that I need to provide people outside my company view
> only access, via our internet site, to data that is on my local SQL
> server. My web server resides on a public network that is outside my
> firewall. Is there a way that this can be done without opening the
> ports on the firewall?
>|||Arnie Rowland wrote:
> Web Services
>
Can you be a little more specific? Your answer doesn't really help as
is.|||Web Services, by design (and definition) use port 80 (http). Almost all
firewalls have port 80 open. Web Services are normally 'inside' the firewall
running on a web server (IIS).
With Visual Studio, you can create one or more web services (applications
that run on an IIS server). The web service receives a http post from the
web application, and then the web service retrieves the data from SQL Server
and passes it back to the web application in the response.
Also, SQL 2005 has the capability to host stored procedures as web services.
However, this should only be done when one is in complete understanding of
the security issues.
This is a lengthy and complicated discussion, inappropriate for this forum.
I suggest that you investigate Web Services in Visual Studio. Here is a
place to start.
http://msdn.microsoft.com/webservices/
Good luck.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<harel.davidm@.gmail.com> wrote in message
news:1151082723.343995.161530@.g10g2000cwb.googlegroups.com...
> Arnie Rowland wrote:
> Can you be a little more specific? Your answer doesn't really help as
> is.
>|||It is my understanding that to do this we will need to upgrade to SQL
2005 and Visual Studio 2005. Our application is running on SQL 2000
and was written in Visual Studio 6 and is not easily rewirtable.
Arnie Rowland wrote:
> Web Services, by design (and definition) use port 80 (http). Almost all
> firewalls have port 80 open. Web Services are normally 'inside' the firewa
ll
> running on a web server (IIS).
> With Visual Studio, you can create one or more web services (applications
> that run on an IIS server). The web service receives a http post from the
> web application, and then the web service retrieves the data from SQL Serv
er
> and passes it back to the web application in the response.
> Also, SQL 2005 has the capability to host stored procedures as web service
s.
> However, this should only be done when one is in complete understanding of
> the security issues.
> This is a lengthy and complicated discussion, inappropriate for this forum
.
> I suggest that you investigate Web Services in Visual Studio. Here is a
> place to start.
> http://msdn.microsoft.com/webservices/
> Good luck.|||.NET Web Services can access data in any ADO.NET datastore -including SQL
Server 2000, Oracle, Exchange, Access, Excel files, etc..
You can create .NET Web Services using Visual Notepad -however Visual Studio
makes it easier.
SQL Server 2005 is not necessary for Web Services.
IIS and the .NET framework on the IIS server (and the development boxes) is
required.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<harel.davidm@.gmail.com> wrote in message
news:1151088102.639755.88150@.c74g2000cwc.googlegroups.com...
> It is my understanding that to do this we will need to upgrade to SQL
> 2005 and Visual Studio 2005. Our application is running on SQL 2000
> and was written in Visual Studio 6 and is not easily rewirtable.
> Arnie Rowland wrote:
>|||And this will work if my outside IIS server is unable to access my LAN?
I am told that we can go from inside out but not outside in.