|
|
Wow. I didnot know such thing exist. Thx very much .
|
|
|
|
|
I am trying to insert a null value into a parameter value for a stored procedure. I set the IsNullable property to true, but it still will not execute the stored procedure unless I put something other than a null. Any ideas? Thanks.
|
|
|
|
|
Nevermind, I just needed to set the parameter value to DBNull.Value instead of null.
|
|
|
|
|
I have web service application which have two session which have two method,which Sessionenable property is enable in both. In second one I check if the session is not null and I do something after it. When I test my application in the test page of web servise it runs OK but when I test it in a ASP.NET client application it is obvious that the Session is null and my connditions does not work in second web service. Any idea?
Mazy
No sig. available now.
|
|
|
|
|
You must use a cookie container with each request. Sessions rely on storing a SessionId in a cookie. Without cookies enabled (or in this case, a container in which to store them), sessions won't work. Use the CookieContainer property in the Web Service class for your clients, inheritted from HttpWebClientProtocol ). It uses a System.Net.CookieContainer . Instantiating a new one and assigning the property should do the trick. Just make sure you reuse the CookieContainer . So long as the Web Service class remains instantiated, you shouldn't have to do anything else.
-----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 Heath,Thanks for your reply.I found it but I didn't want to mess up forum. One of my client will be VB.6 . Do you know ,does VB6 has this capability to set cookie container? I think there is no problem with that but I want to be sure.
Mazy
No sig. available now.
|
|
|
|
|
Not sure about that. It depends on how VB6 encapsulates the Web service, which I'm not familiar with. I'm sure this is not a new problem, so you could always try googling for an answer. I'd check what the class that's generated from the SOAP SDK (or whatever you're using to generate the VB6 class) supports, too. If you would be so kind, could you reply to what you found? I'd be interested to know, too.
-----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-----
|
|
|
|
|
Heath Stewart wrote:
If you would be so kind, could you reply to what you found? I'd be interested to know, too.
Sure. I have to do this job until next weak and I'll tell you about. I have a VB6 CD at home at I have to test it there.
Mazy
No sig. available now.
|
|
|
|
|
Hi Heath:
I test a VB.6 client. I didn't know that vb.6 use XML Web Service like this. It doesn't create web service class or so,it just create a MSXML2.DomDocument and send an url which contain web service method name and get a XMLMessage . Do not need to set any cookie container or something else, Sessions works without any additional things for VB.6.Just send a url request and you will receive correct data.
Mazy
No sig. available now.
|
|
|
|
|
...which indicates the VBVM is most likely using the WinInet functions like Internet Explorer, which means they use the same cookie cache.
-----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-----
|
|
|
|
|
Is there a way to read the properties of a file on a http server?
I want to know when a specific file was modified, so I can make C# download it by itself when the local version is older than the one on the web.
|
|
|
|
|
See the HttpWebRequest and HttpWebResponse documentation in the .NET Framework SDK for more information. An snippet follows that shows how to get the last modification date/time of a document:
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("http://www.codeproject.com");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.WriteLine(response.LastModified); The documentation for the first two classes have more elaborate examples, but the concept is the same.
-----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 just wonder if there is any similar to doc/view in C# and the .NET Framework. I realy liked the doc/view project “in the old days” I used VC++ 6.0 and MFC.
...and justice for all
APe
|
|
|
|
|
|
Genghis might help:
http://www.sellsbrothers.com/tools/genghis/
|
|
|
|
|
Hello!
I've tried to display a MetaFile (saved as Image in a DB) in a pictureBox, using the Graphics.DrawImage(image, pictureBox.Bounds, img.getBounds(ref GraphicsUnit.Pixel), GraphicsUnit.Pixel) method.
The pictureBox Bounds are sizeable, so in step 1, the image is stretched smaller and everything's fine.
But in stept 2, the picturebox gets larger than the image and the method does not stretch the image.
Is there a possibility to resize the whole metafile?
I've tried it with a new Metafile on a System.IO.MemoryStream, but that doesn't work, even a new transformation of the e.Graphics surface didn't work by using e.Graphics.ScaleTransform().
Thank you for your help!
Greetings
Torge
|
|
|
|
|
I am attempting to create threads that requires parameters to start them, after some looking around I came across this :
http://www.yoda.arachsys.com/csharp/threadstart.html[^]
Which does exactly what it says on the tin, but its not exactly what I am looking for as I dont want/need async/waitcallback threads. Basically I have an application that will start X mount of threads (X is dicatated by a config file) and these will continue to run until the application is shut down.
Does anybody know of a way of doing this?
|
|
|
|
|
Async methods are a good way to start new threads and you don't have to worry about implementing in the callback - just use an empty method.
You could also use a ThreadPool , which uses the QueueUserWorkItem to thread a WaitCallback but that can also take an Object as a state variable that is passed to the WaitCallback - this could be anything from a single object to an array or list of arguments.
If you really don't want to use either of these, you should design a class that takes the parameters you want in the constructor or some properties and then uses an instance method on that class in the ThreadStart delegate. The delegate can then access all the fields in which those arguments are stored, like so:
public class MyThread
{
private int i;
private string s;
public MyThread(int i, string s)
{
this.i = i;
this.s = s;
new Thread(new ThreadStart(this.Start)).Start();
}
private void Start()
{
Console.WriteLine("{0}, {1}", this.i, this.s);
}
}
-----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 Guys,
Does anyone know how I can create and use a hidden window in a windows service application written in C#?
I inherit the form class but and create instance of the new class but its handle is not valid and the form is not created. A prove for this is that I can not find it in the list of available windows using Spy.
I have no problem to use the same code in standard Windows based application. The form is created and works. However it fails in a service application.
Nick
|
|
|
|
|
First of all, why would you need to display a hidden window in a service, anyway? It would seem to serve no purpose?
If you do need to anyway, check the "Allow service to interact with desktop" option in the Services snap-in if running as the SYSTEM account (Local System), or specify a user with login rights to the local machine. This form would only be available in the context of that user, however.
See http://www.ftponline.com/vsm/2002_10/online/villeda/default_pf.aspx[^] for an example in VB.NET, but it wouldn't be hard to do in C# (remember that all languages that target the CLR can use assemblies - including the base class library - in the same manner, though syntax might be different).
-----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-----
|
|
|
|
|
So many experts here, I feel humbled.
My C# app talks to a SQL database to get information back. The app is basically a GUI representation of the data in the database. When I modify the data in the client C# app, I would like to not only send the changes back to the database, but also to all other clients connected to the SQL database (all clients will be running this same C# app).
Now, I already have the C# app reading, displaying, and sending the data back to the SQL database. What I need is to do now is to send this modified data to all the other connected clients. My thought is that I will probably need a seperate application to do this, possibly using remoting.
Can some of the experts here tell me if I'm on the right track? Does this seem like a very big undertaking? Is remoting the best way to do this or would you suggest something else such as a webservice or an additional SQL table for holding the modified data?
Any suggestions, words of warning, comments, any feedback whatsoever is welcome and appreciated.
The graveyards are filled with indispensible men.
|
|
|
|
|
You could use a file dependency cache. When you update the data, the file changes, all client apps detect the change and refresh their data.
|
|
|
|
|
I could, but that's not an ideal situation: the total amount of data is several gigabytes worth. If I only change a single row in the database, why refresh all the data; it'd have to search through several gigs of data just to update a single row. Any other solutions that would be more efficient?
The graveyards are filled with indispensible men.
|
|
|
|
|
Since your original question didn't mention anything about gigabytes of data being involved maybe you would like clue us in to any more details your holding back. IMO if you have gigabytes of data streaming to client apps you have way to much information. What is your network load when all of these apps start up at once?
|
|
|
|