|
Oh, sure - they are replacing them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: they are replacing them
i agree with you Christian Graus.
what i understand is that c# suggest member hiding through the new keyword, means, a new member is defined in the derived class. while polymorphism is achived through overriding (which is not hiding).
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
I have a base form and couple of derived forms.
I want to override Hide method of the base form. But the problem here is we have no facility to override hide method. How do I go about it?
Thanks in advance.
|
|
|
|
|
Hello,
I think you could use this for your base Forms class:
<br />
public new virtual void Hide()<br />
{<br />
base.Hide();<br />
}<br />
And this for your derived classes:
<br />
public override void Hide()<br />
{<br />
base.Hide();<br />
}<br />
Hope that helps you.
All the best,
Martin
|
|
|
|
|
Thanks Martin
I'll Try and let you know
|
|
|
|
|
Hi all,
I had a Console Application which name is myConsoleApp and now I want to run that Console Application from Windows App. How must I do?. For example:
The way to run my Console Application is:
myConsoleApp args1 args2
that purpose is convert args1 to args2 then save args2 to disk . Now I have a Windows Application with two Textboxes, The first Textbox's name is txtSource, the second Textbox's name is txtDest. I want to run my above Console Application with args1's value is txtSource.Text, args2's value is txtDest.Text. When I press Convert button then the conversion is process.
My application is convert two file.
Please help me!
Best regard!
Thanks!
|
|
|
|
|
Process.Start allows you to pass parameters.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I have a question. Is there any .Net class or method to set or get metadata (Like Autor, Title, Description etc...) information of file (.png, .jpeg files) using C#?
Any idea?
Thanks!
best regard
Adiphe
"...all is simple, but there is always simpler ..."
|
|
|
|
|
Yes, there are classes around that do this. The fotovision sample contains some examples, in VB.NET.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian!
where can i find the fotovision sample please?
best regard
Adiphe
"...all is simple, but there is always simpler ..."
|
|
|
|
|
|
Hi to all!
A short question:
Is it possible, to use an object,list,array or something like that as a database?
So I want to run SQL like queries on my object.
Ex.
I have a list, witch contains Person object (List<person> Persons)
Person class for ex.:
<br />
class Person<br />
{<br />
private int _id;<br />
public int ID<br />
{<br />
get{return _id}<br />
}<br />
private string _name;<br />
public string Name<br />
{<br />
get{return _name}<br />
}<br />
}<br />
I want to run a select for those persons who have id under 10 like this: SELECT * FROM Persons WHERE ID<10
How can I do this?
I try it witd bindingsource, try to add my class as project datasource, but nothing work
Thanks for help.
|
|
|
|
|
|
Thank's for quick replay.
I do this way, some times ago, but now, I wont write all the search, and filter method by hand.
Becouse of the complex querys, witch generated at runtime, as the user wants.
Ex.:
somethimes I ned a quer like this:
select * from partners where id<10 and name like'Mr.%' .....
and somethimes need group by option too.
|
|
|
|
|
Dear all,
I used below lines to achieve some results from the Sql Server 2000 database.
My question is why there are always 2 Process ID created for one "adapter.Fill()" method even the connection is disposed.
The Process ID created will disappear after the application exits.
Thanks for your attension.
System.Data.DataTable tb = new System.Data.DataTable();
SqlDataAdapter adapter = new SqlDataAdapter();
SqlConnection conn = new SqlConnection(connectionstring);
adapter.SelectCommand = new SqlCommand( "brm_sel_rackstatus", conn);
adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
adapter.SelectCommand.Parameters.Add("@rack",SqlDbType.Int,32);
adapter.SelectCommand.Parameters.Add("@startcol",SqlDbType.Int,32);
adapter.SelectCommand.Parameters.Add("@endcol",SqlDbType.Int,32);
adapter.SelectCommand.Parameters[0].Value = this.rack;
adapter.SelectCommand.Parameters[1].Value = this.startcol;
adapter.SelectCommand.Parameters[2].Value = this.endcol;
adapter.Fill(tb);
adapter.Dispose();
conn.Dispose();
coby
|
|
|
|
|
ADO.NET supports connection pooling - it will keep connections that have been used open. That would explain one of the connections, but not the second.
It is possible to configure a minimum pool size in the connection string. The other possibility I can think of is that this method is being called concurrently on another thread - are you using a System.Threading.Timer ? That class does not check if the timer method is already running - it always runs the timer method when the timer expires, even if a previous call has not finished yet.
|
|
|
|
|
Hi, Chris,
Thanks for the response. It seems that SqlDataAdapter.Fill() will create 2 connections. I don't run a Timer in the program.
The first connection is used to run the command I set while the second one seems to run nothing and the Last Batch column in Sql Server 2000 Agent/Current Activity is "1900-1-1 0:00:00". I have tried to kill it and found the program still run well. It seemed to be a junk connection. Do you know how I can remove it from my program.
Thanks,
coby
coby
|
|
|
|
|
Hi.i am trying to compare today 's date with a date from database.if it found like today 's date is available from database it should return something like eventname.here is my code
string Today = DateTime.Now.ToShortTimeString().ToString();
SqlCommand cmdDisplay = new SqlCommand();
cmdDisplay.Connection = conn;
cmdDisplay.CommandText = "SELECT EventName FROM Events WHERE EventDate = '"+ Today + "'";
SqlDataReader dr = cmdDisplay.ExecuteReader();
while(dr.Read())
{
string EDate;
EDate = dr["EventDate"].ToString();
if(EDate == Today)
{
txtEventName.Text =dr["EventName"].ToString();
}
}
|
|
|
|
|
You're storing dates as strings in the ShortTimeString format ? That's a time, not a date. And, it's an inefficient way to store them. And it's redundant - you ask for only for values with a specific time, and then you check to make sure your database is not lying to you ?
I don't see a question here - what is the problem ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Dear programers
i hav application having forms
when user press f1 respective form displayed from .chm file.
i have used Help.ShowHelp(this,filepath,keyword)
i want to add a feature if user press F1 on button then in form the selected topic should be highligted
how can i do it
i will appriciate ur comments
sikandar
|
|
|
|
|
hi Guys,
i have to send xml files via MSMQ. I am very new to this.
Can anyone guide me for this?
---------------
I dynamically create XML file and try to save it on share folders and as well as try to send to destination server via MSMQ. XML file is generating without any error.
-----------------------------------------------
I have given the code what i have written (code in C#.net 2003). It's not giving me any error, but as well as not sending file also.(transfer would be one server to other server. and both server is in different domain. I can access destination server from source server- Ping servername)
string QueuePath = @"FormatName:DIRECT=OS:server \private$\DEVqueSERVICE";
MessageQueue queueA = new MessageQueue(QueuePath);
file = new FileStream(fullName,FileMode.Open,FileAccess.Read,FileShare.Read);
XmlTextReader xtr = new XmlTextReader(file);
System.Messaging.Message msg = new System.Messaging.Message();
msg.Label=getcounter();
StreamWriter wr = new StreamWriter(msg.BodyStream,System.Text.Encoding.Unicode);
wr.Write(file);
wr.Flush();
try
{
queueA.Send(msg, MessageQueueTransactionType.Single);
}
catch
{
}
finally
{
queueA.Close();
}
|
|
|
|
|
Hello,
Is it possible to format an USB Stick (drive) with an ManagementObject or something else?
Thanks for help!
Martin
|
|
|
|
|
Salam
we have a public static variable lets say temp in a class lets say A and another class lets say B creates a thread that will update temp's value after every 10 seconds by getting values from Data base.And another thread of the same class uses updated values of temp.Now the problem is this that ,
we are not getting updated values of temp in the second thread of the classB.can any body figure out the problem in this scenario.
plz I need an urgent reply.
thanks
|
|
|
|
|
Use lock when you access the variable, or declare it as volatile .
samtam wrote: I need an urgent reply.
Are you sure that the reply should be urgent, or is it perhaps that it is needed urgently?
---
b { font-weight: normal; }
|
|
|
|
|
Thanks,
But we have already used Monitor.Enter and Monitor.Exit methods for locking mechanism, but it doesnt work.
So now???????????
Urgent Reply is needed urgently!!!!!!!!!!!
|
|
|
|