|
|
We are facing a problem of :
We call a VC++ exe (Form View single document application) from C#
But we want to close it after it’s execute
We tried after
WaitForProcess
Process.CloseMainWindow
&
Process.Close
I want to load a flash movie in the initialization of a C# program
WaitForProcess
i tried both these functions:
Process.CloseMainWindow
&
Process.Close
there is another problem:
I want to load a flash movie in the initialization of a C# program
|
|
|
|
|
We are facing a problem of :
We call a VC++ exe (Form View single document application) from C#
But we want to close it after it’s execute
We tried after
WaitForProcess
i tried both these functions:
Process.CloseMainWindow
&
Process.Close
there is another problem:
I want to load a flash movie in the initialization of a C# program
|
|
|
|
|
I have a fundamental question about
the way .NET handles the object orientated way of
persistence. I am coming from JAVA and WebObjects (Apple)
World and I am looking for a convenient way of working
with objects without seeing any SQL statements only
objects. I have used that approach for years on the
WebObjects Platform (Enterprise Object Framework) and in
Java recently (Container Managed Persistence). I am
looking for something like that in the Microsoft world.
As far as I understand Microsoft does not distinguish
between the Object Model and the Relational Model. The
main difference is that the Object model allows n : m
relationships and the Relational does not allow them. Here
a small example to visualize the problem:
Example:
There is a Patient object with following Attributes
String patientGUID;
String name;
Int age;
Hashtable diseases; (or some other Container like
Collection or Array)
And there is a Disease Object
String diseaseGUID;
String name;
In the object Model there is relation between Patient and
Disease where the patient has his diseases but on the
other site one disease can belong to 1..* patients. (n :
m)
That n : m relationship can not exist within a relational
database without a link table that contains the
connections between the tables: Patient and Disease.
Now, I would like to connect the object Model containing
TWO Entities (Patient, Disease) with the relational
database (containing THREE tables). Then I want to work
with my objects; e.g. create new diseases connect them to
existing patients by putting the diseases into the array
or create new Patients and connect them with already
existing diseases or just change a Patients name. When I
am finished I just want to say SAVECHANGES and the
database is updated accordingly including all link table
entries.
So all I have to care about are my objects and the
relations between them, some invisible layer does all the
dirty work like building SQL, converting the data types
and caching. So if I fetch a Patient with a specified GUID
I do not have to care about fetching his diseases. They
are fetched automatically. If there are too many Diseases
I do not care some kind of algorithm handles that problem
in such a way that if I have to search all of them for
something they are simply there. They are loaded on demand
(lazy evaluation)
Supposing that the disease has a further connection with
some DiseaseType Object/Table and that table has an
attribute/column "Description" I can access it by typing
the following code:
TextField1.Text = currentDisease.type().description()
Please note that to retrieve the description value I did
only fetch the Patient. The diseases and its types were
fetched automatically.
Is something like that possible or am I excepting too much
of the .NET?
Pawel
|
|
|
|
|
I am not an expert on this, but I think the Dataset object in ADO.NET will do what you want. It isn't limited to single-table queries but can handle multiple tables and relationships.
It's also disconnected, and knows how to reconcile changes back to the source tables.
|
|
|
|
|
gicio wrote:
Is something like that possible or am I excepting too much
of the .NET?
It is possible, but I don't think there is anything available yet to do so. I've heard of several projects that are working on doing this, but I can't remember any names
James
|
|
|
|
|
gicio wrote:
Now, I would like to connect the object Model containing
TWO Entities (Patient, Disease) with the relational
database (containing THREE tables).
actually... I would claim that a good design gives you three objects, just like the relational model.
You have the Patient object, the DiseaseCollection object, and the Disease object.
that said, I think it would serve you well to take a look how Connections, Adapters, and Strongly Typed DataSets can fit together to create a very usefull and powerful data object engine.
|
|
|
|
|
is it something like Objectspaces ???
Pawel
|
|
|
|
|
couldn't really tell you the answer there because i'm not too familiar with objectspaces.
|
|
|
|
|
hi!
have you some infos about objectspaces???
Pawel
|
|
|
|
|
How can I open and preview the font in my app?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
Im using a mySQL DB and some obj that does the connect to it (called DBOperation).
in the DBOperation() constructor I do my connecting to the DB
myDb = new OleDbConnection(myConnectionString);
myDb.Open();
then i got some funtions for reading/writing..
in my ~DBOperation() destructor I call a Disconnect() fkt where i do:
myDB.Close
but while Calling that i get a Exception : "Handle is not initialized"
here is the full Exception Text:
Exception: Handle is not initialized.
at System.WeakReference.get_Target()
at System.Data.Common.WeakReferenceCollection.Close(Boolean flag)
at System.Data.OleDb.OleDbConnection.CloseReferences(Boolean canceling)
at System.Data.OleDb.OleDbConnection.DisposeManaged()
at System.Data.OleDb.OleDbConnection.Close()
at DBTest.DBOperation.Disconnect()
at DBTest.DBOperation.Finalize()
Can anyone tell me why this happens ... any Help would be great
Yours LaMagra
|
|
|
|
|
Are you sure your destructor is called?
It sounds like that on yoo, but the destructors in C# is not the same as C++' destructors. It's not a guarantee that C# destructors are called when an object is destroyed. I don't knwo why (have forgot it )
But this maybe wasn't big help to you, sorry!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
This code doesn't work for me:
String str = this.textBox1.Text;
String newStr = str.Trim();
MessageBox.Show(newStr);
The MessageBox that appears contain the string WITH all white spaces!!!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
Trim only removes leading and trailing whitespace. It doesnt remove the spaces between words etc. Is that what you mean?
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
hm.. what I understod from my book it was suppose to do that... but okay!
Thank ya!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
|
Nish - Native CPian wrote:
It worked for me
huh?
Well I can compile it... but I missunderstod the use of Trim(). I thought it was suppose to remove all white spaces in the string!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
I think what you're looking for is Replace.
<br />
String str = this.textBox1.Text;<br />
String newStr = str.Replace(" ", "");<br />
MessageBox.Show(newStr);<br />
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Quote frpm MSDN ( I suggest you use it )
String.Trim Method
Removes all occurrences of a set of specified characters from the beginning and end of this instance.
Overload List
Removes all occurrences of white space characters from the beginning and end of this instance.
<br />
public string Trim();<br />
Removes all occurrences of a set of characters specified in a Unicode character array from the beginning and end of this instance.
<br />
public string Trim(params char[]);<br />
IOW
<br />
String str = this.textBox1.Text;<br />
String newStr = str.Trim(' ');
MessageBox.Show(newStr);<br />
Hope this helps
|
|
|
|
|
Is there anything in C#.that is similar to Control ID's in MFC ?
VIKS
|
|
|
|
|
For what purpose? Without knowing what you wish to do its hard to know if an alternative exists.
James
|
|
|
|
|
Actually I have some MFC code. I don't want to write it down again in c#. That why I need this stuff.
VIKS
|
|
|
|
|
vikrams wrote:
I don't want to write it down again in c#.
If you don't want to write in C#, then why do you bother
..this is a VB Programmers' world and we all are just visitors - Someone in a MSJ article
|
|
|
|
|
As James said, it's hard to suggest something without knowing what you are trying to achieve, but perhaps you are looking for the Control.Name Property
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|