|
Sounds like a Queue<Request> , with a loop handling a request. Execute the method that handles the request async, wait until it returns or two minutes pass. When done, fetch next and repeat.
amjegan wrote: all request will get a response in two mins and only one service hit will happen. Not if it works as you described; if there's three items in the pipeline that will timeout, total waiting-time for the next request will be >6 minutes.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
amjegan wrote: Now I want a technique where first request will acquire lock and get the
response. All the other request should be waiting for this and once first
request release the lock, this response should be assigned to all other pending
request (as the output response will be same) and make them all released at the
same time.So ultimately, all request will get a response in two mins and only
one service hit will happen.
And then what happens in the following scenario?
- First request times out.
- Second request succeeds.
|
|
|
|
|
We don't worry about whether it succeed or failed as the data we are pulling is not affect the mainstream of the application. Application can still be running. Only thing is it should not be waited long time to get response. Thanks!
Cheers
A.M.Jegan
|
|
|
|
|
Have you considered reducing the timeout significantly.
|
|
|
|
|
Hi,
I want to read data from MMF File in c#.net framework 3.5
|
|
|
|
|
Same question applies to the NSF question, what is an MMF file, if it is a notes specific file then the same answer applies as well.
For any file type that is proprietary you will need to get the format/api from the owner and some types are just not available.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I want to read content from NSF File c#.net framework 3.5.
|
|
|
|
|
you might want to explain
a) what a NSF file is/what produces it and
b) what you've tried so far
|
|
|
|
|
a) A Lotus Notes database .NSF file stores Lotus Notes information. That information consists of user data, metadata and also design information. There are many different types of Lotus Notes databases, the most common being mailbox databases used to store Lotus Notes mail, usually on a Domino server, or address book databases which are usually stored on a users PC and contain multiple contact records.
b) I am still searching
|
|
|
|
|
cool - the obvious answer, is, does Lotus Notes have an API to do this ? or do you need to do it standalone/where Lotus isnt installed, for some (possibly perverse) reason
|
|
|
|
|
Yes, I need stand alone where lotus isn't installed.
|
|
|
|
|
Good Luck! Without the Notes API, you're pretty much screwed because you'll have to parse a LOT of information. Also hampering your efforts will be that some NSF databases can be encrypted and virtually impossible to read without the Notes API and the fact that IBM keeps changing the damn format of the database files further complicating the crap out of what you're trying to do.
About the only document I ever found on the NSF format was here[^].
|
|
|
|
|
Poor bastard - NSF will almost be a proprietary format coming from Notes, probably some flavour of xml, I would approach IBM with a f***ing big gun and see if they have the format/api available as Garth suggested.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I want to Update the particular column...but once i give update only the edited column is present in the database..others are absent..
try
{
con.Open();
String q3 = "update testreport set patientname='" + textBox2.Text + "',address='" + textBox3.Text + "',testreports='" +textBox5.Text + "',reportno='" + textBox6.Text + "',date='" + dateTimePicker1.Value.ToString("dd-MMM-yyyy") + "',takentest='" + textBox4.Text + "'where patientid='" + textBox1.Text + "' ";
cmd = new SqlCommand(q3, con);
cmd.ExecuteNonQuery();
MessageBox.Show("details updated successfully");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "details not updated");
}
con.Close();
|
|
|
|
|
Start by fixing the SQL Injection[^] vulnerability in your code.
using (var con = new SqlConnection("<YOUR CONNECTION STRING HERE>"))
using (var cmd = new SqlCommand("update testreport set patientname = @patientname, address = @address, testreports = @testreports, reportno = @reportno, date = @date, takentest = @takentest where patientid = @patientid", con))
{
cmd.Parameters.AddWithValue("@patientname", textBox2.Text);
cmd.Parameters.AddWithValue("@address", textBox3.Text);
cmd.Parameters.AddWithValue("@testreports", textBox5.Text);
cmd.Parameters.AddWithValue("@reportno", textBox6.Text);
cmd.Parameters.AddWithValue("@date", dateTimePicker1.Value);
cmd.Parameters.AddWithValue("@takentest", textBox4.Text);
cmd.Parameters.AddWithValue("@patientid", textBox1.Text);
con.Open();
cmd.ExecuteNonQuery();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Handle the OnTextChanged event of your textboxes to save wath field was changed and build the update string based on this data.
|
|
|
|
|
Better yet, don't do updates; do versioning instead. Updates are code smell.
And definitely use a parameterized query as Richard demonstrates.
|
|
|
|
|
Why do you care which field was changed, presumably you populate the control with the existing data and therefore you are just writing back the same information. Save the entire record!
Implement and audit system that records the before and after of each field.
And fix the sql injection exposure highlighted by Richard!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello
I want to find a way to control video files in my C# application. I want to open video files of various formats and then control them in frame level, going forward\backward few frames, jumping to an specific frame and things related. Thus far I haven't been able to find anything useful. Also I don't want any additional components being shown in my application (like the Windows Media Player COM). Also video scaling is needed.
Thanks in advance
|
|
|
|
|
Look at ffmpeg[^], OpenCV[^] etc. Not sure if there is a C# port available. But it won't be hard to call these libraries from C#.
|
|
|
|
|
http://www.c-sharpcorner.com/uploadfile/mgold/playingvideo11242005002218am/playingvideo.aspx?articleid=3d1c3b81-1a12-48e7-ad5e-758f96525409
i think this one is useful for you just refer it
|
|
|
|
|
Hi Team, i have aspx page with code behind in c#,the page has checkbox list which gets pulled dynamically(not static checkbox list), now my concern is once i do the check/uncheck of checkboxes and if i left mouse button then callback is happening which is not required i have verified the code base and there is no activation of callback event from code, check box unselect/selection is fine but if you click left mouse button on any part of the aspx page callback is happening which i dont want to happen.
i do not want to raise callback event if i do mouse click on the form, i tried different options to prevent but could not succeed, can some one guide on this
Thanks
msr
|
|
|
|
|
|
are you put postback property "true" for that control? I am not getting how these been made
|
|
|
|
|
I have a C# 2010 desktop application where I have code setup to see if a user is a member of an active directory group. I am using WindowsIdentity to check the current users active directory group level. The following code is not working. Thus can you tell me how to what is wrong with the code below?
If you think the code listed below will not work, can you tell me how you would modify the code listed below?
If you do no see anything wrong, can you tell me what to suggest to the network people at my company to suggest to them what is wrong?
using ActiveDirectoryCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Collections.Specialized;
using System.Deployment.Application;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.Remoting;
using System.IO;
using System.Web;
using System.Configuration;
ConfigurationManager.Appsettings in the app.config file
using System.Security.Principal;
using System.Threading;
namespace File_Reject
{
static class Program
{
internal static ActiveDirectoryUser CurUser;
[STAThread]
static void Main()
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
CurUser = new ActiveDirectoryUser();
if
(!Thread.CurrentPrincipal.IsInRole(Environment.UserDomainName + "\\" + ConfigurationManager.AppSettings["role_File_Upload"]))
{
MessageBox.Show("You do not have authortity to access File Transfer. Please contact your network administrator if you have any
questions.", "File Transfer Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Application.Run(new FileReject());
}
catch (Exception e)
{
}
}
}
}
----------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Reflection;
using System.IO;
using System.Threading;
using System.Web;
using System.Windows.Forms;
using System.Security.Principal;
namespace ActiveDirectoryCommon
{
public class ActiveDirectoryUser
{
public ActiveDirectoryUser()
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
}
}
}
-----------
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="role_File_Upload" value="File_Upload" />
</appSettings>
</configuration>
------------
|
|
|
|