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

Software Development Network >> Visual C#

Visual C#

New Question

Parent and Child Tables
ANN: Native C# Protection for C# 2.0 (ver. 2.0.0) released
How can I call C function in VC#2005? Please do me a favour, for example
Struct Problem
PInvoke and C "char **"
Events
Creating arrays of fixed size of PInvoke
Comparing values in an array and SqlDataReader?
Cancel downloading data from a Sql Db
overloading == operator in c# fails checking for null values

Top Answerers

Adithi
Joe Villa
Andrey M.
StriderIRL
sql server2000
DiasVFX
ReLoad
OLE72
sticky
Agent00
HaXml
Only Title

Answer Questions

  • UppyJC Using User32.dll's InvalidateRect

    Unless anybody has a better suggestion, I am trying to redraw a portion of the desktop using InvalidateRect from User32. Basically, I have an image that I am drawing to the desktop, and need to clear where it was just drawn before drawing the next frame. I'm currently failing miserably (i.e. nothing happens) with this code: Rectangle Rect = new Rectangle (GetPosition(), _i.Size); WindowsAPI . RECT lpRect = WindowsAPI . RECT .FromRectangle( Rect ); IntPtr ptrRect = Marshal .AllocHGlobal( Marshal .SizeOf(lpRect)); Marshal .StructureToPtr(lpRect, ptrRect, false ); WindowsAPI .InvalidateRect( WindowsAPI .GetDesktopWindow() , ptrRect, true ); internal class WindowsAPI { [System.Runtime.InteropServices. DllImport ( ...Show All

  • GeorgesZ How to design a class which can be used as "Enum"?

    Example: public Enum Type{T1, T2, T3}; Type myType = Type.T1; string typeFromDatabase = "T1"; myType = typeFromDatabase; // This is a obvious error!! Can I design a class whose functionality is just like "Enum" and much more powerful Oh...yeah... I could not rember Enum.Parse is the better solution... myType = (Type) Enum.Parse(typeof(Type), stringFromDatabase) I think that Enum.Parse is more efficient...anyway it is easier. In this case you have to adapt your own logic. On Example: Switch(stringLetter) { Case "A" myLetter = Alphabet.Aplle; break; Case "B" myLetter = Alphabet.Boy; break; } et ...Show All

  • John Mathews How to change Disk's volume Serial

    Any one can help me with C# code to change Volume Serial of a disk drive. Thank you in advance You can change the VolumeLabel of a drive by the following example...but i m not sure about volume serial System.IO. DriveInfo d = new System.IO. DriveInfo ( "E" ); d.VolumeLabel = "NewLabel" ; using System; using System.Collections.Generic; using System.Text; using System.Management;   namespace WMIDiskSerial { class Program { static void Main( string [] args) { ManagementObject diskObj = new ManagementObject ( "win32_logicaldisk.deviceid=\"c:\"" ); diskObj.Get(); Co ...Show All

  • George2 Object reference not set to an instance of an object.Help

    my code Going on the limited information you gave, I would guess that, either one of your controls do not exist (like " Il " / " Kategori ") or one of the cells you're looking for by index does not exist. Which line throws the exeption -Ernst Te ekkurler Mustafa abi denedim o sat r sizin soyledi iniz sat rlar de i tirdim ama yine ayn hatay veriyor. Yani yapmak istedi imi herhalde anlam s n zd r.DataGrid uzerinde baz alanlar n dropdownlist olmas gerekiyor.Ve ItemBound olay nda bu i lemleri yap yorum. Ama hata veriyor.Checkbox kontrolunde hic hata vermedi ama bunlarda hata veriyor.Yard mlar n icin sa ol. DropDownList ddlIlce=(DropDownList)e.Item.FindCon ...Show All

  • DigitalPenguin Make end of statement ";" optional?

    I think microsoft should make the end of line statement, (i.e. the ";") optional. If you program VB.net like I do and is inevitably forced to write/read C# code, having to write the ; after each statement is annoying. I know C/C++/java etc all have it but in an enviroment like Visual studio where the IDE makes life so much easier the end of line statement is unnecessary. Who agrees with me I know that people with a C like language background would most likely not agree but I don't mind the underscore for spanning multiple lines of code in VB, though it too can be annoy sometimes it does make code more clear (like oh, this line of code spans 3 rows). But remember I'm talking about people that comes from VB, not from C/C++ e ...Show All

  • narend How to get values of form controls in MDI application?

    Hi.. In an MDI application if i have a parent form & 2 child forms. In that application how i can get values of parent form controls(e.g. textbox text or a boolean variable) form child form & from child form how i can get values of parent form controls (e.g. textbox text or a boolean variable). Thanks, Vinay Hi... Thanks for your reply... I am new in C#...can u sggest me any detailed document on what u have explained or can give more explanation on what u wrote... Thanks, Vinay When you want to access child form control values from parent form then you should create a properties in child form that will return controls values. If the ...Show All

  • netpicker9 editing the datagridview control in windows forms?

    Hi.. I need to edit, cancel and use the paging option( as used in web pages ) in windows forms. Is it possible to write code in windows forms using c# for the above operations DataGridViewPageEventArgs is available in webpages, is there any similar parameter in windows forms Is it possible to edit the contents of the datagridview in windows forms using c# please help. The Windows Forms DataGridView doesn't provide paging, as it's not really that useful - it's used in the web control to reduce data downloads and so on. Why are you trying to do it in a Windows app You can change the values in the DataGridView like so: dataGridView1.Rows[0].Cells[0].Value = "xyz"; or by chan ...Show All

  • KC sharad writing new value in app.config

    I have problems to set a value for a connectionstring, why this error occurs code Configuration .Configuration config = Configuration .ConfigurationManager.OpenExeConfiguration( Configuration .ConfigurationUserLevel.None); config.ConnectionStrings.ConnectionStrings( "Conn1" ).ConnectionString = "testing 123" ; config.Save(); app.config < xml version = " 1.0 " encoding = " utf-8 " > < configuration > < appSettings > < add key = " Setting1 " value = " Very " /> < add key = " Setting2 " value = " Easy " /> </ appSettings > < connectionStrings > < add ...Show All

  • singam How to make my function more generic ??

    Let's say i have these 2 function void foo1() { Class1 classArray[] = GetArray(); for(int i=0;i<classArray.Lenght;i++) { console.WriteLine(classArray ); } } void foo2() { Class2 classArray[] = GetArray(); for(int i=0;i<classArray.Lenght;i++) { console.WriteLine(classArray ); } } as you can see .. the 2 function does exactly the same thing .. the only difference is the objet class1, class2 .... its just an illustration of my problem .... id like to do a more generic function... possible If you want to use generics, the following code will take an array of most any type and print out the class name: void UseArray<T>(T[] classArray) { foreach (T classInsta ...Show All

  • hazz c++ char*

    I have a c++ structure c++ typedef struct{ char *pDataBuf; long nSize; }FRAME_TYPE; c# struct FRAME_TYPE{ char* pDataBuf; long nSize; } C# gave me an error. I read to use byte instead of char for unmanaged c++ but in c++ char* is used as a null terminated string. What do i need to declear my char* as in c# Hi, you can use pointers in C# directly like char* but you have to use "unsafe" keyword in your method definition e.g. static unsafe void DoSomething(){ char* p; . . . } hope this helps cheers I am passing it from C# to an unmanaged c++ dll. Did u mean intptr instead if intpatr I'm afraid you cannot avoid unsafe b ...Show All

  • Reaction Why is not OK to pass in a Collection<int> parameter in a Web method?

    Hello there. I have a web service that contains the following web method: using System.Collections.ObjectModel; ... [ WebMethod ] public void GetUsers( Collection < int > userIds) { // Do something here } Now, I have a Windows client that web references the above web service and consumes the web method: using System.Collections.ObjectModel; ... private void GetUsersData( ) { Collection < int > myUserIds = new Collection < int >(); myUserIds.Add(1); myUserIds.Add(2); myUserIds.Add(3); myUserIds.Add(4); myUserIds.Add(5); localhost. Service myService = localhost. Service(); myService.GetUser(myUserIds); // Problem here!!! } The ...Show All

  • Dmitry Lizorkin is as Keyword

    I have a general event handler function. and has a general object passed to it, but I have to use a "is" or "as" to decode the type, is it possible that the base class can detect the type and call the function for that type I don't what to use methodinvoke because it is so slowwwwww. Another apporach would be to anonymous delegates would help but I don't like putting several delegates in one method to handle each type.. and I would have to use continutions to continue the event pump... (ie see robots framework for an example) And I don't want to declare delegates for each type because this means more work for the programmer... void handler(baseobject ev){ if (ev is MyEvent) { MyEvent evmy= (MyEvent)ev); ...Show All

  • dbldown768 how to write into XML

    i have a text file that has delimiters. (i.e. MSH|^~\$|ADMIT|CLAY COUNTY MEMORIAL|||200502110938||ADT^A01|00860|P|2.2|||||| ) Using C# i need to Read this file, segment by segment and write these segments into the appropriate XML tags of a XML file I have considered the datas within the delimiters as segments. i.e. my segments would be as below MSH ^~\$ ADMIT CLAY COUNTY MEMORIAL 200502110938 ADT^A01 00860 P 2.2 The empty space within the delimiters are considered as null data Now i want to write these segments into XMl file within its appropriate tags. i have a text file that has delimiters. (i.e. MSH|^~\$|ADMIT|CLAY COUNTY MEMORIAL|||200502110938||ADT^A01|00860|P|2.2|||||| ) Using C# i need to Rea ...Show All

  • PeteJM01 OnShutdown() method is NOT being called ?!

    Hi all experts, I am using VS Pro 2005 and Win XP Pro. I have developed a C++ Window Service to detect the shutdown event and perform some tasks before desktop shutdown. I have followed the MSDN instruction and assigned CanShutdown to TRUE. However, I found that OnShutdown() method is not being called. Could anyone please help me Many Thanks The following sample codes are attached for your reference: =============================== virtual void ABCWS::ABCWSWinService::OnShutdown() override { ServiceStatusLog->WriteEntry("ABC Shutdown"); } void InitializeComponent(void) { .. this->CanShutdown = true; .. } =============================== ...Show All

  • Thomas Ren&amp;#233; Sidor error 17 in sql server

    hai , using sqlconnection string , iam trying to connect to sql server , but it shows me the error " error #17 server doesnot exist or access denied ". pls can anybody help me in this regard . what i have to do to fix this problem. Thanx in Advance Did you ever get any help with this I'm experiencing the same problem and it's driving me nuts. Bryce This forum is dedicated to Winsock Kernel questions. Please repost this question to a forum dedicated to SQL data programmability ...Show All

515253545556575859606162636465666768

©2008 Software Development Network

powered by phorum