Answer Questions
sifacomp A question of OO structure...
Hello All, I'll do my best to explain what I'm trying to accomplish and look forward to any and all suggestions you have for the "proper" way to do this (realizing there is no 100% correct way, but some methods are more optimal than others). I apologize in advance for my n00bness. For this example, I'll use football (american) players. I want my Player class to have a List<Stat> collection of my Stat class. Each Stat, which is an indicator of how well a player plays a particular position, should have a base value but be able to return a "true" value which is a calculation of the base value plus a percentage of one or more other stats. For example: a Player's Halfback stat might be base value plus 50% of the Fullba ...Show All
cdemez Write text over images...
Hi, How can I write a text over a image, defining the position of the text... Like I have a picture of a man holding a whiteboard and inside it I want to write "Enter"... I have the coordinates already... Thanks I don't believe it's possible unless you do alot of messing around with unmanaged code. The Chanel 9 link i posted may do it. I don't need to save the image but print it on an aspx page...How do I write this image to a page... Let's supose that the image path is "C:\temp\foto.jpg" What image format is the image you're opening OK, That's solve my problem but I got this error " A Graphics object cannot be cr ...Show All
smilyan Creating a Datatable from a ArrayList
I have a datatable and when i add the rows to it....I click my OK button when i click my OK button I add all the rows to an arraylist...then i loop thorough my arraylist and insert the values into my database.....How would one go about getting those values out of my database back into the arraylist and back into the datatable....I know how to put it in the database but i am kinda cloudy on how I would get it back out and into my datatable....any help with this well you would use a SqlDataReader to read the values back 1 by 1 and store it into an arraylist. But you are better off using a SqlDataAdapter to fill the dataset/datatable with values and update the database when you change values in the dataset/datatable and avoid the who ...Show All
Iram smtp client/server for password recovery, logins etc
Hi all, Just found this forum tonight so I hope I'm posting in the right place - I didn't see any other topics that seemed to relate to my problem. Firstly, I'm a rookie with this stuff! I have a uni project I am in the middle of doing. It has been going well and my visual C# website is looking really good. I do however have a problem. I cannot seem to set up the server to send emails. I have options in for members to recover their password, change password, etc. However, when the user fills in the boxes and clicks submit, an error screen comes up to do with the email/smtp. I have messed about with it for hours and got nowhere. When I go to ASP.NET config web page to try and set the application smtp up that way it pre-selects 'Port 25'. My ...Show All
SoniaJulka Left Shift (<<) problem
I try to left shift 18 digit and got wrong value. This is my very simple statement Console.writeln(7 << 18); I got value approx 1,800,000 real value should be 117,440,512 What wrong am I thx Everything is right. You dec "7" is just "111" binary representaion. When you move it on 18 bites to the left u got 1,835,008 dec representation To get 117,440,512 u need to shift you "7" on 24 to the left Thank you very much ^^ ...Show All
iamman SqlCommand is undefined value
I am trying to connect to my Sql Server 2k5 but it tells me that cmd has an <undefined value> when its executing any reason this could be.....Is there anything missing from my code i didnt think it was but just trying to see if i can get a lil help. thanks string connection = System.Configuration.ConfigurationSettings.AppSettings["connstring"]; SqlConnection cn = new SqlConnection(connection); string quu = "SELECT * FROM Class"; cn.Open(); SqlCommand cmd = new SqlCommand(quu,cn); SqlDataReader dr; dr = cmd.ExecuteReader(); while (dr.Read()) { Console.WriteLine(dr.GetValue(0).ToString()); Console.WriteLine(dr.GetValue(1).ToString()); Console.W ...Show All
Davids Learning unsafe code compilation in Visual Studio.NET
hi there ! I am extreamy new in vs.net and I can not compile the unsafe code through VS enviornment , there must be some thing for that but I dont know how thanks To add a little bit to what Mattias said, you can open the project properties by either double-clicking on the Properties node in Solution Explorer, or by right-clicking on the project and selecting properties. The option is "Allow unsafe code" and it appears on the Build tab of the properties that open (it's the 3rd checkbox on the page). Hope that helps! Anson You can include /unsafe in the compilerOptions attribute in the <compiler> element in web.config. [Moved post to the C# IDE forum] Yes you can enable use of unsa ...Show All
AdeptBlue Disposing singleton class
How should i dispose a singleton class Lets say you have many forms that have a singleton instance (singletonclass implements IDisposable). ie public class Form{ private SingletonClass instance = SingletonClass.GetInstance(); } id like to know when the singletonclass should be disposed Should I keep a counter in the singletonclass and then check when the counter hits 0 (when a form disposes, it decrement the counter of the singletonclass), then called dispose of the singletonclass But that seem not really secure. Cuz i mean .. in a class .. you could call SingletonClass.GetInstance() as many time as you want .. and the counter will keep incrementing, but only one form is having the instance of the singletonclass. Thanks, ...Show All
perun Unable to debug C# solutions
I'm using Visual Studio 2005 Pro. This problem is repeatable with archived code on backup discs as well as new solutions. When I attempt to run my apps in Debug Configuration with breakpoints, I get the message: the following module was built either with optimizations enabled or without debug information. D:\Programming\Solutions\******... To debug this module, change its project build configuration to Debug Mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option. Here's a screenshot . This is done with a brand new solution. File > New > Project > C# > Windows/Windows Application > Ok > Build > Run. [update] as par this thread , I've tried restoring factor default settings. ...Show All
Leebert Loading Class library dll
How to load a .net class library dll dynamically from a .net windows application using vs 2005. Hello, Look at Assembly.Load function. Then to create an instance of a class from your library, you can use the CreateInstance function: object theInstance = assembly.CreateInstance( "MyAssemblyNamespace.MyClass", true, BindingFlags.Public | BindingFlags.Instance, null, null, null, null ); Richard Loading DLL dynamically at runtime is achieved through Reflection. See System.Reflection namespace and better search some article on google about Reflection. I hope it'll work. Cheers ;) ...Show All
YellowShell Console Application & Parameter
A basic question! I have a Console Application with two parameters: static void Main( string [] args) { string importFileName = @args[0], exportFileName = @args[1]; After compiling the aplication I got a “setup.exe” and a “MyApp.application”. After executing the “setup.exe” I go to the cmd and I try: MyApp.application file1.txt file2.txt But the application does not receive the Parameters and I got a System.IndexOutOfRangeException exception. I also have try the MyApplication.exe from Debug and it works. But I can not using this in the intranet becasuse I don’t have access to the files. What do I have to configure to make it work ...Show All
Jonathan MacCollum Using the "as" Keyword
Will using the "as" keyword when using type conversion not through an Invalid cast exception If so how would i make this statement the same but use the as keyword instead of the = _EndingVendorLegs.EndID = ((Tracking.BusinessObjects. StopOrderLegDetail )tempOrderManifest[ this .tempOrderManifest.Count - 1]).StopID; I want to see if it could be _EndingVendorLegs.EndID as ((Tracking.BusinessObjects. StopOrderLegDetail )tempOrderManifest[ this .tempOrderManifest.Count - 1]).StopID; but i get "type expected" I am not sure how i need to code the line,,,, any help hi, Divide the statement into two like: Assuming Tracking.BusinessObjects. StopOrderLegDetail is typeX, that TypeX Instance = t ...Show All
Ro0ke Creating a Wizard-Style Application
My current project is to develop a wizard-style application, with next, back, cancel, etc. I'm running into a problem with how I should implement the wizard. My first thought was to use panels for each step, but this quickly became overwhelming when I had 30 panels of the same size, all on top of each other. I had to use Send to Back repeatedly until I got to the step that I wanted to work on. My next thought was to use separate forms, but I don't like this approach very much either. I would have to copy over the elements that stay the same on each step (the navigation buttons) to each from and line them up. This takes too much work. Lastly, I thought of maybe making my own control, similar to a tab control, only the ...Show All
jcnconnect How can I access parameters given from the Command Line?
If I choose to run a program the following way Start > Run "MyCSharpApp.exe" "Some Text" How do I access "Some Text" TIA Mike Well, I went to the start menu - run and typed "AppPath.exe" "ParamHere" The program code look somthing like this for(iny i = 0; i < args.Length; i++) { Console.WriteLine("Param {0} = {1}", i, args[ i ]); } The program wrote nothing... Any Ideas Thanx Mike Didn't work, any other thoughts TIA Mike If you are creating a Windows application, than unfortunally Console.WriteLn does not do anything. While in the debugger you see the output in the output window, but if started from the commandline it doesn't. The Windows app does not ...Show All
chakravarthy_b building project having many main class
Hi I want to build a project which contains classes each of them having own main method. Is it possible for me to compile the project without specifying starting class(class with main) (i can specify starting class during execution). This is possible with Eclipse IDE used for Java. The starting class is need to be specified only during execution. Could any body help me in this Thanks Natarajan Arumugam. Natarajan Arumugam wrote: Hope i should be more clear. My project contains 2-3 classes having main method. Is it possible for me to build the soln You cannot compile a project having more than one main functions in it. You must have only one entry point in a single ...Show All
