Software Development Network Logo
  • Visual Studio
  • Visual C#
  • IE Development
  • Audio and Video
  • Visual FoxPro
  • SQL Server
  • Windows Forms
  • Windows Vista
  • SharePoint Products
  • Game Technologies
  • Smart Devicet
  • VS Team System
  • .NET Development
  • Microsoft ISV
  • Visual C++

Software Development Network >> Visual C#

Visual C#

New Question

Debugging a multithreaded app
Get the computer Id
Get custom type by sting-parameter
messagebox.show() problem
Graphics
MouseOver Event
stackalloc in two dimensions?
How do I query data from sql server database?
How to get string from dll call?
Stripping out \r\n\0 characters from strings

Top Answerers

bird.tw
mcgin1591
Corinna Vinschen
adrshen
qrli
Cla82
codekaizen
regthesk8r
wuzzle
SidharthMalhotra
Custom Technology Instruction
Only Title

Answer Questions

  • Arjun B string

    i have a string called str and a char array called dizi. i have an if statement.if the string hasn't one of array members the if statement must be run.but it isnt working of course.where's my mistake :( if (!str[j].ToString().IndexOfAny(dizi)) { gecici = str[j] + gecici; index[l] = j; l++; } First of all, if (!str[j].ToString().IndexOfAny(dizi) != -1) is the same as if (str[j].ToString().IndexOfAny(dizi) == -1) which is a bit easier to understand. However, assuming str is a string, str[j] is a character and dizi is an array of characters, you'd be much better off convert dizi to a string, and reversing the search: string strDizi = new string (dizi); for ...Show All

  • Gregory William Johnson Problems with error CS0118!!!What to do???

    Hello.I wan't to create a animation in DirectX so I went to this site http://www.riemers.net/Tutorials/DirectX/Csharp/tut2.php to learn.But I receive error CS0118!!!Why Here are te content of the files: Program.cs: using System; using System.Collections.Generic; using System.Windows.Forms; namespace The_City { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { using (TheCityEngine EngineConnection = TheCityEngine()) { EngineConnection.InitializeDevice(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new TheC ...Show All

  • ORIONSQL2005 Dynamic Variable's Type Declaration

    Hi, Given name of type, how can I declare a variable with this type Let's say that classes B,C and D derives from A. Given textual input "B", I'd like to declare variable as following: List<B> myList = null; Thank you That's not exactly what I need. Actually, what I've got with Activator.CreateInstance is an "object" that I still need to cast. I'd like to have a declaration like this: List<"B"> myListOfB = null; Thank you Hi in c# you would use the Activator class http://msdn2.microsoft.com/en-us/library/system.activator.aspx and more specific the Activator.CreateInstance method http: ...Show All

  • monkeynova Approach for creating class method

    I am in the middle of a big dilemma. In my app, we have tons of methods for selecting information based on different filters, an in many cases bringing different fields/attributes as well. I thought of naming the methods based on the filter names (e.g. SelectEmployeeOnName (name) would bring all employees that have that name), other option would be to overload a lot of methods, but then this might not work in the cases where I had n methods with the same filter structure, differing only in the returned structure (the object). Any idea on this boban.s wrote: Some method are of course in Customer class like a method that returns all orders or transactions for current customer instance. You should never put Data ...Show All

  • MatthewFisher Object Oriented Programming

    Hi all. Im a C++ Programmer that just moved to C# and am having problems learning about classes and objects, i just cant seem to understand it. Im not sure whether i have the wrong book, so any advice and help on the best place i can learn OOP for C# from would be much appreciated. Thanks. Although the programming is different ,the thinking in them are the same ,and in the C# ,the oop is more comletely ,The Book named Tinking In C# which discuss the oop and how to realize in C# as the core point will be useful for you ,. I did OOP with C++, and started to learn C# but then stopped programming for 6-7 months. Now i dont remember much on OOP and its concepts, thats the problem.Im confused ...Show All

  • bulad Best external data storing

    Good day, I'm almost not experienced with C#, and lately I have been doing the Absolute Beginners Tutorial with the RSS Reader thing ( url ). Anyway, the person who made these video's prefered Microsoft SQL Server Database File to store the data, which is indeed very handy to use. But after finishing my RSS Reader I found out no one else could use it simply because they don't have an SQL server running. I was quite surprised because I didn't even know there was one running on my PC, it seems VS did that all in the background. Actually it's quite stupid I didn't think of this earlier. :p Now my question is, what's actually the most regular way to store a database withouth having to run an SQL server in the background I could of course use f ...Show All

  • PaulWill The correct way to Windows service

    Hi all, This is some kind of philosophy question. What is the correct way to build windows service And what exactly do I mean My WS (windows service) have timer and every 1 minute it execute method that need to do something. the method need to run on different thread, and it can be stopped during executing. So, Whet is the correct way using timer thread timer timespan and wait and how can I stop executing Here's an example: namespace WindowsService1 {     public partial class Service1 : ServiceBase     {         public Service1()         {          ...Show All

  • Jessica Alba Code convention

    Hello, As a development team leader I have a difficulty to exlpain logically the following case: We write code in c#, designing classes that will hold data(stored in SQL DB). Let's say for example a class which will hold the DB user information. The DB table will hold the followin columns: [UserID],[UserFirstName],[UserLastName],etc... Now the class will hold the following properties: UserId,FirstName,LastName. The question is why using "UserId"(as the property name) and not just "ID" like any other native objects in the .net framework Thanks, Itzik Paz. There is not a problem in using ID but just for better readability userID will be good... Best Regards, Rizw ...Show All

  • scottydog Simple binding to Datarow - values don't update???

    Hi, I have a loop that is populating label controls from a Datatable. If I simple bind the datarow to the labels' Text property, when I update the Datatable I expected the changes to be reflected in the label. This is true if I bind the the table directly. // this shows the correct values but they don't update when I update the data in the table ... templabel.DataBindings.Add("Text", dt.Rows[i ] , "state"); ... // when I bind directly to the table, updating the table does reflect the changes. But this option is no good as all my label controls have the same values. ... templabel.DataBindings.Add("Text", dt , "state"); ... What I'm trying to achieve, is when I update the data in the table the changes are reflected automatically in the bo ...Show All

  • Sreecharan How to access a generic method argument in the following example:

    The calling code looks as follow: Session[KeyName] I need to know the value of the KeyName inside the Session property below. private static Dictionary < string , object > m_Session = new Dictionary < string , object >(); public static Dictionary < string , object > Session {       get        {             //need to check here whether a requested dictionary KeyName             //exists before attempting to return its value.             return ...Show All

  • pojee386 Passing properties as delegates

    Let's say I have the following: class Foo { private int myInt; public void SetInt(int i){myInt = i;} } And then somewhere else, I have this: delegate void MyDelegate(int); // Define a delegate that matches the signature of the Foo.SetInt function class Bar{ void DoStuff(MyDelegate someDelegate){ .... } // A function taking the delegate as an argument } Now I can easily pass SetInt as a delegate to the DoStuff function, no problem there. But what if I'd used a set property instead of the SetInt function, like so class Foo { private int myInt; public int MyInt{ set {myInt = value;} } } Is there any way I can then pass the MyInt property as a delegate to another function I suppose I could do it by wrapping it in an ...Show All

  • NBaig this keyword's cons, pros or nothing?

    Hello, I just installed Resharper Addon of Visual Studio and it pointed all the code where i used this keyword with a warning saying its a redundant qualifier. Its just my habbit to put a this keyword with instace variables so I can distinguish between function level and class level variable. But i dont know what effect "this" has Why Resharper is saying its redundant I'll be really happy to know what's effect of "this: keyword on the application code. Best regards, Rizwan Hello Mathew, Thank for your contribution too. I really loved to see something from you here :). I also use this for the same purpose as you do. By the way using _ in identifiers is a really bad habbit/practise when you are working in . ...Show All

  • Cyber Sinh Multi Interface inheritance

    Lets say you have two interfaces: interface IA: IComparable { int A {get; set;} } interface IB: IComparable { int B {get; set;} } and a class which implements both IA and IB class C: IA, IB { } class C now has to implement CompareTo, but the problem is that CompareTo should do different things if being used to compare this object to another IA, IB or classC. How do you implement the CompareTo function For instance lets say there is code like this: C c1 = new C(); C c2 = new C(); IA ia = c2; int comp1 = c1.CompareTo(ia); int comp2 = c1.CompareTo(c1); In this case, comp1 should equal 0 if c1.A == c2.A, and comp2 should equal 0 if both c1.A and c1.B are equal to c2.A and c2.B. Since you can only have one CompareTo method on class C how do ...Show All

  • Juvefan Program hangs on InvokeAsync

    I have a program using SOAP. When I call the SoapHttpClientProtocol.InvokeAsync method, the program freezes and cannot be terminated by any means (not even end process or end process tree in the task manager). This problem does not occur if the program is started in Visual Studio in debug mode. The web service seems to be up, and the program was working before without any changes to the code. What did you have to change in the firewall settings I found the source of the problem, my firewall. It seems that when I rebuild the application, the firewall generates a new rule for the new executable, which makes sense. Starting the program under Visual Studio in debug mode sub ...Show All

  • Albion Simon Guide on Cross Threading

    Anyone have a good guide on cross threading Essentially, I'm trying to access a Windows form control outside of the thread it was created in. Any help would be greatly appreciated. no worries. Basically you need to invoke the UI control so it can then do the operation you requested, its the correct way of handling UI controls when accessing from one thread to another. The InvokeRequired is just a bool value which indicates if the control/UI control requires to be invoked in order to access it, if so, it will then call the method again from the "owner" of that control and do whatever it is that needs to be done (in the else statement) http://msdn2.microsoft.com/en-us/library/system.windows ...Show All

474849505152535455565758596061626364

©2008 Software Development Network

powered by phorum