Hassan Ayoub's Q&A profile
.NET Development A Read-only dataset
I have a singleton class which contain a DataSet. And also provide a property which return the dataset. How can i return a readonly dataset so that the object that is asking for it wont modify the data and the structure of the dataset Thanks, taking memory for nothing .. i don't want to duplicate dataset .... cuz many of my usercontrol will need the data of that dataset. ...Show All
Visual Basic How can you set variables to Nothing when using Return?
Here's a hum dinger.... It's my understanding that it's good programming practice to set variables to nothing when you are done using them, however, how are you supposed to do this when a return statement is involved. It's a catch 22... you cannot set the variable to nothing before you return it, and you cannot set the variable to nothing after you return it because no statements after "return" run. e.g. Public Function ReturnSomeCrap() As Crapola Dim SomeCrap As Crapola SomeCrap = New Crapola("100 lbs") Return SomeCrap End Function So, where and how do I set SomeCrap = Nothing, since I have to have it to return, and I cannot do it after the return IMHO - that the statement.. set to nothing is a garba ...Show All
Windows Forms Binding to Array
How can I bind a label to an array of ints in specific index For example in the following code how can I bind to ints[0] public partial class Form2 : Form { private int [] ints = new int [3]; public Form2 () { InitializeComponent(); for ( int i = 0;i<3;i++) { ints = i; } } [ STAThread ] static void Main () { Application .Run( new Form2 ()); } private void Form2_Load ( object sender, EventArgs e) { Binding bind = new Binding ( "Text" ,ints" "); //, "[0]" ); label1.DataBindings.Add(bind); } } If you do not need to explicitly pass a data member, pass an empty string instead. In your ...Show All
Visual Basic What is the difference between OCXs and DLLs ?
Hello, I wanted to add Windows Media Player to my application but when adding reference to the project, I found there was two Windows Media Player controls : WMP.DLL and MSDXM.OCX. I am currently using the DLL but I would like to know what is the difference between the two controls as they seem to be the same. Is there anyone to be preferred Thank you Oh okay, I remember these was coding differences but I couldn't tell. But are there any differences when compiling, like does the app will need runtime files or is it managed (automatic) Thanks. ...Show All
.NET Development Generate a class at runtime and use it
Hi All Is it possible to create/declare a new class (not an instance) at runtime I would like to load from xml tha wanted class name and the wanted properties and to generate the needed class. of course, then I would like to use it in the project. Thanks Avi You can use CodeDom NameSpace to perform this task. or Microsoft.CSharp. CSharpCodeProvider NameSpace. Where you can dynamically generate a Class file. Compile the class file and then use in your same app. ...Show All
Visual Studio Trouble installing the December MSDN Library
I received the latest MSDN DVD distribution the other day. The package included the December 2006 version of the MSDN Subscriptions Library. When I try to install this updated version of the library my XP/SP2 system totally hangs trying to do something on/with the DVD. If I put the DVD in a system that does not have VS 2005 installed and does not have any previous version of the library installed I can read the DVD without any problems. My question is has anyone else seen this problem with the December library If so, have you found any workarounds other than to stay with the previous library version Thanks Neil Thanks for the reply. I'd really rather try to get an answer to what changed on the Library DVD that is causing DLA the is ...Show All
Windows Forms How to do tracing logs ??
Hi, How can I add tracing log in my application Is there any .net specialized class or some property that logs tracing data automatically or would I have to manually do it by writing strings to a file using System.IO.FileStream and StreamWriter Thanks, EventLog class will log message in system's event viewer with some additional information such as timestamp, event id, event source, etc. http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx ...Show All
Game Technologies: DirectX, XNA, XACT, etc. device create fails
I tried to run my d3d application on a computer with an on board graphic card - and as a result the create device fails. I tried many to change the DeviceType, but it didn't help. I tried changing the XVertexProcessing options. stiill no good. What am i doing wrong Thanks. the Device constructor fails: m_PresentParameters = new PresentParameters(); m_PresentParameters.Windowed = true; m_PresentParameters.SwapEffect = SwapEffect.Discard; m_PresentParameters.BackBufferHeight = m_RenderWindow.ClientSize.Height; m_PresentParameters.BackBufferWidth = m_RenderWindow.ClientSize.Width; m_Device = new Device(Manager.Adapters.Default.Adapter, DeviceType.Hardware, m_RenderWindow, CreateFlags.HardwareVe ...Show All
Visual Studio Web Plug-in for SourceSafe 2005
I am trying to connect to my web based SourceSafe database using the 2005 plug-in from Visual Studio 2005 Team system on a client. Each time I try to access the machine I get an 0xC00CE556 error with no explanation. Does anyone know what this means and more importantly how to fix it Thanks for suggestions, but they are not helpful. I had try it, but with no success. In the web folder for SourceSafe web service are two files with XML text - web.config and VssService.asmx (there's a directive only). Both the files looks good, but the error resides... Some other ideas Thank you Vlado ...Show All
Visual Studio Team System TFS Install Crashes/Freezes Server
Using the msdn 180 trial version - Server 2003 R2 I am having an even bigger problem on installation. I too have followed the most recent installation guide. I have had my service accounts created and am running the installation from my domain account which is an administrator on the server. First tried a dual install. All the pre-reqs seemed to go fine and the db machine installed without a hitch... but on TFS install it goes about a 1/4" into the progress bar and the entire system freezes! No mouse... no keyboard... a red light even lights up on the front of the server which the system guys says is bad and asks me what i have done! ok move to a single install on a new VMware image. IIS installed after the image was added so it w ...Show All
.NET Development SNMP how can i?
hello. how can i use winsnmp32.dll in c# project.any sample code in order to use that dll in C# you will have to use interop capabilities provided in C# and you will hvae to port the structures used and declare the methods on ur own and will be a hefty process . how ever you can use the sockets in c# and easily do ur work as compared to that interop procedure . Following is the link that will give you a kick start and i hope it wiull be helpful PLease check this out it can help you to get started http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm ...Show All
Smart Device Development how to display image icon when shortcut is displayed in the MRU start menu?
Hi, I added a shortcut of my application to the Start Menu folder with a customized image icon. The image icon is displayed properly in the executable and in the shortcut in the Start Menu folder, however, when the shortcut is displayed in the MRU start menu, the icon is displayed with the default icon, my customized icon is not displayed. I use 32x32 pixel icon. Do you know how I can make the icon displayed on the MRU menu Do i need to copy the icon file to any special folder Thanks, Ares ...Show All
Visual Studio 2008 (Pre-release) Receive timeout
Hi! I can create a simple WCF application. In service I write: [ ServiceContract ] public interface IPhotoGet { [ OperationContract ] Image GetPhoto( string name); } ServiceHost svcHost = new ServiceHost ( typeof ( PhotoImplement )); svcHost.AddServiceEndpoint( typeof ( IPhotoGet ), tcpBinding, @"net.tcp://localhost/photo" ); svcHost.Open(); And in client I write: IPhotoGet photoGet = ChannelFactory < IPhotoGet >.CreateChannel(tcpBinding, new EndpointAddress ( String .Format( @"net.tcp://{0}/photo" , tbAddress.Text))); Image result = photoGet.GetPhoto(tbPhotoName.Text); pbResult.Image = result; When I try to execute method GetPhoto, which m ...Show All
Visual Studio 2008 (Pre-release) fisheye effect transformation, is it possible?
Hi, Is it possible to apply a non linear transformations like fish eye effect on WPF widgets thanks You would probably need to implement a BitmapEffect to achieve this type of effect. HTH, Drew ...Show All
Visual Studio Express Editions accessing outlook express address book using C#
Hi guys, can any one tell me how to access outlook express address book from C# or vb.net thank you Hi, I'm not quite aware of an managed API that accesses Outlook Express. All I know about is the managed API for Outlook. But there are 3rd party Outlook APIs that you may want to take a look at. http://www.nektra.com/products/oeapi/ cheers, Paul June A. Domag ...Show All
