Lexin Shan Dev's Q&A profile
Visual C# Random Division
Hello. I am currently generating 2 random int numbers that will be used to divide between each other (num1 / num2). However, I only want numbers that (when divided), result in an integer number that does not contain a decimal (or remainder). For example: Good numbers: 6/3=2, 10/2=5, etc, Bad numbers: 7/3=2.33, 8/6=1.33, etc. All help is appreciated. Thanks, that should not be that hard. just check if number1%number2 is more than zero. If it is you will get a decimal number like 1.5456, if not you will get an int. Look here for the %-operator: http://cplus.about.com/od/learnin2/l/aa082504e.ht ...Show All
Visual C# Enum question C# and VB
Why this code in C# not work but in VB work Code C#: public enum eFilteringCode : ulong { None = 0, Gen = 1, BdF = 2 } static void Main( string [] args { int BitMask = 400; ulong uRes = BitMask & eFilteringCode. Gen; } Code VB: Public Enum eFilteringCode As ULong None = 0 Gen = 1 BdF = 2 End Enum Sub Main() Dim BitMask As ULong Dim uRes As ULong BitMask = 400 uRes = BitMask And eFilteringCode.Gen End Sub If i write in C#: ulong uRes = BitMask & (ulong) eFilteringCode. Gen; it work but i dont'want make a cast, buy ...Show All
Visual C++ Redistribution of C runtime libraries without MSI installation
Hi guys, I'm trying to get an installer of our product working. I've finally gotten it compiling and running under VS2005. For various technical and political reasons, I have to use NSIS as our installation technique. This is where the problem begins. I can't quite see how to redistribute the relevant CRT libraries. I've been round and round in circles following the MSDN information, and various blog postings (e.g. http://blogs.msdn.com/martynl/archive/2005/10/13/480880.aspx ) but I've not been able to see how I can redistribute the CRT in this way. Obviously, merge modules aren't an option for me. I've tried pl ...Show All
Visual Studio Team System Activity: Cost a Development Task
MSF Agile prescribes that the dev has to cost the task which of course is logical. My question is: in which field of the WIT Task should the dev enter hers/his estimate and what is the prescribed procedure/algorithm . The wit Task has several fields that have to do with estimates and/or amount of work: baseline work, remaining work, work completed, but none of them maps to MS Projects “work” or “duration” fields. (Actually, only the MS Project’s “work” field would be the correct choice for setting the estimate, since the “duration” filed takes the calendar into account.) The wit Scenario has Rough Order of Magnitude field but ...Show All
Windows Forms Help needs with SaveFileDialog
Hi MS, I have some doubt in SaveFileDialog Control. Here i am explaining my problm Please try this,, Open word file and give \\\"save as\\\" in that dialog change the \\\"save as Type\\\" as .xml then u will get option to transform the xsl sheets. How can i do it programatically. I tried to use SaveFileDialog and set the filter as .xml but that transform option is not coming. How to enable that option. Please reply me Thanks in advance Regards Saravanan I don't think the standard SaveFileDialog has that functionality. I guess you have to create your own dialog. ...Show All
Visual Studio Express Editions USING SQL 2000 with VB 2005 Express
Does anyone know if you can connect and use SQL 2000 Server with VB Epress 2005 datasources tab wizard I use the datasources tab to try to connect but it keeps failing to connect. VB6 seems to connect fine using the data environment wizard. I can connect to the SQL 2000 database with code without any problems in VB Epress 2005. Hi Tommy, Express editions have design support for local data only (.mdf and .mdb files). The version/feature matrix is located here: http://lab.msdn.microsoft.com/vs2005/productinfo/productline/default.aspx hope that helps ...Show All
Windows Forms Problems Installing Terrarium Server
Hey Guys, I have been in the process of setting up a Terrarium Server for my school. I was able to get the whole thing installed on a fresh copy of Windows 2k3 Standard and with SQL Server Enterprise Running. Now I followed all of the directions to set the server up and it seems to have no problem allowing connectio ...Show All
SQL Server How to view permissions of user-defined database roles in Management Studio?
As part of our security project, I've done the following when logged in as 'sa': Created database roles 'dbrole1' within dbAccount Created login and user 'user1' and added user to be a member of 'dbrole1' Granted execute permissions on sp1 and sp2 to 'dbrole1' However, I didn't see the above permissions listed in SQL Server Management Studio - Database - Security - Roles - Database Roles - 'dbrole1' properties - securables Any ideas Thanks! Management Studio issues are addressed on the SQL Server Tools General forum. Note that the permissions can be obtained f ...Show All
Windows Forms Parent-Child relationship - Only want parent rows in datagrid
Hi all, I have a parent-Child table relationship. I'm binding the datagrid to the parent table but the child + sign shows etc. Is there a way to keep the relationship but not show the child rows in the datagrid Thanks in advance. You know it is amazing how during this adventure into .NET, I keep trying to do things the hard way& ...Show All
SQL Server source control integration
If my company is using ClearCase instead of VisualSource Safe, can I still leverage the new 2005 checkin/checkout features ...Show All
Visual C++ How is Arc Created
I want to understand the mathematics of Arc Method. I read documentation but still have not got it :( ... Can some one explain me the how arc is created from the Ellipse and rectangles . I shall be very thankful to you. The below topic might help: http://msdn.microsoft.com/library/default.asp url=/library/en-us/gdicpp/GDIPlus/aboutGDIPlus/linescurvesandshapes/ellipsesandarcs.asp It has some graphical explanation that might help you visualize the concept. Thanks, Ayman Shoukry VC++ ...Show All
Software Development for Windows Vista In vs.net2005, how I set the IIS if I use HttpHandlers in the web.config?
I had set the HttpHandlers in the web.config, if I started the web page from the VS.Net Explore solution, the web can run normally. But , if I started from the IIS virtual direction, the web page can't run normally. Pls help me and thanks! Looks like you accidentally hit the wrong forum - this is for Windows Workflow Foundation exclusively. Check this forum if you're having trouble finding the right one: http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=881&SiteID=1 Thanks! Angel ...Show All
Windows Forms General Question Web page look to windows forms application
I have to create a client heavy application and I have a couple of questions. I have created ASP applications using C# and VB and also windows app using both however, this for this application they want it to "look" like a web based application (imagemaps, gridviews, etc) but it is going to be tied to a single computer because it will be accessing USB ports and various peripherals. Should I create a project in C# and select Windows Application and try to make it look like a web page or create a web site, force the user to load IIS and run it locally Is it a pain to access specific hardware like USB ports with a ASP based web site ...Show All
Visual Basic shared member and inheritance : how to ?
Hi I have 3 classes : Base, Child1, Child2 Class MustInherit Base Shared Stuff As ... Sub DoStuff for each x in stuff ... next End Sub End Class Class Child1 Inherits Base End Class Class Child2 Inherits Base End Class For now the Child1 and Child2 instances share the same "stuff" parameter. But i want only the C ...Show All
Windows Forms Binding datagrid to data returned by DataReader problem
I am having problems with binding datagrid to an arraylist. The way I am doing it is asking for much code to be written in order to achieve a simple task. Here is an example ' Getting data Dim cmd As New OleDbCommand(strSQL, conn) Dim dr As OleDbDataReader Dim arr As ArrayList cmd.CommandType = SQLType conn.Open() dr = cmd.ExecuteReader(CommandBehavior.CloseConnection) simple so far, but now I am having troubles in storing this data to an arraylist, on which datagrid is going to be bound to. The way I am doing at the moment, is creating a class that has all the field's names as properties for EACH SQL statement, but it see ...Show All
