|
That worked, thankyou so much.
There is some data that I need to save with the MyAudio object. That's why I cannot directly use the Audio object.
Thanks,
Paul
|
|
|
|
|
I have a dataGrid and my reqirements is that i want to add data in the dataGrid form two tables.Both the tables are in the dataset.
How can i display data in the datagrid programatically.I think the
dataGrid.setDataBounding(ds,"Item")
would not work since it binds it to only one table.
Is there unbound method so that i can display data form two table in a single data grid.
Note that i dont want to use the DataRelation obj .
Any Idea.
Thanks
|
|
|
|
|
datagrid.DataSource = dataset;
Just bound iyt to whole of dataset,not to one table.
Mazy
No sig. available now.
|
|
|
|
|
This will require a value for the DataGrid.DataMember property since DataSet is an IListSource implementation. If you don't, you'll see a DataGrid with two collapsable (in the collapsed state) rows for each table. It won't give you a "flat" look, and most likely both tables will have different columns anyway.
A couple of other alternatives might be to merge the two tables together if you don't need to update an RDBMS with the changes to the DataSet . You could also used a couple of DataGridTableStyle s (see the DataGrid.TableStyles property for more information) to control the output of each table depending on the table name, although this won't show them simultaneously. You can programmatically switch from one table style to another hence showing both tables formatted how you want them.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I've got a rather odd problem which I can't fix, and can't find any information about on the Microsoft sites, so maybe some saged person here can help.
In summary, I am referencing a home grown .DLL in my project. The .DLL is relatively simple, it just accesses some legacy BTree files. However with the reference in place, loading up one of the existing forms in the project the form doesn't load - in it's place is a screen saying:
An error occurred while loading the document. Fix the error, and then try loading the document again. The error message follows:<br />
File or assembly name EPoSAccessLayer.dll, or one of it's dependencies, was not found.
I have confirmed that all dependencies are found, and in a brand new project the .DLL does not cause these problems.
In the existing project where this reference is causing the form problems, the application will compile and execute without errors. I just can't edit the forms.
My current workaround is to remove the reference, and then the forms load up and are OK for editing. So the question is, has anyone else experienced this problem, and if so, do you know the solution for it.
Thanks.
Martin.
|
|
|
|
|
Sometimes I found those error too,
What I did.. just try saving the form.. restart the IDE and reopen again.
Mostly it's work..
Sorry I can't help you with other solution
"Courage choose who will follow, Fate choose who will lead" - Lord Gunner, Septerra Core
"Press any key to continue, where's the ANY key ?" - Homer Simpsons
Drinking gives me amazing powers of insight. I can solve all the worlds problems when drunk, but can never remember the solutions in the morning. - Michael P Butler to Paul Watson on 12/08/03
|
|
|
|
|
If the assembly EPoSAccessLayer.dll is from a project in your solution, I recommend you add a Project reference to your project that depends on it (same as adding a .NET or COM reference, only click on the Project tab). This keeps both Debug, Release, or any other build configurations in sync when building. It also makes sure that any changes to the EPoSAccessLayer project force a recompilation of it before compiling your project with a dependency on it. If you're using automatic versioning, this problem seems common and using a project reference should help.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I wasn't orginally using a project reference, just a normal binary reference. But that does seem to have fixed it.
Thanks.
|
|
|
|
|
This problem occurs also when you are using inherited forms. Forms inherited from forms in your own project usually don't cause much trouble. But I have never been able to inherit a form from another (library) project... the program worked just fine - like yours - but the designer wouldn't work...
A bug in VS.NET ...
Anybody knowing how to fix this inheriting problem??
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
I can't seem to figure this out.
I need to dispose the audio after it has finished playing(using DirectX).
ourAudio = new Audio(fileName);
if (ourAudio != null)
ourAudio.Play();
<- NEED SOMTHING HERE (Wait function or Thread...)
ourAudio.Dispose();
Thanks
Thomas
|
|
|
|
|
Handle the Audio.Stopping event. In the handler, you could call ourAudio.Dispose , or to use the handler for multiple Audio.Stopping events, cast the sender parameter (could be any name, but it's the first parameter in the handler) to an Audio Type and call Dispose :
private void PlaySound(string fileName)
{
ourAudio = new Audio(fileName);
ourAudio.Stopping += new EventHandler(audio_Stopping);
ourAudio.Play();
}
private void audio_Stopping(object sender, EventArgs e)
{
Audio a = sender as Audio;
if (a != null) a.Dispose();
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
I have to develop a client/server application in C#. The connection between the server and the client hast to be persistent and encrypted. There will be steady dataflow on push basis from the server.
My question is, what is the best approach to build this kind of application? Speed is one of the most important factors.
I read an article about Bear Stearns who built their new stock market transaction server as XML web service.
So, if anybody has some gnereal ideas i'd greatly appreciate that
|
|
|
|
|
I suggest to read about Remoting. I just finished a client/server application using remoting and it works very good.
You can persist and encrypt using Remoting.
Search in CP about remoting.
Visit www.ingorammer.com[^]
Free your mind...
|
|
|
|
|
I did but to me it looked more like remoting is used to offload processing to another computer.
What I want are persistent connections for a couple hundred clients, constantly pushing or pulling data.
So, this will be very performance critical.
What are the other possibilities to approach this type of application?
However, I'll have a deeper look at remoting and see whether it suits my needs
|
|
|
|
|
Try webservices, but webservices will work for pulling data, as you know it works using a web server, and the web server can't send information to the clients, unless the client ask for the information.
I used remoting to push and pull info from the server and the clients.
Free your mind...
|
|
|
|
|
That's the reason why I can't use web services as the data hast to be pushed to the client.
What about developing an own TCP/IP Server... do you see any benefit in doing this?
|
|
|
|
|
This was already discussed elsewhere I think. I'll give you some advice: don't develop a server which handles each client in a separate thread, cause that will cause processor overloading with >20 clients.
Maybe you'll find the answer at .NET 247
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
hm but every client will receive different data concurrently. How else could this be accomplished without threads?
|
|
|
|
|
Sorry, it does require multiple threads, but make sure you are not running 200 threads at once, you'll have to pool / manage your threads... But that's something I - too (i guess) - am not familiar with.
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
Why invent the wheel when you already have rockets going to mars ???
That's up to you, but remoting is very robust.
Any way, if you need an example, I can send you some code.
Free your mind...
|
|
|
|
|
I agree with the first reply that .NET Remoting is worth looking into, but there is another, easier alternative.
You can use XML Web Services over HTTPS (HTTP over SSL) if your server has a valid certificate. If you're developing an internal application and have ActiveDirectory, you (or IT) can use the Certificate Services to create a Web Server certificate and install it in IIS. For external applications, I recommend getting an SSL cert from VeriSign, Thawte, or any other certificate authorities (CAs). Then, just make sure you use a URL to access your Web Servce using the https scheme instead of http. It is automatically encrypted without you having to do anything.
If you do look into .NET Remoting - which is far more robust, though WS Security is certainly providing additional features for Web Services - I recommend a good book for both new and intermediate Remoting developers from Microsoft Press, ".NET Remoting" by McLean, Naftel, and Williams: http://www.microsoft.com/mspress/books/6172.asp[^]. You could use channel sinks to encrypt, compress, route, or anything else to the messages in an abstract manner. This book cover that and even includes an example channel sink and derivative RealProxy for doing basic load balancing. It's a good book!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
thanks for both your replies. I'll definitely have a deeper look at remoting.
Unfortunately I can not use XML Web Services as i have to push date from the server to the client.
|
|
|
|
|
You want this book as reffed in this thread, it shows an implementation of an encrytion sink for remoting in Chapter 9.
Remoting does seem to be your answer.
DTrent
|
|
|
|
|
The snippet below seems to me to reek of inelegance, yet i have no better solution. i can't manage with using {} because the pictureBox barfs if i dispose the image too soon.
Is there a better way??
Image disposeOfSoon = pictureBox.Image;
pictureBox.Image = newImage;
if (disposeOfSoon != null) disposeOfSoon.Dispose ();
________________________________________
Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain.
Then perhaps I'd deserve ya, and be even worthy of ya..
if I only had a brain!
|
|
|
|
|
Image disposeOfSoon = pictureBox.Image;<br />
using (disposeOfSoon)<br />
{<br />
pictureBox.Image = newImage; <br />
}
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|