|
sounds like it might be a rich text box problem to me. I only tried to use them once and found them too tricky for what i needed.
add a multiline textbox to your form and try putting the data in that just to check that all the logic is working.
Russ
|
|
|
|
|
Yep!
Thank you for responding. You are great. Actually I have already found where the problem was. I passed the array refence not the actual column name. I changed the dr[0] to dr["columnname"] and it poped up every row that meets the if statement conditon. And in the System.Convert.ToInt32 i changed that to ToInt16 and the condition wokrs fine. However I will aging write if I have a problem because I have to test for many columns against others.
Once agin
Thank you.
phokojoe
|
|
|
|
|
hi everyone!
I have a problem relating to Windows Services and FileSystemWatcherClass of .NET using c#.
I developed a windows service to monitor a specific folder on a server for changes and maintains its updated back up in another folder.
FileSystemWatcherClass is inherited to monitor and create mirror of a folder. It is available at http://www.codeproject.com/cs/files/directorymirror.asp?msg=1801877.
However, I found a limitation of this application. When copying large data (10 – 15 MB) it misses many events and only copies about half of the data. (This problem is also referred in the comments of the above article).
Possible cause of the problem:
When you copy or drop large amounts of data somewhere it can take several seconds for the system to write the data to the disk. The system cannot send feedback about the status of the operation (completed, failed, queued, etc) while it is performing it or while it is queued, and during this time other requests to the file system are queued by the system. This is what I think is the source of the problem: The FileSystemWatcher has no patience and throws an exception if it doesn’t get an IMMEDIATE response from the file system. So any big operation that takes a bit of time will end up throwing an exception and often but not always, cause the operation to abort. This class seems to be completely ignorant of how the windows file system works.
I found a solution to that on msdn, that says increase the INTERNALBUFFERSIZE. The Windows operating system notifies your component of file changes in a buffer created by the FileSystemWatcher. If there are many changes in a short time, the buffer can overflow. This causes the component to lose track of changes in the directory, and it will only provide blanket notification.
This solution resolved the problem somehow. I increased buffer to 64KB (default is 8192 bytes). This successfully copied data up to 35MB without missing a single file and suffices to my needs.
The problem is, when I integrated this into a Windows Service, it all failed to copy even 3 – 4 MB of Data. I have searching a lot but haven’t found the right solution yet.
I would be grateful if somebody could help me out with that. Thanks a lot for your patience of reading a long mail.
regards,
Fayyaz Khan Lodhi
fayyaz.lodhi@confiz.com
|
|
|
|
|
hi,
I have file1.xml (with more no.of tags, no repetition), and i need to search/extract the value for the given 'tag' ,
I use c# for coding,,, can i use dataset/xsd concept and readxml method.
And in some cases after retrieving the searched value i have to modify and save it back
(the task is to work on edi-documents)
Could u anybody please help me to solve this
|
|
|
|
|
Hi Plz use the below code for loading the file
doc.Load("E:\\C#\\ongoing project\\Chapter 21\\BellRingers.xml");
place your editing code here such as attribute editing value retrieving for example
private string getTowerName(XmlTextReader reader)
{
if (!reader.Name.Equals("tower"))
{
throw new Exception("Wrong type of data - expected a bell tower");
}
reader.MoveToAttribute(0); // Should be the tower name
return reader.Value;
}
and the below will then save the file
XmlTextWriter tr = new XmlTextWriter("E:\\C#\\ongoing project\\Chapter 21\\anewBellRingers.xml", null);
tr.Formatting = Formatting.Indented;
doc.WriteContentTo(tr);
tr.Close();
SAS
|
|
|
|
|
XmlDocument will help you do the job.
SkyWalker
|
|
|
|
|
Hi All i made an application ca someone please help me in making exe file of that
SAS
|
|
|
|
|
just build your project (or press F6) and you will see under bin/debug folder executable file
|
|
|
|
|
if i copy the exe from the debug folder in sme other system wil it work
SAS
|
|
|
|
|
if your project doesnt require any other file(like dll, txt file, etc) and if copied computer has .net framework(releated to your project) probably it will work. but i advice you make setup project of it
|
|
|
|
|
How To make a setup project if i make setup project then if installed in some other pc will it require framework 2.0 and if it have some additional dlls and classes plz explain thanx & regards
SAS
|
|
|
|
|
1- if you make a setup project or not, other pc will require framework when you start the program it hasnt your program wont run!
if you want to make a setup project follow the related link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbtskCreatingOrAddingSetupProject.asp
while you making setup project you can add you additional files. Also if other pc doesnt have framework it will you give a warning (there is no framework before installion) and give a link to microsoft framework download side, you can connect this side, or you can add framework to your setup project. (If you have framework installation file) if you have not, download it from microsoft. i hope that good for you
|
|
|
|
|
Under the debug folder you will also find the dll files of your dependencies and projects in your solution. All those files need to be on the target machine that you want to run your program from.
If you want to create a single exe that does the actual installation of the program (i.e. copy all the needed dll files onto the target machine you need to create a deployment project if you are using Visual Studio, otherwise you will need to get an external installer program which will package it all into a single exe file.)
If you are developing on the .Net framework you need to make sure that the target machine has the correct version of the framework installed.
He who laughs last is a bit on the slow side
|
|
|
|
|
What about csc yourcs.cs in the simplest case?
Type csc /? from your command line and see a lot more!
SkyWalker
|
|
|
|
|
I should point out, if you have made an application, you must have compiled the app, in order for it to run. This means you have already created the exe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It's not in debug it's in release folder... at least in express ed.
|
|
|
|
|
debug or release folder is depending on debugging options.
on visual studio debug is default
|
|
|
|
|
I have the following block of code
if( (nDecisionDate.CompareTo(timePickFrom.Value) >= 0) &&
(nDecisionDate.CompareTo(timePickTo.Value) <= 0)
)
{
//processing here
}
nDecisionDate is a DateTime type while timePickFrom is of type System.Windows.Forms.DateTimePicker. The code compiles and runs but it misses to go inside the block whenever nDecisionDate is equal to the beginning of the inclusive dates (i.e. the = in >=). What is the best way to compare a DateTime type to a DateTimePicker from a calendar tool?
it might be worth noting that nDecisionDate is a DateTime type that was cast from a string class which was from a sql resultset which is of type DateTime.
Thank you in advance.
|
|
|
|
|
You can subtract a DateTime from another and get a timespan. Also, you may find that this fails because the days are equal, but the times are not as you'd hoped.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Are you comparing both date *and* time components of the DateTime instances, or just the date component? That is, is nDecisionDate initialized from something like "01/04/2007" or "01/04/2007 09:37:55"? If you're only comparing the dates (as opposed to the date and time), your values in your DateTimePicker instances may have different time components than your decision instance, thereby making the comparison fail for seemingly equal values (when viewed at the date level of granularity).
-Phil
|
|
|
|
|
You can compare just the date part of a datetime object as below.
DateTime dt1 = new DateTime(2007, 01, 10, 9, 0, 0);<br />
DateTime dt2 = new DateTime(2007, 01, 10, 9, 0, 1);<br />
Console.WriteLine("datetime compare: " + (dt1.CompareTo(dt2) >= 0).ToString());<br />
Console.WriteLine("date compare: " + (dt1.Date.CompareTo(dt2.Date) >= 0).ToString());
Russ
|
|
|
|
|
I want to have CPU usage for my application in %. I am using PerformanceCounter, sometime it give values greater than 100. I need CPU usage on a scale of 0-100 like we see it in task manager.
I am using it like this..
Process testProcess = Process.GetCurrentProcess();
PerformanceCounter cpuPerformance = new PerformanceCounter("Process", "% Processor Time", testProcess.ProcessName);
while(true)
{
// some staements
double cpuUsage = cpuPerformance.NextValue();
//some statements
}
Thanks in advance
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
Are you seeing this on a dual-processor or dual-core processor (or maybe even a hyper-threaded processor) machine? I seem to recall reading that CPU utilization for an individual process can sometimes be greater than 100% because of threads within the process being executed simultaneously across multiple processors/cores. I could be completely wrong about that, though.
-Phil
|
|
|
|
|
i,m using c#2005 and sqlexpress.
in my projects i use separate class for db connection and call that on project.
there i use connection string as
ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database\\stock.mdf;Integrated Security=True;User Instance=True";
as i understand this db created on project location and it attached to sql server when project(or build exe) running. after successfully build project i could see db had attached to server as "D:\Equipmanager\Equipmanager\bin\Debug\Database\stock.mdf"
everything ok.db connection works fine.
but problem comes when i start reports.
there i tried on ADO.net and OLE DB.but wizard shows only default dbs.master etc....(actually my project db attached to server when running.show how it show there?)
here's my problem...
1. can i use this connection string...is there any problem...
2. how to use project db for reporting(use crystal report)..?should i attached db manually and do report?
if i use sql 2000 this problem ok.because there every db is attached and not separate file.
currently i get db details by code and pass those to report(actually this connection string fine.because when deploying db is automatically attached.no need to do it manually)
but passing parameter is not good when long report.that's why i want to find way connect db to report?
|
|
|
|
|
did you try copy your mdf file to near of other standard mdf file, maybe it can checks constant path
|
|
|
|