|
I have an application that starts a commandline program to transfer some files. When I start the process a DOS box pops up and the output is displayed in it. When the process is done the window closes. The problem is that if the process exits very quickly (which usually happens when an error occurs) the user doesn't get to see what happened. So, I tried redirecting the StandardError to a string (using ReadToEnd) and then have a popup appear when the process is done if the string isn't empty. That works, but it also kills the StandardOutput (even though I told it NOT to redirect it) and my application hangs up until the process has finished (which it didn't do when I didn't redirect the stderr). I tried redirecting the output too, but again I can't get at it until the process has quit which could leave the user staring at a blank screen until the transfer is done (which could be a long time!). Is there a way to get at the stdout and stderr without hanging the application up?
|
|
|
|
|
I want to change a web application's web.config in its setup project
how can I get the directory of it installed when I run the setup project?
|
|
|
|
|
Hi,
I'm trying to create a 2D graph in c# by plotting the dots within a PictureBox control. The thing is that when I'm using a loop for drawing the dots (by FillEllipse method), in the OnPaint event of the PictureBox, there is a vertical strip in the client area, next the left side, that hides the dots. It's about a week I'm dealing with this crap and the hammer is already in my hand. Have you got the answer why is it happening ? (not the hammer but the strip). Beyond that, I wonder whether there is some method that generate graphs automatically.
regards
|
|
|
|
|
Hello,
I was wondering: if there is a possible code to look for a directory and then open it by displaying all the files in the directory in checkboxes, then copy the checked files to the server
I will appreciate the help a lot
Nisrine
nisrinee51@hotmail.com
|
|
|
|
|
1/ Create a checklistbox to display checkboxes + strings
2/ OpenFileDialog to open a dialog
3/ Directory.GetFiles to list all files of a directory
4/ File.Copy to copy files.
|
|
|
|
|
the openfiledialog opens the file only not the directory
how can I get it to open the directory where the files are listed???
Thanks
Nisrine
|
|
|
|
|
Use a FolderBrowserDialog instead (NB: This is only available with the .NET 1.1).
|
|
|
|
|
Hi,
i would like to draw checkbox and radio buttons theme aware, 'cause of that i can't use static bitmaps of checkbox and radio button. The class ControlPaint provide methods to to that, but i like to draw the content to a image, that i can put in a imagelist, how to draw into a image ?
.:[Greetz from Jerry Maguire]:.
|
|
|
|
|
Hi. A philosophical question cooncerning concurrency: Optimistic/Pessimistic/Last-Win
I understand the difference among the three options. It's well explained in MSDN:
Reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskperformingoptimisticconcurrencychecking.asp
But I can't quite relate the three options to real life situations - so, examples welcomed. Anyway, for my experience, "Last-Win", and "Pessimistic", concurrency is sufficient for most circumstances I encountered. When do we need optimistic concurrency?
Thanks!
norm
|
|
|
|
|
If I understand the three correctly:
Pessimistic concurrency control - a row is unavailable to users from the time the record is fetched until it is updated in the database.
Doesn't this mean that there's an assumption that the record is being fetched so that it can be updated? That would imply that during the time the client is hanging on to the record, nothing else can get done? Or is this referring only to the "fetch-change-put" time of the server, say, when an UPDATE command is executed? And isn't this method not really very usable in situations where the records are fetched and the connection closed? These assumptions would seem to be correct based on what the site says.
It's funny they use inventory as an example. I've written an inventory management system that uses optimistic concurrency. The connection is always open, and the only time there's violation is when someone is updating a record that is simultaneously being accessed. This hardly ever happens. 90% or more of the transactions are fetches--part look up, reporting, price lookup, qty look up, etc. Only when a part is received or sold is there a write transaction.
It would be impossible for me to run this system in a pessimistic mode, because records are always being fetched on a continuously open connection. And they're being fetched simply for read, not update, purposes.
Does that help, or am I misunderstanding something?
Marc
Latest AAL Article
My blog
Join my forum!
|
|
|
|
|
How about an airlines telling you that you can get a seat NOW, but then when you actually try it a second later they say someone's already taken it?
|
|
|
|
|
Thanks for the response first of all. Makes sense and I think the concept is beginning to sink in and take hold a little more.
Now, responding to saikatsen:
"How about an airlines telling you that you can get a seat NOW, but then when you actually try it a second later they say someone's already taken it? "
In that case:
1. Check for seat: "Last Win"
2. Book a seat: "pessimistic concurrency"
norm
|
|
|
|
|
Hi there!
I'm new at .Net, and as I can see ADO.NET Does Not Depend On Continuously Live Connections. So how can I implement an Client-Server architecture?
Imagine 2 clients updating the same record, theres a problem! Or not?
Thanks a lot.
<-- www.tiltxxi.com -->
|
|
|
|
|
You are not required to close the DB connection ... the fact that most ADO examples show that you should (1) open the DB, (2) set-up your objects, (3) do your query,update,insert,delete (4) close the DB connection ... does not mean you HAVE to do it that way ...
You can open a DB connection and keep it open, there's nothing that says you cannot do this.
Either way, true Client/Server means most, if not all, of your core logic exists server-side as Stored Procs, Triggers, Views (this is open to interpretation, I'm just trying to keep it simple).
ADO is primaryily a Web based technology; at least, that seems to have been the primary focus by M$ behind ADO ... You can always use an OleDB connection and skip using ADO altogether.
Just my two cents on this matter,
D.
|
|
|
|
|
If two clients are updating the same record, then either:
1/ the order in which they update does not matter, or
2/ the order in which they update does matter - to the system.
The first case is trivial. In the second case, the clients will have to communicate somehow between them to schedule who goes first and how the first guy tells the second when to go. That could be through any standard IPC mechanism.
A record, after being fetched, is not locked for any purpose for any duration; even if you fetched it for the purpose of updating it.
|
|
|
|
|
I'm going to need my application to be able to copy files to a unix machine using SCP. Previously we have used the command line program pscp that is part of Putty[^] and had the application open putty and send it commands to do the copying. However, this is far from an ideal solution and I was wondering if anybody here had any better ideas. Does anybody know if there is an easy to use dll that I could intergrate into my application? Or failing that does anybody know how to run a console application without having to opening a console window for the user to see?
Thanks
|
|
|
|
|
Can anyone help me on this. I'm trying to send a string array from a server program to a client program.
|
|
|
|
|
Create a BinaryFormatter and serialize the object into the stream associated with the socket eg:
BinaryFormatter oFormatter = new BinaryFormatter();<br />
oFormatter.Serialize(oNetworkStream, (object)aStringArray);
and on the receiving end, just do the reverse
BinaryFormatter oFormatter = new BinaryFormatter();<br />
aStringArray = (string []) oFormatter.Deserialize(oNetworkStream)
I personally think, this is probably the most powerfull feature of .NET the serialization functions are excellent, they can save you a hell of a lot of effort.
James Simpson
Web Developer
imebgo@hotmail.com
|
|
|
|
|
|
Hi. I am using the System.DateTime.Parse command on a dateType, as I want it to be recognised as a date, however, I also want to display it. The problem is it contains the date and time, where I just want the date.
eg:
Displays: 21/09/2003 00:00:00
I want: 21/09/2003
Any ideas?
|
|
|
|
|
You can use two methods of the DateTime type to get the date only.
MyDate.ToLongDateString();
MyDate.ToShortDateString();
Of course, the format of the returned strings depends on your regional settings.
Nick van der Plas
|
|
|
|
|
I need to make a new crystal report at runtime!
So I make new instance of crystal report wich has only title and datetime fileds.
So I need to add columns and datasource to it. But how I do not know!
is there any way how to add datafields to report?
there is only a method for setting datasource.
Can anyone help me out?
thanx a lot
|
|
|
|
|
You'll want to start by creating a data schema for your data source and adding this too your project. You can do this by either using datasource.WriteXmlSchema(<filename>) or by hand.
Once you have the schema in your project go into you report and right click anywhere on it and select Database->Add/Remove Database. You should see your dataset under Project data-> ADO .NET datasets. Now all of the tables and fields from that dataset should be added to the Field explorer in the report, go ahead and drag them on too the report.
Once you have laid out your report you can use the following code to assign the dataset too it:
MyReport oRpt = New MyReport
oRpt.SetDataSource(mydataset)
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.ShowGroupTreeButton = False
CrystalReportViewer1.ReportSource = oRpt
|
|
|
|
|
oops...forgot I was in the C# forum. The above code is in vb .net, if you need any help converting it, let me know.
|
|
|
|
|
No, the thing is that I do not know what kind of table I will use in advance. What I need is application that gets a dataset with one table that need to reported! So I do not know how to build a report from a scratch. I know how to set a datasource for report but how to add columns (fields) to it I do not know! Of course if it is possible at all.
|
|
|
|