Answer Questions
cats_five Return value in value types
Sometimes, when I need to "say" something went wrong in a function but I don't want to throw exception I return null. This is possible only if the returned type is reference type (Class) . Whenever it is a value type , the null option is not valid . in literals I can return -1 but what about structs Thanks If you observe .NET, you can see that some structs has a static (Shared) property ...Show All
sax is it possible to run bat from Web Application in C# ?
Hi Guys, Im trying to run a bat file from a web application. Is this possible i have tried running the same code in a windows application, and it works perfectly fine. But when i put the same code in web application, the system just hangs and nothing happens. Below is my code Process proc = new Process(); proc.EnableRaisingEvents= false ; proc.StartInfo.FileName=@"D:\DirecType\temp.bat "; // proc.StartInfo.CreateNoWindow = false; ...Show All
Nisarck SQL Server 2005 Push
Can someone point me to any documentation, articles, examples, etc regarding the best way to push data and/or notifications to a remote client machine that is running a win forms app from SQL Server 2005 Thanks. Someone else gave me the following link from a different forum as well. http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/querynotification.asp Hi, I found a site wich also helped me in m ...Show All
Gurbhajan C# 2.0 Convert Bitmap to Icon
Hi There I am using .NET 2005 Beta 2, and am trying to write a utility program that converts icons to bitmaps. The following function creates an icon file OK, but the icon file is not properly formed. When I try to open it using Visual Studio I just get a heap of jumbled characters. public void BitmapToIcon(string sourceFileName, string destFileName) { // Create a Bitmap object from an image file. Bitmap bmp ...Show All
Jimmy Li .Net equivalents to writeprocessmemory and readprocessmemory
Are there any equivalents to these win32 apis Thanx in advance. No there is no equivalent in .NET of these methods. What are you trying to achieve And perhaps we could suggest alternatives. Tip: If you want to find alternatives for Win32 methods in the .NET Framework, check out the Microsoft Win32 to Microsoft .NET Framework API Map: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dndotnet/h ...Show All
Mal1234 .NET HttpListener has a limit of 2 concurrent requests handled at a time per process, How can I increase it ?
I created a simple server using HttpListener using .NET 2.0 The server simply accepts http connections from clients, sleep 3 seconds and return "OK" message. Server Code : HttpListener m_Listener = new HttpListener (); public void StartListening() { m_Listener.AuthenticationSchemes = AuthenticationSchemes .Anonymous; m_Listener.Prefixes.Add( & ...Show All
uranus65 IDisposable Interface - disposing managed and unmanaged resources
Hi! I'm using VS2005 beta 2 and VB. I would like some help on understanding what is the correct way to use the IDisposble interface. After adding the Implements statement, some code is automatically added in the class. In the Dispose(boolean) method, there are two sections to dispose managed and unmanaged resources. Q1) If a file is opened using one of the System.IO classes, is it considered a managed or unmanaged resource Should I close the fi ...Show All
erdsah88 MouseEnter/Leave form
Hi, I have a form with some controls on it (RichTextBox, Buttons, labels,..). I Tried to Listen to the events "MouseEnter" and "MouseLeave" (I want to be notified when the mouse enters and leaves the form. But now when the mouse is over some control of the form the event "MouseLeave" is raised. And I added a panel to fill the form, and now the event "MouseEnter" is never raised. How can I get the event when the mouse enters the form (and it's co ...Show All
Slugsie HttpWebRequest.GetResponse(); Performance issue.
This call is very slow in being called... First time I call it, the method will return in 4 - 5 seconds. The website is fast and has minimal content to return. If I run it again quickly the GetResponse runs very quick.. If I wait about 5 seconds after the last invocation, the call reverts back to being slow again.. Caching issues Any on from Ms willing to help out here Thanks in advance. Have yo ...Show All
E.Geg Installing and running IIS in WinXP Home edition
I do not have IIS installed in my Windows XP Home edition. Is there a way to get it Do I have to buy it Is it available free Where <b>Hai Da</b> <b>You can install the iis using your os cd .By just insert the cd and open the add/remove program from control panel and select iis from the add component tab and select the cd and clikc ok automatically it get added . </b> < ...Show All
EricMadariaga newbie needs HELP with SQL insert/update in J# windows form
Thanks to anyone who helps! I'm building a data entry windows form that requires the data to be sent to a SQL Server table (the table's name is "Local") when the form's "SAVE" button is clicked. I've built the form using the windows form designer, and now I'm attempting to use SQL statements to insert/update data into the table. There are six fields that will use SQL statements to send data to the Local table, and non ...Show All
JulioCampos save to table without primary key
Hi, I use VB 2005 Express. Problem: When I save some data back to a table (Access) with a primary key everything is fine. But when save data back to a table without primary key I get an exception error: Update requires a valid UpdateCommand when passed DataRow collection with modified rows So my question is then: 1. Is it possible to update a table without primary key 2. in that case, how I use the following kode for upd ...Show All
Simon Detheridge runtime index for Datatable
Hi All can anyone tell me how to create a run-time index on a datatable column something like the recordset.fields(0).properties("Optimize")=1 I usually use this in ADO to create index on client side ADO recordsets and it signinficantly increase performance of quering the RS Thanks in advance Hi Eisa, The same concept applies here. ADO.NET 1.0 does not utilize *true* indexes. You can create a simple or composite index by using the Prima ...Show All
Amir19 Impersonate to different windows accounts based on credentials
Hi, I know that if one needs to be able to authorize access to resources based on the caller's identity, one should set up the server to perform Windows authentication with impersonation. But how can I do this when I grant access to my webserver to, let's say 2 different organizations over the internet that authenticate themselves using certificates. They are not using the windows platform, so I can't do anything with trusted domains. Is it p ...Show All
pehaada correct use of caspol.exe for network shares
Hi, I have a basic question about caspol although my setup isn't very basic. I'm trying to use a .NET DLL across a network and was getting a permissions error. I used "caspol -security off" to resolve the issue but I'm afraid I turned off security for the entire framework. How do I turn off security only for a specific application I think that is a basic explanation. Here are the specifics. I have a network share that is ...Show All
