|
amjegan wrote: Could someone let me know how we can write this code in .Net?
The application does something.
Your app periodically verifies that it is continuing to do something. If it isn't then send the email.
The specifics of that depends on what the application does.
And if the servers are load balanced and you really want to test each then you need a way to specifically kick off the task in each. So if each responds to some IP trigger then you need a way to independently send that trigger to each. Router/firewall and dns resolution might be involved to get that to work.
|
|
|
|
|
I have created xml file with node element and child elelement. I have created asp.net application using VS2008 and am unable to write to that XML file. Its giving already another process is using. Access dinied.
How to do this.
If anybody knows please reply me.
Thanks in advance.
|
|
|
|
|
Do not post your question in different places.
|
|
|
|
|
If the file is locked by amnother process you can't write to it. It's that simple. You have to wait for the other process to let go of the file.
If the process is the very same one you're writing, well, then you've done something wrong where you didn't close the file. You can't have more than one exclusive writer to the same file.
|
|
|
|
|
NO I have created application that displays a message on desktop always using that XML file and I need to change that XML message so that application keeps message changing on desktop.
how to do that
|
|
|
|
|
By disposing of the StreamWriter perhaps that has the file locked? It's obviously your app that's keeping it locked. That means you're probably not disposing something correctly.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That's not at all what you described.
If the desktop application is only reading the file, then you can open it with a FileStream[^], specifying a Share.ReadWrite, allowing the ASP.NET application to Write to the file.
After you get the FileStream, you pass that object to your Xml reader.
The problem is that while you're reading it, the ASP.NET might write to it at the same time, corrupting the data you read, so you'll have to handle this case.
The ASP.NET code will have to be modified to open the file with Shared Read access so your desktop app can open it at the same time.
|
|
|
|
|
Good explanation.
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Hello guys, I have a prob with my typed DataSet, applying its query on SQL it makes fraction of second, running the program and since the query embedded in the DataSet it gives TIMEOUT!!!!
here is my query:
SELECT i.item_id, i.sequence, i.item_name, od.buy_price, od.sell_price,
SUM(od.quantity) AS sum_qty,
l.location_name, oh.usr_login,
CASE i.is_composite_item WHEN 1 THEN "anything" WHEN 0 THEN "something" END AS remarks
FROM item i, operation_detail od,operation_header oh,location l
WHERE
i.item_id=od.item_id and i.sequence=od.sequence and
od.operation_header_id=oh.operation_header_id and
oh.location_id=l.location_id and
(oh.operation_type_id = "anything") AND
(oh.operation_date >= @date_from ) AND
(oh.operation_date <= @date_to ) AND
(i.item_id >= @item_id_from OR @item_id_from = 0)
AND (i.item_id <= @item_id_to OR @item_id_to = 0)
AND (l.location_id = @location_id OR @location_id = '0')
AND (i.is_raw_item = 0)
GROUP BY i.item_id, i.sequence, i.item_name, l.location_name,
oh.usr_login, od.buy_price, od.sell_price,i.is_composite_item
order by i.item_id, i.sequence,l.location_name
|
|
|
|
|
The fact that it runs under a typed dataset will not make it that much slower. What's your timeout set to? Are you sure you're querying the same database from code as you're executing directly? How much data is there in the resultset?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
nagham_4ng wrote: FROM item i, operation_detail od,operation_header oh,location l
WHERE
i.item_id=od.item_id and i.sequence=od.sequence and
od.operation_header_id=oh.operation_header_id and
oh.location_id=l.location_id and
You should try to avoid this old-style join syntax; use an INNER JOIN instead:
FROM
item As i
INNER JOIN operation_detail As od
ON i.item_id = od.item_id And i.sequence = od.sequence
INNER JOIN operation_header As oh
ON od.operation_header_id = oh.operation_header_id
INNER JOIN location As l
ON oh.location_id = l.location_id
WHERE
...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It didn't work guys, I guess that the prom from the date field but cant figure out how to solve it
|
|
|
|
|
nagham_4ng wrote: I guess that the prom
No, don't guess, verify.
All you've shown is a query; try answering the questions and show us how you load it into a dataset.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Guys can't figure out how will I post the Typed DataSet here, I created a Typed Dataset, right click add new DataTable and than I paste this query, than from my from what I wrote:
TableAdapter.Fill(DataSet.DataTable,datetimepicker1.value,datetimepicker2.value,textbox.value,textbox.value)
|
|
|
|
|
Now I removed the date parameters and no time out anymore, so now am sure that my prob is with the datetime parameter, can anybody help me on this
|
|
|
|
|
There's little one can help with; how much options does the wizard have?
Can you post the query?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, I want to use message queues to send a class, which includes a bitmap. Creating, connecting and sending is no problem and receiving in the same application works just as well. But the same code in an other application throws a "SerializationException"
The code I use for the server application:
private void MainLoad(object sender, EventArgs e)
{
MessageQueue.Create(@"MYPC\MyQueue", false);
MessageQueue queue = new MessageQueue(queueName);
queue.BeginPeek(TimeSpan.FromDays(10.0),messagenumber++, new AsyncCallback(MyPeekCompleted));
}
private void MyPeekCompleted(IAsyncResult asyncResult)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
queue.Formatter = new BinaryMessageFormatter();
System.Messaging.Message msg = queue.Receive(TimeSpan.FromDays(10.0));
Protocol p = (Protocol)msg.Body;
queue.BeginPeek(TimeSpan.FromDays(10.0), messagenumber++, new AsyncCallback(MyPeekCompleted));
}
private void ButtonSendClick(object sender, EventArgs e)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
Bitmap bmp = new Bitmap(@"D:\lena.gif");
Protocol p = new Protocol();
p.text = "test";
p.sender = senderID;
p.receiver = "Client";
p.bitmap = bmp;
System.Messaging.Message m = new System.Messaging.Message(p, new BinaryMessageFormatter());
queue.Send(m);
}
Protocol is a class:
[Serializable()]
public class Protocol
{
public string sender;
public string receiver;
public string text;
public System.Drawing.Image bitmap;
}
The code I use for the client application:
private void MainLoad(object sender, EventArgs e)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
queue.BeginPeek(TimeSpan.FromDays(10.0),messagenumber++, new AsyncCallback(MyPeekCompleted));
}
private void MyPeekCompleted(IAsyncResult asyncResult)
{
MessageQueue queue = new MessageQueue(@"MYPC\MyQueue");
queue.Formatter = new BinaryMessageFormatter();
System.Messaging.Message msg = queue.Receive(TimeSpan.FromSeconds(10.0));
Protocol p = (Protocol)msg.Body;
queue.BeginPeek(TimeSpan.FromDays(10.0), messagenumber++, new AsyncCallback(MyPeekCompleted));
}
modified 4-Jul-13 4:51am.
|
|
|
|
|
A colleague of mine solved it today, if the protocol is in a DLL, there no problem anymore.
|
|
|
|
|
I want to know how to connect in LAN and use the Message Queue to send messaged to the connected Pcs. I am working in C# language and OS is Win 7.
|
|
|
|
|
Well, the ?NET framework has this[^] available.
|
|
|
|
|
Thanks for the article. And you should respect elders ! It will be good for you.
|
|
|
|
|
You're welcome. Any the elders bit was a joke about how old I am.
|
|
|
|
|
Hi everybody,
I have a user control that has a webbrowser in it. I've used a user control to see where to put controls on an html form.Everything is great except the fact that I can't move (drag and drop) controls like textbox and datagrid over this user control and it is making this hard to place controls in their right position.
Please help me solve this issue,
Thanks.
P.S : I am using Windows Forms Application
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I wanted to have a spirited discussion on a valid use case for screen size dependent forms design. I'd like to make it clear though, I'd love an alternative that fits my use case and is size independent.
So, here it goes:
Use Case
I develop applications for use in industrial control systems. The point of these screens is to place as much relevant information on a single display as possible while not overcrowding the display. This often includes piping diagrams, large gauges (as to be read from a distance or at a glance). The screen sizes are usually fixed at around 21" or 23" (widescreen is just breaking in) and are touch screen only (no keyboards).
Case for Big Screens
I really would love to discuss with developers who make blanket statements about big screens mean you are doing something wrong.
Here is an example screen
The above screen is a sample, the requirement is to show everything related to the pits on one screen so that while the operator is doing a particular operation they do not have to switch screens to see any of the data. The screen is actually from an HMI designer that I use (and designed) that uses Windows Forms as the back-end.
Now, knowing that we have:
1: A fixed screen size.
2: A product that we control what it runs on (we also provide the screens/computers)
3: Requirement from the user about what is shown.
4: Winforms back-end.
5: The designer does not have access to the code (HMI designers are NOT programmers, so they are not given or expected to write code, they just place stuff on the display and tie it to external devices through a binding interface).
How could we make this size independent? This is why, at least for me, Windows Forms limitation of 12px over the designer screen resolution is a PITA. Our field engineers making changes to screens typically use laptops to edit screens that run on 23" monitors, so every time they open a screen, WF graciously resizes them (thanks MS!).
Use for MDI
Aside from the system running full screen (we don't want the user to be able to access the desktop), we use an MDI window in the background to make sure that all the screens stay on the display they are assigned to. The application can be assigned to run on a certain display and we don't want the user to change that. So we use MDI as the container for the windows so that even if the form has a title bar, the user cannot drag them outside of the screen.
If somebody has a really cool way of doing what I need I'm all ears, but I think we should all stop assuming that because somebody says they need the screen bigger that they are doing it wrong fundamentally, since we don't fully understand the use case...
|
|
|
|
|
I also work a lot at industrial automation. Unfortunately, there are a lot of bad trends in UI in the industry, and the fixed or fluid design is one of the pain points.
Often, developers don't understand specific needs of the people working in the industry. From the other hand, many of their "requirements" are just the ridiculous artifact of their inertial of thinking and bad habits inadequate to computing, such as the habit to work with the old-time devices. This week, I work with oscilloscopes which themselves run Windows 7.
One especially ridiculous trend it to imitate old analog gauges and scales, with all kinds of shadows and destructing highlights, where a simple numeric display could do the best. I cannot understand vanity of those people, such efforts look miserable to me. There is a trend to use two buttons for on and off, where a check box is the most compact and intuitive.
At the same time, it would be wrong to make bold generalization. In particular, it is important to see a difference between different types of UI, in two aspects: purpose and... touch screen vs. keyboard/mouse.
People cannot do UI for touch screen, face it. Windows and other general-purpose Windowed systems don't provide adequate support. People cannot nicely point a close box with a finger (even with keyboard/mouse, hitting it with a mouse is a mouse is a bad habit which causes fatigue, irritation and poor performance).
One important thing to understand: people use their motoric memory. The body remembers where to click. But this is so only with well-designed touch screen and is not quite applicable to keyboard interface, where fluid design can prevail.
One thing is most certainly failing in usability: MDI. It should be exterminated from everywhere by all means. Microsoft is trying hard to phase it out, for some good reasons. The second thing to get rid of is multiple windows interface. I don't count some modal dialogs, but only if there are not too many of them, and only when the modality is really well motivated, not just by the simplicity of development.
—SA
Sergey A Kryukov
|
|
|
|
|