C# - Best Practices To Add Some Data Into Queue?

Nov 24, 2010

I have a web application where users can upload the photo. I do have a windows service running which takes the uploaded photo and crops it to different sizes. This runs in a specified interval. Photo will be visible to the user once after it's cropped. So once user uploads the photo and photo cropper has not yet run, they wont be able to see the photo. Due to this behaviour user thinks that there was some error uploading the photo and they will upload it again and again.

where the photocropper runs immediately when the user uploads the photos which is queued.

I am using asp.net & C#.

View 3 Replies


Similar Messages:

Wcf Will Then Check For New Queue And Using Teh Queue To Send Out A Sms?

Dec 21, 2010

Currently i'm developing an apllication that sends sms via the asp.net. I'm using msmq for the queuing incase of multiple sending of sms. The wcf will then check for new queue and using teh queue to send out a sms. I've a few question.How do i create a new queue for the msmq via asp.net

View 1 Replies

Way To Queue Data And Then Process Separately?

Feb 3, 2011

Quote:

Originally Posted by wwb_99 grab the data sometime in the request, push to queue, process queue separately mainly because you don't want every request waiting on a CRM system that could be slow or down. This is a quote from wwb is another thread. What is the best to way to queue data and then process separately? Would you do it in the page_render event with a custom control? Would you use java script? Is there a post render event besides page_unload, or could you use page_unload?

View 3 Replies

ADO.NET :: Best Practices Of Using Data Context?

Feb 7, 2011

Here is the code of my Repository class:You see, I use singleton here. Also you see, there is a data context as class variable of Repository class.The main reason to use singleton here is a wish to avoid using 'using(NorthwindEntities context = new NorthwindEntities())' in every function.

[Code]....

This Repository is used in ASP.NET application. So only instance of NorthwindEntities (context) is used everywhere and that's why I never dispose it.So my question is: Won't this code cause connections to the DB that are not closed?

View 11 Replies

C# - Best Practices For Exchanging Data Between Desktop And Web Application

Apr 8, 2010

I have to pass information from a desktop application to Web application and vice versa. What are the best practices that are regularly used? Currrently I'm using Asp.Net and a Winforms. To pass data to Web Site im creating a (POST) WebRequest and posting an xml to the siteTo pass data to Application im using .Net Remoting from Asp.ne(I'm using Winforms is an adminstration and monitoring application.)

View 4 Replies

Web Forms :: Using Asp For Data Entry And Best Practices / Housing That Data Until The End Of The Scripting Has Been Completed?

Apr 19, 2010

I am developing an ASP.Net 2.0 project that a call center will use for their scripting and data collection. Each screen will present the call center associate with a question and depending on their answer, will move on to the next screen. My question is what is the best practice for housing that data until the end of the scripting has been completed (i.e. in a Dataset or datatable), where should the storage container be declared and what's the best way to control the back button so it doesn't lose the data and try to repost?

View 8 Replies

State Management :: Best Practices For Shopping Cart Data?

Jun 29, 2010

I m developing new shopping cart by using mvc2.and i have followed sample video store application posted in asp.net.my question is: What is the best way to keep shopping cart data.is it in db or a session.

View 3 Replies

Finding New Data Access Best Practices / How To Handle Data Access, And Data Manipulation And Display

Dec 15, 2010

I've been out of the ASP.Net arena since 1.1, and I'm starting to get back into it after a hiatus.

In the past, I would generally create SqlDataReaders, wire them up to pull from tables in a database via direct sql or accessing database views (mostly in MSSQL), grab the data, and display it in some datatable, or datalist.

Modifying data would usually be calling a stored procedure in the database to add/modify data, and then retrieve it afterward.

Now that I read up, I see there are alot of new things in ADO.Net world; strongly typed datasets, auto-generated adapters, etc.

My question is, does anyone have a good reference on best practices (or a book recommendation) on how to handle data access, and data manipulation and display now? I'm assuming that there are more automatic ways to show and manipulate data than before, but the new details are quite vast (which is good), but slightly overwhelming for me.

View 1 Replies

C# - Store A Queue In Viewstate?

Apr 29, 2010

EDIT: ViewState does not change when browser is refreshed, so even if you write to viewstate it will not save the data. i am trying to store a Queue in a viewstate (to track postbacks and refreshes to stop a form from resubmitting). The Queue is only saving with a count of 1 (the first item that is added to it) no matter how many items i add.

// New Queue of strings
private Queue<string> sTemp;
private Queue<string> p_tempQue
{
set
{
ViewState["sTemp"] = value;
}
get
{
return (Queue<string>)ViewState["sTemp"];
}
}
//BasePage constructor
public BasePage()
{
//create a Queue of string
//sTemp = new Queue<string>();
this.Load += new EventHandler(this.Page_Load);
this.Init += new EventHandler(this.Page_Init);
}
//In the 'page_Init' event we have created a simple hidden field by name 'hdnGuid' which is attached to the page on the first hit itself.
protected void Page_Init(object sender, EventArgs e)
{
//initializing the hidden field
//create a hidden field with a ID
HiddenField hdnGuid = new HiddenField();
hdnGuid.ID = "hdnGuid";
//if it is the first time the page is loaded, create a new guid and assign it as the hidden field value
if (!Page.IsPostBack)
hdnGuid.Value = Guid.NewGuid().ToString();
//add the hidden field to the page
Page.Form.Controls.Add(hdnGuid);
}
//In the 'page_Load' event we check if the hidden field value is same as the old value. In case the value is not same that means it's a 'postback'
//and if the value is same then its 'refresh'. As per situation we set the 'httpContent.Items["Refresh"]' value.
protected void Page_Load(object sender, EventArgs e)
{
if(p_tempQue != null)
sTemp = p_tempQue;
else
sTemp = new Queue<string>();
//The hdnGuid will be set the first time page is loaded, else the hdnGuid
//will be set after each time the form is submitted using javascript.
//assign the hidden field currently on the page for manipulation
HiddenField h1 = (HiddenField)(Page.Form.FindControl("hdnGuid"));
//create an instance of the GuidClass
GuidClass currentGuid = new GuidClass();
//set the GuidClass Guid property to the value of the hidden field
currentGuid.Guid = h1.Value;
//check to see if the Queue of strings contains the string which is the current Guid property of the GuidClass
//if the are equal, then the page was refreshed
if (sTemp.Contains<string>(currentGuid.Guid))
{
//adds item as key/value pair to share data between an System.Web.IHttpModule interface and an System.Web.IHttpHandler interface during an HTTP request.
System.Web.HttpContext.Current.Items.Add("IsRefresh", true);
}
//if they are not requal, the page is not refreshed
else
{
//if the current Guid property in the GuidClass is not null or not an empty string
//add the new Guid to the Queue
if (!(currentGuid.Guid.Equals(null) || currentGuid.Guid.Equals("")))
sTemp.Enqueue(currentGuid.Guid);
System.Web.HttpContext.Current.Items.Add("IsRefresh", false);
}
p_tempQue = sTemp;
}

View 3 Replies

C# - Remove Elements From One Queue That Are Present In Another

Nov 22, 2010

Using C# I have

Queue N: 3, 4 9, 11
Queue A: 1, 2, 3, 4, 8, 9, 11, 12, 13

I want to remove all elements from Queue A that are present in Queue N And end up with Queue R: 1, 2, 8, 12, 13. How do I do this in C#. Trying to work with someones API and they offer a way to get the two queues and I need to filter based on one queue returned.

Updated Code Example: I am using a custom data type ModuleDetails

Queue<ModuleDetails> defaultQueue = apiCallDefault();
Queue<ModuleDetails> modQueue = apiCallAllModules();

View 3 Replies

IIS 7 To Process The Request Queue In Parallel?

Apr 20, 2010

Currently we are developing an ASMX, ASP 2.0, IIS 7 web service that does some calculations (and return a dynamically generated document) and will take approx. 60 seconds to run.Since whe have a big machine with multiple cores and lots of RAM, I expected that IIS tries its best to route the requests that arrive in its requests queue to all available threads of the app pool's thread pool.But we experience quiet the opposite:When we issue requests to the ASMX web service URL from multiple different clients, the IIS seems to serially process these requests. I.e. request 1 arrives, is being processed, then request 2 is being processed, then request 3, etc

View 2 Replies

JQuery :: Clear The Queue And Re-add From That Point?

Aug 1, 2010

Note: I'm avoid flash and silverlight completely. I'm trying to imitate a flash presentation with jQuery.

I have 4 sequences, like the flash used on msn.com's site to show 4 different scenes.

I want these on a timer, but I also wnt to show a small paging control to click to a previous screen.

Would I create a queue for each scene? And when all of the queues finish do I re-create the queues or is there a method to reset?

And what if I want to go to the 2nd scene from the 4th scene by click the pager? Just clear the queue and re-add from that point?

View 4 Replies

C# - Queueing An Item To The Workflow Queue ?

Sep 24, 2010

you could have a workflow which is used for the submission and tracking of tickets, with the scenario that when the support desk goes home all of the active workflows generate an e-mail to the person who submitted the ticket saying that their ticket won't be looked at today.What is the best approach to do this?Is it a custom activity or some other method of enumerating all of the active workflows and firing an event/queueing an item to the workflow queue Clearly from the workflow perspective it would be nice to have an activity within it which is fired when,in the case of the example above the office closes.

View 2 Replies

C# - Put Email Messages In A Queue When SMTP Server Is Down?

Sep 20, 2010

I have a big problem with my SMTP server for sending emails. It's down often. At this point I am using this code:

MailMessage mailMsg = new MailMessage();
mailMsg.From = new MailAddress("fromMail@example.com");
mailMsg.To.Add("toMail@example.com");
mailMsg.Subject = "...";
mailMsg.IsBodyHtml = true;
mailMsg.BodyEncoding = Encoding.UTF8;
mailMsg.Body = "Mail";
mailMsg.Priority = MailPriority.High;
SmtpClient client = new SmtpClient();
client.Credentials = new NetworkCredential("account@gmail.com", "password");
client.Port = 456;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
client.Send(mailMsg);

But, when my SMTP server is down I want to put all the emails in a queue and when it recovers I want to send them one a time. Is there any way how to do this programatically in C#?

View 1 Replies

Use A Queue To Send Email To An Smtp Server?

Dec 9, 2010

module thats available for asp.net that uses a queue to send email to an smtp server? the queue being the operative word here.. we need a proper fallback mechanism for storing any messages that can't be sent so that the send can be re-attempted later

View 1 Replies

Web Forms :: How To Access A Queue In Class Page

Jul 22, 2010

I am trying to access an item default.aspx.vb which is in the class page in the app_code folder. Why am I unable to access this through intellisense?

If
Not m_qKnown.Contains(HRefs(i))
Then

here is the class page. In my vs, m_qknown is underlined in blue. How come I can't access this queue in this code behind page for the default.aspx? In my intellisense, if I try to prefix it with the name of the page (Charlotte.vb) Charlotte.Webcrawler. after this dot there is no m_qKnown. There are some queuing event handlers and that's about it.

I'm trying to avoid adding more items to a queue if the item is already in the known queue. I'm happy to email this website application to anyone who would like to test it.

[Code]....

View 2 Replies

Web Forms :: Plain Text Into MSMQ Queue

Apr 12, 2010

To meet the needs of a colleague, I must get plian text into a MSMQ message queue. Trouble is, Sytem.Messaging results in a body wich defaults to xml content. I had thoght that this would get round the problem - but it doesn't:

[Code]....

The body content looks rather strange actually - it reads:

54 65 73 74 20 54 65 78 Test Tex

74 20 4D 65 73 73 61 67 t Messag

65 e

Any thoughts on how to get rid of all those numbers and just have a plain text body?

View 4 Replies

C# - Shared Messaging Queue For Multiple Worker Threads In IIS?

Nov 1, 2010

I'm currently trying to interface our new intranet (ASP-MVC) with the web front end of our pager system. The pager system's front end is about 10 years old, poor interface and no documentation. To do this I have the form on the intranet post to the server, our server then sends an HTTP POST to the pager server that mimics what its own form sends.

While testing this for overloading (we sent about 10 messages almost concurrently) the pager server crashed, as the system is a black box and the only difference we noticed was the concurrent POSTs the least we can do is try to prevent this happening.I want to have all messages go into a queue that sends at most once every 5-10 seconds but I'm not sure how to implement this,

I didn't specify this earlier but the process should be synchronous from the point of view of the browser, ie webserver gets the http POST request from the browser, message is put into the queue, message is sent from the queue, webserver sends http response to the browser. This is not a high volume service and I expect simultaneous requests to be rare so response will be near instantaneous, it is more of a throttle to prevent potential issues with concurrent requests.

View 2 Replies

WCF / ASMX :: Do Multiple WCF Web Service Requests Queue Up Or Do They Run In Parallel

Mar 17, 2011

I've got a WCF web service that runs fine at the moment but there is talk about using it very heavily soon. As part of it's normal process it writes a file out, then reads it back in again (don't ask why, I know it's stupid). I'm concerned that if we start hitting it with lots of requests then the following might happen.

1. Request 1 writes the file out.

2. Request 2 comes in and overwrites the file.

3. Request 1 reads the file back in but this is now the wrong file.

My understanding is that the requests would naturally queue up so that request 2 wouldn't start until request 1 had finished, but I'm not totally sure.

View 1 Replies

JQuery :: Create The Queue Effects Using .animate Function?

Mar 2, 2011

i m trying to develop a tabbed content slider. during this i am facing two problems.

first i don't know how to create the queue effects mean, i want to animate first div, after completion of first animation than second animation would be started.

for this i using the callback function here, but i want to know is there any other procedure to do this thing.

second there is jerk in the animation at second and fourth tab.

[code]....

View 2 Replies

AJAX :: Create A Queue Box Where Can Display New Incoming Cases (numbers)

Aug 9, 2010

I have a web form (aspx page) where I load case data for my database and edit certain fields. I want to create a queue box where I can display new incoming cases (Case nums) that have not been edited yet, so that I do not mis any cases on a given day. I visualize my queue box to be something like an update panel which updates itself every few minutes and brings the new case nums in the queue box.

View 3 Replies

MVC :: Getting Error With Multiple Subscriber Listening The Same Publisher Queue Using NService Bus

May 3, 2010

I was working with asp.net + nservice bus Its working fine with one subscriber but when I specify another subscriber in webconfig It throws me error.

<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="EmailChannel" Endpoint="MyServerInputQueue"/>[code]....

View 5 Replies

Queue Access To The Database To Avoid Multiple Cache Items?

Jun 7, 2010

I have a music related ASP.NET web site which caches a lot of static information from the database on the first request.Sometimes, the application is reset and cache is cleared while the application is on heavy load and then all http requests go to the database to retrieve that static data and cache it for other requests.

How can I ensure that only one request go to the database and cache the results, so that other request simply read that info from cache and not needlessly retrieve the same info over and over again.Can I use thread locking? For example, can I do something like lock(this) { db access here }?

View 2 Replies

WCF / ASMX :: WCF Deadletter Queue Service Stops Picking Up Messages

Dec 15, 2010

I have a custom dead letter queue service to pick up messages from DLQ. This service picks up failed message from DLQ and tries to resend to a different end point. If the new endpoint doesn't work, it rolls back transaction. This works great. Here is the code.

{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Single,
AddressFilterMode = AddressFilterMode.Any)]
public class FDPDLQService : IFDService
{
FDPManager _fdpManager = new FDPManager();
[OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
public void ProcessFDMessage(FDMessage message)
{
//System.Diagnostics.Debugger.Launch();
try
{
MsmqMessageProperty mqProp =
OperationContext.Current.IncomingMessageProperties[MsmqMessageProperty.Name] as MsmqMessageProperty;
// if message log required, and configured, log the incoming message
try
{
ChannelFactory<IFDPRouter> factory = new ChannelFactory<IFDPRouter>("IFDPRouter_EP");
IFDPRouter proxy = factory.CreateChannel();
string ep = proxy.GetNextEPForGivenEP(OperationContext.Current.IncomingMessageHeaders.To.ToString());
if (ep == null || ep == string.Empty)
{
throw new EndpointNotFoundException(Common.Constants.FDP_NOT_FOUND_EXCEPTION_MESSAGE);
}
// Process message with next end point available
_fdpManager.ProcessFDMessage(message, ep);
}
catch (EndpointNotFoundException enfe)
{
ExceptionManager.HandleException(enfe);
Transaction.Current.Rollback();
//throw;
}
catch (Exception ex)
{
ExceptionManager.HandleException(ex);
Transaction.Current.Rollback();
//throw;
}
}
}
}

Below is config entries.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netMsmqBinding>
<binding name="DLQServiceBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" deadLetterQueue="Custom" customDeadLetterQueue ="net.msmq://localhost/private/FDPDLQ"
durable="true" exactlyOnce="true" maxReceivedMessageSize="65536"
maxRetryCycles="2" receiveErrorHandling="Fault" receiveRetryCount="5"
retryCycleDelay="00:30:00" timeToLive="00:01:00" useSourceJournal="false"
useMsmqTracing="false" queueTransferProtocol="Native" maxBufferPoolSize="524288"
useActiveDirectory="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport msmqAuthenticationMode="WindowsDomain" msmqEncryptionAlgorithm="RC4Stream"
msmqProtectionLevel="Sign" msmqSecureHashAlgorithm="Sha1" />
<message clientCredentialType="Windows" />
</security>
<!--deadLetterQueue="System">-->
</binding>
<binding name="DefaultBinding" >
<security mode="None" />
</binding>
<binding name="FDService_EP" closeTimeout="00:01:00" openTimeout="00:01:00" deadLetterQueue="Custom" customDeadLetterQueue ="net.msmq://localhost/private/FDPDLQ"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
durable="true" exactlyOnce="true" maxReceivedMessageSize="65536"
maxRetryCycles="2" receiveErrorHandling="Fault" receiveRetryCount="5"
retryCycleDelay="00:30:00" timeToLive="00:01:00" useSourceJournal="false"
useMsmqTracing="false" queueTransferProtocol="Native" maxBufferPoolSize="524288"
useActiveDirectory="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport msmqAuthenticationMode="WindowsDomain" msmqEncryptionAlgorithm="RC4Stream"
msmqProtectionLevel="Sign" msmqSecureHashAlgorithm="Sha1" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="FDChecking_EP" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" deadLetterQueue="System"
durable="true" exactlyOnce="true" maxReceivedMessageSize="65536"
maxRetryCycles="2" receiveErrorHandling="Fault" receiveRetryCount="5"
retryCycleDelay="00:30:00" timeToLive="1.00:00:00" useSourceJournal="false"
useMsmqTracing="false" queueTransferProtocol="Native" maxBufferPoolSize="524288"
useActiveDirectory="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport msmqAuthenticationMode="WindowsDomain" msmqEncryptionAlgorithm="RC4Stream"
msmqProtectionLevel="Sign" msmqSecureHashAlgorithm="Sha1" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netMsmqBinding>
<netNamedPipeBinding>
<binding name="Teletrac.EFX.Interfaces.FDService.IFDPRouter" />
</netNamedPipeBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DLQServiceBehaviour">
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Teletrac.Customer.Services.FDPDLQService.FDPDLQService" >
<endpoint address="net.msmq://localhost/private/FDPDLQ" binding="netMsmqBinding"
contract="FDPServiceRef.IFDService"
bindingConfiguration="DefaultBinding"></endpoint>
</service>
</services>
<client>
<endpoint address="net.msmq://localhost/private/fdmessageQueue"
binding="netMsmqBinding" bindingConfiguration="DLQServiceBinding"
contract="FDPServiceRef.IFDService" name="FDService_EP" />
</client>
</system.serviceModel>
</configuration>

This works great.

But if all endpoints are not available for a long period of time, and if service rolls message back to the DLQ for a long period of time, after a certain period of time service stops picking up messages from DLQ. I am not sure which configuration is responsible for this.

View 2 Replies

Best Practices For Input Validation?

Jul 3, 2010

What is the common practice of input validation? In other words do you check for input validation on client-side, on server-side or on both sides?

Also, if performance is crucial to me, would just the client-side input validation be sufficient for my website without presenting any security risks?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved