|
|
Hi evryone
I need to build a Listener that run GG.exe program evry 30 minute
what is the best way ?
1. to build Windows Service
2. or to build WinForm program that start up when the computer Rise up
if 1 is the best way, how can i run external exe file ?
i'll try this:
System.Diagnostics.Process G = new Process();
G.StartInfo.FileName = @"d:\demo.exe";
G.Start();
but it dont work
thank's
|
|
|
|
|
I have an excel file and want to copy data to sql server. The excel file has a field name: device name , and a field named: model...(there are 30 more fields)
deviceName model
laptop acer 1640
laptop fujitsu
laptop sony
notebook ibm
laptop ibm.
I need to transfer these files into the sql server database. i know that i require 2 tables in sql with one table for devices and another for models and both should have a relationship of M:N. hence another table is required.
My question is that is there any easy way of doin this in sql server or do i have to program it... I have searched regarding dts and it seems that dts works well when only one table has to be transtered to one table. there is a possibility that dts does it but i don't know how to develop scripts in dts as i am an asp.net developer. Do i have to find a way out using C# or are there any tools that solve such problems
any help will highly appreciated.
thanx
haseeb
|
|
|
|
|
Suddenly there are a heck of a lot of posts about this.
Is this the latest coursework assignment?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Unless it's an international course they're doing.....no
but still there's a heck of a lot of them
|
|
|
|
|
how can i load and play multiple videos using the "axWindowsMediaPlayer" tool ????
plz help -----
|
|
|
|
|
By building a playlist, either in the control ( I believe that's possible ), or by handling the event when a video ends and loading the next one.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
when the first video gets over the next one should be loaded automatically and should start playing....
I tried a lot bt, I am nt able to do it...
plz help -----
---mist----
|
|
|
|
|
Hi,
I am a .NET developer using VB.NET but not haven't had a chance to
learn and fell the OO priniciples to the fullest in a way they are
supposed to be learn. I want to switch to C# as the whole world slowly
moving towards it and at the same time learn all the OO priniciples in
a right way. In this process I am trying to find a book which explains
all fundamentals of OOP and illustrate how to develop a small
application implementing all these OO priniciplese would help me
understand the whole thing in one shot.
Are there any great books or videos that would help me accomplish my
goals? I am desperate to find an excellent book that mainly illustrate
an sample project/case study implementing all OOP with comments for
better understanding of the OOP techniques and scope of the project as
well.
Please advice.
Thanks,
-L
|
|
|
|
|
"Head First C#"[^], from O'Reilly was a good read. It assumes no prior programming knowledge and is being used in the classroom. It's loaded with examples, and fun to read.
For video's, I'd like to recommend the MSDN library "How Do I"[^] section. It's filled with short tutorials, not limited to C#.
Enjoy
I are troll
|
|
|
|
|
Thanks for the quick reply. I will sure look into this book.
Thanks,
L
|
|
|
|
|
Stick this in your favourites, very useful[^] in the early stages of the change
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey, Thank you for the great link. I hooked it up to my favorites. Thanks again.
|
|
|
|
|
Hi
i want to get list of all Forms in my current app by this code and display it's Name property to ListBox :
Assembly assembly = Assembly.GetEntryAssembly();
Type[] types = assembly.GetTypes();
FormsCollection forms = new FormsCollection();
foreach(Type t in types)
{
if (t.BaseType == typeof(Form))
{
Form frm = (Form)Activator.CreateInstance(t);
frm.Name = t.Name;
forms.Add(frm);
}
}
this.listBox1.DataSource = forms;
this.listBox1.DisplayMember = "Name";
Here is my FormsCollection class :
public class FormsCollection : CollectionBase
{
public Form Add(Form frm)
{
base.List.Add(frm);
return (frm);
}
public void Remove(Form frm)
{
base.List.Remove(frm);
}
public Form this[int index]
{
get
{
return (Form)base.List[index];
}
set
{
base.List[index] = value;
}
}
}
as u can see in above code (this.listBox1.DisplayMember = "Name";), i set displayMember of forms object to 'Name', but at runTime it does not display anything, whereas when i use this.listBox1.DisplayMember = "Text"; it display Text correctly. how to display 'Name' field ?
Thanks
|
|
|
|
|
Hi,
AFAIK CollectionBase is non-generic, it behaves like an ArrayList, i.e. it holds typeless Objects,
for which Name does not exist. Probably that is why your binding isn't working well.
I suggest you simply write public class FormsCollection : List<Form> {}
FYI: Application.OpenForms "Gets a collection of open forms owned by the application".
|
|
|
|
|
You beat me to it.
I was just away checking the OpenForms part when you posted.
I think you have nailed it!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Luc
but it does not solve my problem. it does not still display Name.
Note : i want to get a list of all forms of my application, not OpenForms.
|
|
|
|
|
Hi,
I have been looking into this, and strange things are going on.
I tried Text, Name and Tag properties. Text and Tag work fine, Name does not, i.e. it shows the same thing ToString() does, which is the type name followed by ", Text: " and the Text value.
The following remarks apply, but are insufficient to explain it all:
- Form derives from Control
- Control has Text, Name and Tag properties amongst others.
- Form overrides Text property
- basically I see no different characteristics between Name and Tag, yet they act differently.
I suggest you use Tag for your purpose, assuming it was not in use so far.
|
|
|
|
|
You know this is really weird!
if you use:
this.listBox1.DisplayMember = "BackColor";
instead of "Name", it displays the BackColor, no problem.
I realise that this doesn't solve your problem, but it is very interesting.
I'm going to play with this for a while, but if you find a solution in the mean-time please post it here.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Weirder, and weirder.
If you try doing the DataBinding in the designer, select the FormsCollection as the DataSource . When you try to select the DisplayMember , all of the public properties of Form are there, except for Name .
Maybe the only way to do it is, as Luc suggested, put the Name into the Tag property if you aren't using it, and use that as the DisplayMember .
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Googled a bit, found some similar complaints, no solutions.
Also found this article dated 27 Sep 2004 Best Practice for Binding WinForms ListControls[^] which seems not to have had problems with DisplayMember="Name" on ListBox controls !?!?!?
It does feel like a .NET bug that maybe did not exist at first.
|
|
|
|
|
OK, this one is really, really, wacked. I've never come acrossed a problem like this before, but then again, I try to avoid using just "Name" as a property of anything. I usually use a more descriptive identifier, like "FormName", but that's just me.
I don't know what his "FormsCollection" class looks like, but I got around the problem by using the above technique in a custom collection that holds an instance of each form and it's name as a seperate property, called, what else, FormName.
His code in his original post looked like it was just scanning the assembly for Form classes and creating an instance of each one, adding it to a collection for later use. That looks like a Dictionary to me.
|
|
|
|
|
Hi Dave,
I agree the OP could have done things differently and never encounter the problem; OTOH the binding behavior is strange.
IMO the Name property should behave like any other property, however I did notice one peculiarity using Reflector, not sure it is relevant though: the getter, when no name is present, returns Site.Name instead.
I have no idea what all the Site stuff is about, could this be the cause of it all?
|
|
|
|
|
Luc Pattyn wrote: the getter, when no name is present, returns Site.Name instead.
Which class/property did you find this in??
Luc Pattyn wrote: I have no idea what all the Site stuff is about, could this be the cause of it all?
Don't know, but it sounds like it might be. The problem I have is that "if no name is present", then why does it appear like that should read "if no name is present, or name is 'Name'"...??
Damn! I wish I could step into the .NET Framework source to see where it goes with this. I can't use it where I work.
modified on Friday, April 17, 2009 11:07 AM
|
|
|
|
|
This is what .NET Relector 5.1.5.0 shows for System.Windows.Forms.Control.Name:
public string get_Name()
{
string name = (string) this.Properties.GetObject(PropName);
if (string.IsNullOrEmpty(name))
{
if (this.Site != null)
{
name = this.Site.Name;
}
if (name == null)
{
name = "";
}
}
return name;
}
|
|
|
|