|
Just be sure it's not the result of conditional compilation. Though even then it should be written so as not to produce a warning.
|
|
|
|
|
Yes, our site originally had over 100 compiler warnings when you build. I consider that a Bad Thing. I've got it down to 23 at the moment, but I want to get it down to zero. Warnings are the computer telling you that something stupid is going on, not a broken something stupid, but still something stupid, and in most cases you just delete the thing, or code it a different way and it's functionally equivalent, but doesn't cause the warning. The break after a return statement is a good example... not having the break eliminates the warning, the break isn't necessary, and it's probably just there because somebody was told to put breaks in their switch/case blocks and was never told what it actually does.
|
|
|
|
|
Good Afternoon
I have been using vb.net am i recently moved to C# and thanks to codeProject am comming alright. now in vb.net we had Events ready generated for us on controls like button, when you double click on the button, on the right hand side you could select the events like "keypress", but vs on C# does nto have that.How is it done in C#, do i have to code the events myself?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Not at all. Click the control in the designer to select it, press F4 (usually) for properties. Find the little lightning strike button, this shows you all the events on the control. Double click next to one to automatically insert the handler.
Regards,
Rob Philpott.
|
|
|
|
|
Thanks man
it works
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You can double click on a control, like a button, and the default event, Click in this case, will be automatically created for you.
only two letters away from being an asset
|
|
|
|
|
Thank you very much
it works
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Say, I have 1000 different coordinate points which are totally scattered. Please give me some suggestions regarding how to find out the outer envelope area of those plotted points. Please provide me any link or sample project. Any suggestion on the algorithm would be helpful too.
Thanks in advance...
Faysal
|
|
|
|
|
Interesting problem. When you talk about the outer envelope - is this the smallest shape that contains all the points?
And when you say area - do you mean area (as measured in square centimetres say) or just the subset of points which define it?
Regards,
Rob Philpott.
|
|
|
|
|
|
Sorry, how is it related to the envelope area?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Because the envelope would be the shape bounded by the leaves of the tree.
|
|
|
|
|
What you want is the complex hull[^]
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
I am trying to add a database created in SQL Server Management Studio Express to a C# express application.
The data source is "Microsoft SQL Server Database File (SqlClient)"
The data provider is ".Net Framework data provider for SQL Server
I browse to the database and get a "The file is in use" error.
Visual C# 2008 Express Edition is the only application open.
What am I doing wrong?
Butch
|
|
|
|
|
Hi,
For developing a windows application that must work on a LAN, one way is common developing of it and sharing ConnectionString (i.e. ConnectionString be the IP address of Computer that SQL Server is installed on it).
Is there any other way? if yes, is it better?
Best wishes
|
|
|
|
|
Depends on what you want to do. If your application is a quick and dirty bodge and all the computers can access Sql Server direct on the LAN you can do this. You'd want to make sure you use Windows Authentication rather than SQL authentication mind for security reasons. I should stress it's not recommended on a quality basis though.
If you want to make a quality solution, you should look at abstracting the database away from the client computer by using an N-Tier architecture. http://en.wikipedia.org/wiki/Multitier_architecture[^]
Regards,
Rob Philpott.
|
|
|
|
|
Your question(s) made no sense.
|
|
|
|
|
I'm trying to set up a service with a class that make use of the FileSystemWatcher, is not working for some strange reason, basically I set up the FSW set an event handler and run the Service.
Now if I test the Class on a normal executable, once it passes through the FSW code the executable ends I had to put a while loop that will keep the executable running and that way it works perfectly, but the while loop takes too much processing when program is not doing anything, so I can't really put it on the service.
Another thing that I noticed when running the Service is that the event handler calls a method that actually calls an outside process but this process stays in memory and never gets out, I can see it in the task manager. The following code is the one I'm using for the Service:
class Watcher
{
const string DIRECTORY_TO_LISTEN = @"c:\tmp";
const string SFTP_SENDER = @"pscp.exe";
const string SFTP_SERVER = @"192.168.0.59";
const string SFTP_USER = "john";
const string SFTP_PASSWORD = "smith";
const string SFTP_LOCATION = @"/home/john/";
public bool ContinueRunning {get; set;}
public void Run()
{
try {
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = DIRECTORY_TO_LISTEN;
watcher.Created += new FileSystemEventHandler(OnFileCreated);
watcher.EnableRaisingEvents = true;
while (ContinueRunning)
{
System.Threading.Thread.Sleep(15000);
}
} catch (Exception ex) {
new Logger(ex.Message,"ezWatcher");//Logs Event viewer.
}
}
private void OnFileCreated(object source, FileSystemEventArgs e)
{
string output;
string args = String.Format("-sftp -pw {0} -batch {1} {2}@{3}:{4}{5}",
SFTP_PASSWORD,
e.FullPath,
SFTP_USER,
SFTP_SERVER,
SFTP_LOCATION,
e.Name);
Process proc = new Process();
try {
proc.EnableRaisingEvents = true;
proc.StartInfo.FileName = SFTP_SENDER;
proc.StartInfo.Arguments = args;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
output = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
proc_Exited(proc.ExitCode,e.Name,output);
} catch (Exception ex) {
new Logger(ex.Message, "SFTPWatcher");//Logs Event viewer.
}
}
private void proc_Exited(int result, string fileName, string output)
{
try {
new Logger(result + " " + fileName + " " + output, "ezWatcher");
SqlConnection conn =
new SqlConnection("Data Source=someServer;Initial Catalog=someDB;Persist Security Info=True;User ID=someUser;Password=somePass");
string query = String.Format("INSERT INTO SFTPWatcher SELECT [filename] = '{0}', [output] = '{1}', [result] = '{2}'", fileName, output, result.ToString());
SqlCommand cmd = new SqlCommand(query, conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
} catch (Exception ex) {
new Logger(ex.ToString(), "SFTPWatcher"); //Logs Event viewer.
}
}
The calling code is:
protected override void OnStart(string[] args)
{
base.OnStart(args);
Thread process;
Watcher watch = new Watcher();
watch.ContinueRunning = true;
process = new Thread(new ThreadStart(watch.Run));
process.Start();
}
So if anyone show light on this will be appreciated.
Thank you.
|
|
|
|
|
Hi ,
i am able to create static crystal reports , but i want to create reports based on user input. I have to provide UI to select between two dates and some other options .
i want to get data from databse (sql 2005) based on these query ...
can any one suggest me how can i do : this (samples or Links )
Thanks
csn.
|
|
|
|
|
That thing will depend upon the version of Crystal Report you are using. In Crystal report 11, the method is, go to "Field Explorer". you have the option "Parameter Fields". Create a new parameter with datatype date time. for eg. "Startdate" & "EndDate". Now go to menu Report --> Select Expert. It will ask you to select the field. Assuming that the field you have to use is "DateofBirth", select this field.
Now a window will open & it will ask you for selecting a option, as for date, you will select "is between", then it will ask you the two values. Select the parameter field you have created earlier & click ok its done. Now see the preview it will ask you for input parameters.
Good luck
|
|
|
|
|
Hi ,
Thnaks for you reply ..., i will try this ...
|
|
|
|
|
You need to create parameters in crystal report. Google Push and Pull method in ASP.NET with Crystal Report.
Cheers
Anoop
|
|
|
|
|
Hi,
I would like to compare 2 instances of List < Point > which meet following specification.
<br />
- both lists contain uneven count of random Points (List < Point > )<br />
- special method evaluates two points (bool MatchPoints(ref Point p1, ref Point p2); )<br />
- there is no similarity in points in those lists. They can be perfectly similar or they can have no points in commmon at all.<br />
- it is possible to do whatever processing (hashing etc...) of those lists when created, because they won't change much (if at all) after created. <br />
- result should be saying percentage of points that match from all evaluated points<br />
- there will be up to 1000 points approx in a single list. <br />
simplyfied Example:
bool MatchPoints(ref Point p1, ref Point p2)
{
return (p1.X == p2.X && p1.Y == p2.Y);
}
List<point> l1, l2;
l1 = {[0,0], [1,1], [2,2], [3,3]}
l2 = {[1,1], [3,3], [4,4]}
points that match = {[1,1] , [3,3]}
points that don't match = {[0,0], [2,2], [4,4]}
percentage matched = 2*2 / 7 = 4/7;
any ideas
thank you
zilo
|
|
|
|
|
Very good. Now what's your question? What have you tried and where have you failed?
|
|
|
|
|
My question is what would be the best algorithm in terms of speed to do that. I haven't tried anything yet, although I have some ideas. I real, the MatchPoints method evaluates distance between two points . They don't have to be exactly the same to match, they just need to be whithin a specified distance. Now what I'm trying to do is create a Region from rectangles (should be circles but I guess rectangles approach will be faster and much less expensive) where each point is the center of it's rectangle. Union all rectangles to region. So after I create the list of points, I also create Region that these points 'cover'. After that I just need to run points from one list on the other's list Region for IsVisible(Point point) constraint. I need to test it to see how it performs...
zilo
|
|
|
|
|