|
While leaving unsaved form, the system should alert the user that the data is not saved and user should get option to save the form before moving out of the form.It is a windows application in .NET framework coded in C#.
|
|
|
|
|
Setting a flag on OnSaveButtonClick event and by handling FormClosing Event I think you can check this one.
class mainForm
{
....
private bool isSaved = false;
...
private void OnSaveButtonClick(object sender, EventArgs e)
{
SaveFile();
isSaved = true;
}
private void On_FormClosing(object sender, EventArgs e)
{
if(!isSaved)
{
MessageBox.Show("Data is not saved!");
e.Cancel = true;
this.Focus();
}
}
...
}
Hope this helps. Good Luck.
|
|
|
|
|
how to remove access database password using c# code.please help me.explain it. thank you.
|
|
|
|
|
lankaudaranga wrote: how to remove access database password using c# code
Without knowing it? Uhm...You're a bad guy!
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
[My articles]
|
|
|
|
|
lankaudaranga wrote: how to remove access database password using c# code
You can't, and stop asking the same damn question over and over.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
I have created a windows service which monitors the activities of files on the server. This windows service is using a filesystemwatcher.
Every time there is an activity, i.e. when a file is moved or created, etc., then the system sends an email.
All works fine.
Question:
Imagine something will have to get installed on the server and the user forgot to turn off this windows service. Then as a result, a lot of emails will get sent.
This is what I am trying to avoid (Sending un-necessary emails).
Ideally, the user will turn this windows service off but what if he doesn't? certainly we do not what the system to send so many emails as the result of something being installed which can cause alot of files movements and creations, etc...
Thanks
|
|
|
|
|
Well, if you were stupid enough to set the folder to C:\ and then allow it to watch subfolders for "*.*" as well, you deserve what you get.
How about this... write the service to be more selective about what it's watching for. I know, this might be a huge mental leap for you, but sometimes, programming requires, ummm...., programming.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: but sometimes, programming requires, ummm...., programming.
and I thought I was the only one that had that opinion. It seems many people think programming now only requires Lambda.
led mike
|
|
|
|
|
Maybe a timer is useful here?
|
|
|
|
|
What would you do if someone decided to copy 500 files from somewhere? You need to reconsider your requirements and design.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
That will not happen as this system will be used for files which are not supposed to be changed.
Thanks
|
|
|
|
|
arkiboys wrote: That will not happen as this system will be used for files which are not supposed to be changed.
I think what you mean is
That should not happen as this system will be used for files which are not supposed to be changed.
Anyway, back to your original problem. AFAIK an install is the same as copying files (at least to a file watcher), so how about seeing how many changes there are in say 30 seconds and send a single email out listing them? Not a perfect solution but maybe a viable work around?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Yes, I will try that.
Thank you
|
|
|
|
|
Hi everyone,
I am doing project on parsing a html content or content in a web page,to display any error in web page(i e to find out grammatical mistakes e.g meaning of word or syntax mistake etc)
which has been designed using html.
please help me out if there is any code or logic...it may be in c#,Java,JavaScript etc
|
|
|
|
|
Look at this article[^].
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Hi,
You can do this using XSLT and XPATH but if the HTML you want to parse is in XHTML format.
Regards,
|
|
|
|
|
Hello,
I want to develop a sample application for Remote Connection.
If you have any kind of link or Sample then please provide me.
Thanks in advance.
Best Regards,
Chetan Patel
|
|
|
|
|
How to create setup for C# Windows Application exe. I have tried uisng the Publish option in the application. The problem is with database path. I have put the database(.mdb) file in a separate folder called database. So in the ConnectionString I have given the database path as @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source =" + Application.StartupPath + @"\Database\dbCIMS.mdb;"
How do I include this database in the Setup using the Publish wizard. When I run the setup it was giving Invalid database path error.
Please help
Thanks in advance
|
|
|
|
|
|
Hi,
I have a textbox in which i want to implement wild card search. Like if i enter one char 'A', all the names starting with 'A' in database for that table should be listed. If i enter two chars, correspondingly data should be listed. Can anyone please tell me the solution? Code is in C#
|
|
|
|
|
Your problem shows there must be a table in your database which you want to target.If you are using that text box on ASP.Net page,
Try this one:
string searchkeyword=yourtextbox.text + "%"; (special character is for use with stored procedure)
stored procedure:
create procedure searchwithkeyword
(
@keyword nvarchar(50)
)
as
select names from yourtable where name like @keyword
now the code for button click event:
sqlconnection con=new sqlconnection(yourconnectionstring);
con.open();
sqlcommand com=new sqlcommand("searchwithkeyword",con);
com.commandtype=commandtype.storedprocedure;
com.parameters.addwithvalue("@keyword",searchkeyword);
sqldatareader dr=com.executereader();
if(dr.read());
{
//display results
}
else
{
//show message
}
dr.dispose();
com.dispose();
con.dispose();
The code is a bit messy as it is not implementing try catch and finally blocks but if it is worth helping do that yourself and let me know what happened to your problem.
|
|
|
|
|
I am working in C# with database already there. My application is about to release. Only i need to make this wild card implementation. Can you tell me how to do this in C#.net
|
|
|
|
|
You just do something like:
string searchstring = "%" + textbox.Text + "%"
and pass this search string as a parameter to a SQL LIKE in the WHERE clause, which will result in something like this:
SELECT id, name FROM users WHERE name LIKE '%A%'
But make sure that your app won't be vulnerable to SQL Injections[^].
regards
modified on Friday, July 25, 2008 4:53 AM
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks to all,will try this implementation and get back to you
|
|
|
|
|
Hi,
I have a textbox in which when i enter a character, i want it to be displayed be UPPERCASE. how to handle this condition? Reply soon.The code is in C#.
|
|
|
|