|
The server which i am using is a XP professional machine
and it does not shows Public Queue,
I wanted to know whether i can create a private queue from my code
on that machine,
I created a queue manually by going to the computer management window,
but i want to check whether a specified queue exists or not
if not then it should be created
Is there a way to do that.
Thanks
Pramod
|
|
|
|
|
If it is a private queue then you can check whether it exists or not. You just need to use:
"FormatName:DIRECT=OS:machinename\private$\queuename"
as its path and then check IsExists property.
Akif
|
|
|
|
|
i cannot find the isExists property
can u please send me the code
Thanks
Pramod
|
|
|
|
|
Use MessageQueue.Exists(QueueName) to check whether the queue exists or not.
Sorry;) it is not a property infact a static method.
There is a good article on the usuage of MSMQ. Check it out[^]
Akif
|
|
|
|
|
i have already tried that but that throws an Exception
saying "Invalid Queue PAth name"
i am not able to check the existence of the Queue on the server
i am able to send and Receive msgs
Thanks
Pramod
|
|
|
|
|
"Exists cannot be called to verify the existence of a remote private queue"
Syntex of the QueueNamePath is:
Public queue: MachineName\QueueName
Private queue: MachineName\Private$\QueueName
Journal queue: MachineName\QueueName\Journal$
Machine journal queue: MachineName\Journal$
Machine dead-letter queue: MachineName\Deadletter$
Machine transactional dead-letter queue: MachineName\XactDeadletter$
Akif
|
|
|
|
|
then how should one check whether a Queue exists or not
we cannot directly send or receive msgs whether checking the existence
of the queue
Thanks,
Pramod
|
|
|
|
|
You can go for public queues. In that case, you ll be able to check its existance.
If you want to use private queues, the dirty way of finding whether the queue exists is to create the queue with the path specified and then catching the exception. If the path is wrong, then its object will not be created and an exception will be raised.
Hope it will help you
Akif
|
|
|
|
|
|
|
read my topic below to get a description to the problem i am trying to adress.
i wan't to run caspol so that it disables .net security, i've found an article stating that it should be run as :"caspol -security off" but how exactly d oi do this? is it a command line option? or what?
m$: It is normal for your screen to go blank and for your computer to restart itself several times
|
|
|
|
|
I've a database access with 1 OLE OBJECT field contained an Image.
I've queried the database the result is in the DataSet.
Now i would to get the image contained here:
myDataSet.Tables[0].Rows[i]["Image"]
how?
|
|
|
|
|
You got it. Right there. What do you want to do with it?
---
b { font-weight: normal; }
|
|
|
|
|
it doesn't work if i do:
myImage = (Image)myDataSet.Tables[0].Rows[i]["Image"];
|
|
|
|
|
You can read data from a DataSet simply by using the following code:
byte[] _Image = (byte[])myDataSet.Tables[0].Rows[0]["Image"];
MemoryStream ms=new MemoryStream(_Image);
Image image=Image.FromStream(ms);
Now you have your image reconstructed if you have stored it as binary data.
Akif
|
|
|
|
|
i've do it but i get error, maybe becouse i have set the image within Microsoft Access instead in my c#application.
Could be it the cause?
Just another question:
if i set another kind of file as a word file or a .xls how can know what kind the file is it?
|
|
|
|
|
I didnt get your point. Will you specify it in more details whats the problem
Akif
|
|
|
|
|
how can i use datasource as dataset in owc chart. I am using c# windows application. I want to use DataSet of VS.Net for the chart.
|
|
|
|
|
I wrote a little HTTP editor to modify the values of form variables in an HTTP request, without the having to hurt my eyes editing the raw text. My immediate vision was for a two column grid, for all the name=value pairs. I'm a little miffed that one has to get as extravagent as a DataGrid (WinForms) to achieve this.
Another of my ideas was to use a PropertyGrid, but that requires an object with one property corresponding to each form variable, with the complexity of having to generate that object on the fly.
Any ideas/suggestions on avoiding a DataGrid for such a simple application?
The DJ's took pills to stay awake and play for seven days. - Jim Morrison, Black Polished Chrome.
|
|
|
|
|
check this
http://www.dotnetjunkies.com/Article/65DC168F-B2AD-408B-8AA0-AD90DD739317.dcik
|
|
|
|
|
Thanks, that looks like a good read, but it's not what I'm looking for. I actually went through that exercise last year and solved it with a crude loop. This is a WinForms grid, not ASP, and they're quite different animals.
I needed to edit a collection of objects not related to the database, so through my trials I learnt that the collection needed to implement IList at minimum. My collection derived from DictionaryBase, and .NET Data Binding doesn't like that, so I first tried to implement IList but it got messy.
I then derived from CollectionBase, destroying my nice Dictionary based accessors etc. that operated like a Hashtable's accessors, replacing them with Add, Remove, and Item members that only return a Dictionary entry structure, leaving the onus on the client of the collection to extract name or value.
Now I still need to implement IBindingList and IEditableObject before the grid will behave as I want, and I keep thinking what a mission this is for what was supposed to be a one-hour project HTTP editor.
The DJ's took pills to stay awake and play for seven days. - Jim Morrison, Black Polished Chrome.
|
|
|
|
|
Hi
try this: (you find a complete collectionbase class that implement IBindingList, .....)
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=0B47DA60-DF5F-4A28-ABF7-6F8EB977FCFD
|
|
|
|
|
Is it at all possible to kill the error 'Not all code paths return a value'?
I have several classes that need to throw exceptions when some methods are called or the user tries to set some properties. ('You cannot bla bla bla on a NullObject') We're talking *lots* of different places that will throw this particular exception.
Since I am a structured kind of person, I'd like to standardize the message and information that is logged. Therefore I thought it would be smart to defer the actual throwing and logging to a common method that can be called from all the places.
However, when I do, the C# compiler complains that not all code paths return a value.
The code does exactly the same thing as before (throws an exception) except it's maintainable now, so how do I make the compiler stop bugging me about this ""error""?
I'm using VS 2005
Thanks on beforehand
/Joachim
P.s. I tried using #pragma, but it seems the compiler thinks this is a real error, and says '161' is an invalid warning number... Or did I do it wrong? Ds.
--
Ubi Signo?
|
|
|
|
|
I don't think you'll be able to suppress this error.
The only workaround I can think of is to let the method you use to throw the exception return a value, but this seems quite awkward, too.
I guess it would be better to log in the constructor of your exception or add an event handler for unhandled exceptions and perform your logging there.
Regards,
mav
|
|
|
|
|
mav.northwind wrote: I guess it would be better to log in the constructor of your exception or add an event handler for unhandled exceptions and perform your logging there.
Regards,
mav
Ah. Good idea. Didn't think of that. Will put the logic in the constructor for now.
Thanks for your suggestions.
Regards
/Joachim
--
Ubi Signo?
|
|
|
|