|
I found out it might be my email sending code that locks the file until it sends it successfully.
How can i check if an email has been sent successfully or not?
|
|
|
|
|
Hi
I created custom control for panel.My requirment is it accepet only one control in it,for this in oncontroladded i wrote the code
if(controls.count>1)
{
controls.RemoveAt(1);
}
it is working but i am getting "Child is not a child control of this parant"
please Help me
|
|
|
|
|
You are not clearly defining your problem which makes it hard for anyone to answer this.
Here is what I think you are saying:
You have a panel that can have a control added to it. (It does not matter if it is your control or a framework control)
So you have logic as follows:
Panel workarea = new Panel;
workarea.OnControlAdded += new EventHandler( LimitControlsHandler );
workarea.Controls.Add( myCustomControl );
So this will then raise an event everytime a new control is added to the panel. So now when that happens your logic should be as follows:
public void LimitControlHandler(object sender, EventArgs args)
{
if ( workarea.Controls.Count > 1 )
workarea.Controls.RemoveAt(1);
}
Assuming that the RemoveAt is totally valid logic for the Panel, then your logic should work just fine. Look at what I've listed here and see where your code differs. Then troubleshoot it. It is difficult to tell you what you are doing wrong with the poor amount of information you are providing in this question.
|
|
|
|
|
Hi all,
Again this is related to Mutex.
I'll explain my question as follows. I have a server application written using C++. Now I try to automate the server to start it automatically. So I write a .Net service to do that.
It's fine, my service is working fine.
But there is one issue. Actually my server can't run multiple server using the same IP. So I want to find is there any server running on specific IP.
So, I used Mutex.
Here what I have done. First get the each server IP from a data base and on each one test there is any instance going on.
private bool HasMultipleInstance(string IP)
{
IPMutex = new Mutex( true, IP + "_mutex_" );
if( IPMutex != null )
{
EventLog.WriteEntry( "MyService", "Multiple Instances on " + IP );
return false;
}
else
return true;
}
What is your guys comment on this. Is that ok? Actually it write an entry to the event log, when a multiple instance is found..
Thanks in advanced
I appreciate your help all the time...
Eranga
|
|
|
|
|
|
Thanks for the replay.
Actually I found this earlier and seems it's too wired for me. That is because I don't know much about C# and stuff. Do you know any simple tutorial relating to Mutex and my question.
Thanks.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Have you tried Google? Mutex[^]
|
|
|
|
|
Yes I do.
And at the same time I found one way to do it. Try to do it using a dll. Actually IP is argument for my server application, which is run on console. If I can found the console argument then my question is solved.
What you think about it pal...
I appreciate your help all the time...
Eranga
|
|
|
|
|
Which console argument do you need to find? If you mean the one passed to your application, you can use the args parameter which was passed.
|
|
|
|
|
Actually that argument means, argument which are set for the command prompt to start the application.
I appreciate your help all the time...
Eranga
|
|
|
|
|
If it is possible to pass arguments to your application then the main method will look like this:
<br />
static class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
}<br />
}<br />
Hope it helps
|
|
|
|
|
Thanks pal,
Actually what you think about my first attempt on first post I have put.
I appreciate your help all the time...
Eranga
|
|
|
|
|
I want to develop a windows application to create a graph based on the given input values, how to do this??
Anyone help..
Dream it to achieve it
|
|
|
|
|
Create a bitmap, put it in a graphics object, and draw the graph on it. There are some free libraries out there you could dissect to get an idea of more specific aspects of how this is done.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
thanks for reply in this message :
http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2432206[^]
it is new idea that i can convert html to single .mht File, but i have some question about this idea:
1. can i save images,styles,... to .mht file ?
2. if i save to sql server database, can i search text in it ?
My main question is that :
i want to save html webPage to database as a single file with all resource and styles like images,styles,... (extension not important, but i want that can search text in content of my data), is there anyOne that has e new idea ?
Many many thanks.
|
|
|
|
|
hdv212 wrote: 1. can i save images,styles,... to .mht file ?
In most cases yes. To test it, try this in IE - File / Save As (type of Web Archive Single File MHT) and then pick a filename.
hdv212 wrote: 2. if i save to sql server database, can i search text in it ?
Assuming you have an appropriate IFilter on your database server (look this one up) and you have Indexing Services enabled then you can. Take a look at CONTAINS and FREETEXT in SQL, and how the Indexing services interact in SQL Server. I've never tried it with MHT files, but I have implemented this with archived Word and Excel files - and the principle is exactly the same.
|
|
|
|
|
thanks Pete O'Hanlon
if i don't want to use FTS (Full Text Search) in Sql Server dataBase, can i use normal search like this in table that contained .mht files :
Select * from mht_Archive_Table where mhtContent like N'%microsoft%'
my another question is that did u use .doc to save to database ?
1. can u search text in it ? if yes, how ?
thanks
modified on Tuesday, February 19, 2008 5:04 AM
|
|
|
|
|
hdv212 wrote: if i don't want to use FTS (Full Text Search) in Sql Server dataBase, can i use normal search like this in table that contained .mht files :
Select * from mht_Archive_Table where mhtContent like N'%microsoft%'
No. That's why I directed you towards the CONTAINS and FULLTEXT commands.
hdv212 wrote: my another question is that did u use .doc to save to database ?
1. can u search text in it ? if yes, how ?
Yes - I saved doc files to a database and I used Index Server with CONTAINS and FULLTEXT to search on it. That was why I told you to do this - I wasn't just posting for finger exercise.
|
|
|
|
|
Hello
I found some good example to get a connection to a mysql db using mysql dataconnector
It is also easy to fill a dataset and a datagridview
BUT I found no tutorial nor any information explaining the basic concept to upgrade tables from the datagridview
Any basic information about that will be WELCOME
Below the basics to get the connection and fill a datagridview
MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection();
string MyConString = "server=localhost;port=3306;uid=root;database=recutex;";
string selectcmd;
conn.ConnectionString = MyConString;
conn.Open();
MySqlDataAdapter adaTour = new MySqlDataAdapter();
selectcmd = "SELECT distinct dag,chauffeurID FROM `tours`";
adaTour.SelectCommand = new MySqlCommand(selectcmd, conn);
DataSet dsTour = new DataSet();
adaTour.Fill(dsTour);
dgv_Tour.DataSource = dsTour.Tables[0];
|
|
|
|
|
|
Thank you
It helps a little
But still do not explain the management between datagrid and dataset to get changed row and update them in tables
The datagrid is owned by the form, the dataset can be owned by the function doing the select. If I have another function doing the update do I have to declare the dataset at the form level ?
Sorry if my question seems stupid but I'm coming from old C and very new to C# programming !
|
|
|
|
|
You find basic knowledge here[^].
For a tutorial, have a look here[^].
What you should keep in mind is that the BindingSource object is responsible for keeping your DataTable synchronized with the DataGridView . Any changes made in the DataGridView will automically be made to the DataTable object. To get the changes back into the database, you need to call the Update() function of the OleDbDataAdapter with your DataTable passed as argument.
SkyWalker
|
|
|
|
|
Hello
It becomes clearer !!
What I understand is that I have to use a BindingSource instead of the DataTable itself
But I'm using a Dataset not a datatable : does it make any change ?
The BindingSource must of course be declared at the form level as the datagrid
But the DataTable or Dataset can be declared into the function as because Bindingsource will handle underlaying data
Is it correct ?
|
|
|
|
|
DataTables are in the DataSet: YourDataSet.Tables[0] would be the first table.
You declare and set a variable whenever you need it, You can use it as long as it does not go out of its scope.
SkyWalker
|
|
|
|
|
Hello
It seems that it is not necessary to use the binding source
The Dataset.Getchange method can be used to get modified rows
BUT : there is a problem with deleted rows : the are virtualy added by the getchages but seems empty
How to manage Deleted rows ??
|
|
|
|