I have created a silverlight webpart and I need to send an email when the form is submitted. I have written a sql stored procedure to send the mail. How can I can the stored procedure from silverlight web part?
You'll need to create a WebService in your backend code that actually calls the stored procedure, and in your Silverlight app you call that webservice. Remember that Silverlight runs on the client (usually the browser), so any database access code should be done in the server, and access as a service.
Related
I am trying to call a Stored Proc using a C# helper class in my BizTalk solution. I am able to call the stored proc when I use a Send port with WCF-Custom adapter and set AmbientTrancsaction to "false". However I get a DTC error when trying to call the stored proc using the Helper class.
Is there a way to disable the transactions from the helper method itself.
i have an Autocomplete ajax control that calls a WCF service method automatically.
this method gets a string as an input parameter and return a list of strings.
i don't make that call from the client , the control does it, but i write the content of this method.
Can i store some data somewhere in the WCF service when that method is called and extract it later when i use the WCF from the client ?
i mean , i want the control to call the method, in the method i'll store some data and later when i use the WCF client object i'll extract it.
is there such "WCF cache" mechanism?
No, there's no such thing as a 'WCF cache' mechanism. But WCF is .NET, and in a .NET application you can use the Caching Application Block.
Caching has very little if anything to do with WCF. You cache inside your application, but the caching mechanism for a WCF service is fundamentally the same as a Windows Forms application or a managed Windows Service (or an ASMX webservice, or a ASP.NET application, or any .NET application). The only difference is how you use and rely on the cache & how the applicaton's lifecycle is managed.
If your WCF service is hosted in IIS (as is very popular), then when the application pool is recycled (or the website is restarted) you will lose everything in the cache. Will this be a problem?
The typical use case for a cache is when you have a set of data stored (in, say, a database) that will need to retrieved over and over again. Rather than get from the database everytime, you get from the cache. If it's not in the cache, you get from the database and put it in the cache so it's there for next time. It sounds like you want to store some data from the client application in the cache. You can do this, but what will happen if it's not there when you go to retrieve it.
We have a WCF service developed in C# which is being used by several .Net and PowerBuilder applications.
When a document is scanned users can preview the scanned document on the application window and when the save button is clicked, the WCF service is called and the document get stored in our repository.
The above functionality is working absolutely fine for single page scans and if we scan multiple pages, we are getting error saying "The definition of the method signature in the web proxy is wrong-the data doesn't match the parameter"
Interesting part is, whether it is single page document or multi page, it calls the same method.
any help greatly appreciated.
You have the answer in the message. When you call the service to scan multiple pages, the data it returns doesn't match the contract. Most likely, the contract says it returns one of whatever represents the page, but the service is sending more than one.
I am using WCF webservice in ASP.NET application. The webservice gets dataset from database using Fill method of SqlDataAdapter. I observed that it is not cancelling the query (stored procedure) execution if user stops page loading.
Please let me know if there is any settings for web application, webservice to stop the query execution which is no longer required. Also the details about the request/response flow from web page to sql server.
Thanks,
Milind
You can use the Response.IsClientConnected property in the webservice to check if the request is still wanted.
Is it possible to call a function in a VB.Net dll without having registered the dll file? I need to call it from ASP Classic on shared hosting web server.
The only way to call a VB.NET DLL from Classic ASP is to make it a COM object and call it as such.
Assuming the host also support .NET you can follow those steps to achieve what you want:
Create new ASP.NET web application
Add reference to that DLL
Build .aspx web form that call the function in its Page_Load call it for example Func.aspx
In the classic ASP use XMLHTTP to send request to Func.aspx thus invoking the function and parse the results if needed.
I've done similar thing in the past to resize images on the fly from classic ASP without third party component so the concept itself is working.