Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

VJ Reddy

@VJ Reddy
About
Posts
46
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • <<specificVersion>>'True'<<specificVersion/>> is not satisfying
    V VJ Reddy

    I think changing the the FrameWork to which the project is targeted from IDE may be easier than doing it in the code. To change from IDE, right click on Project concerned in the Solution Explorer, select Properties menu option, in the opened form, select the Application tab page and in that select the required FrameWork in the Target Framework combo box.

    C# csharp visual-studio wcf json help

  • Integer to Time Conversion
    V VJ Reddy

    I think the following points may be helpful. Use DateTime.ParseExact to parse the time

    DateTime startTime = DateTime.ParseExact("1330","HHmm",
    System.Globalization.CultureInfo.InstalledUICulture);

    similarly parse the end time. Now find the duration between end time and start time using the Subtract method of DateTime object which returns a TimeSpan object. Then get the total minutes using the TotalMinutes method of TimeSpan object. Use the AddMinutes method of DateTime to add minutes to the end time Then get the string representation of modified end time using

    string endTimeString = endTime.ToString("HHmm",
    System.Globalization.CultureInfo.InvariantCulture);

    C# tutorial

  • DropDownList is giving following error : System.NullReferenceException
    V VJ Reddy

    As explained here http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.datakeys.aspx[^] When the DataKeyNames property is set, the GridView control automatically creates a DataKey object for each row in the control. The DataKey object contains the values of the field or fields specified in the DataKeyNames property. The DataKey objects are then added to the control's DataKeys collection. Use the DataKeys property to retrieve the DataKey object for a specific data row in the GridView control. The reason for null reference exception in the above code could be due to not setting the DataKeyNames property but accessing the DataKeys[e.RowIndex] value at

    customer.Update(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString())

    Try setting the DataKeyNames as shown in above reference like

    datakeynames="CustomerID"

    ASP.NET csharp asp-net design data-structures debugging

  • convert part of a list to an array
    V VJ Reddy

    Thank you :-D

    C# data-structures tutorial

  • convert part of a list to an array
    V VJ Reddy

    Really good answer. 5!

    C# data-structures tutorial

  • convert part of a list to an array
    V VJ Reddy

    Good answer. 5!

    C# data-structures tutorial

  • convert part of a list to an array
    V VJ Reddy

    Good answer. 5!

    C# data-structures tutorial

  • convert part of a list to an array
    V VJ Reddy

    I think the Take extension method of IEnumerable can be used for this purpose as shown below:

    List<int> data = new List<int>(){1,2,3,4,5,6,7,8,9,10};
    int[] array = data.Take(5).ToArray();

    The Take method takes specified number of elements or the total elements of the list if the total is less than the specified number.

    C# data-structures tutorial

  • Row Not Found Or Changed
    V VJ Reddy

    As observed in the data of line 40 given above in 022N02177 0 is zero instead of letter 'O'. But if that is the case and the part number is not found then the execution should go in to the if (part == null) block. But I want to share what I have noticed and please see whether the issue is because of that.

    C# csharp database linq help question

  • about calculator in c#
    V VJ Reddy

    If you want to break the text into two parts on entry of + character then I think the KeyPress event of TextBox can be handled to replace the + character with \n as shown below:

    TextBox textBox1 = new TextBox();
    textBox1.Multiline=true;
    textBox1.Height=100;
    textBox1.KeyPress += (s, args) => {
    if (args.KeyChar=='+')
    args.KeyChar= '\n';
    };
    Controls.Add(textBox1);

    If you want to retain + and then break the text into next line then replace args.KeyChar = '\n'; with SendKeys.Send("{ENTER}"); To run the above code, create a Windows Forms application in C#, place the above code in the Form.Load event handler and run the application.

    C# csharp tutorial

  • how to display membar and dealing with other in wpf
    V VJ Reddy

    Please see this reference http://stackoverflow.com/questions/3797034/confused-with-wpf-combobox-displaymemberpath-selectedvalue-and-selectedvaluepath[^] I think it may be helpful.

    WPF tutorial question csharp wpf

  • ActiveX controls are not supported.
    V VJ Reddy

    Please these posts http://www.devinfo.org/di-support/users/kb.php?id=10010[^] http://stackoverflow.com/questions/989663/unable-to-get-window-handle-windowless-activex-controls-are-not-supported[^] on similar issue. They may be helpful.

    C# csharp visual-studio com help question

  • include a file
    V VJ Reddy

    I think if the requirement is to call a function from an unmanaged DLL then DllImportAttribute class explained here http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx[^] may be helpful. #define being a preprocessor directive as explained here http://msdn.microsoft.com/en-us/library/yt3yck0x(v=vs.90).aspx[^] may not be suitable for the specified purpose.

    C# csharp question

  • Expand the text in the RichTextBox.
    V VJ Reddy

    Please see this Code Project article Fast Colored TextBox for Syntax Highlighting[^] by Pavel Torgashov. It may be helpful.

    C# help csharp com tutorial question

  • Remove a XMLnode - Pls help
    V VJ Reddy

    You're welcome. After trying please give your feedback and if it is helpful you may consider to vote. Thank you for the response.

    XML / XSL xml help

  • Remove a XMLnode - Pls help
    V VJ Reddy

    The ReplaceChild method of XmlNodeclass explained here http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.replacechild.aspx[^] can be used for replacing the desired nodes as shown below:

    void Main()
    {
    string xmlCounters =
    @"<GetCountersResult>
    <GetCountsResult xmlns="""">
    <Count>
    <ID>FP108MR</ID>
    <Value>0</Value>
    <Part>Z9999</Part>
    </Count>
    </GetCountsResult>
    <GetCountsResult xmlns="""">
    <Count>
    <ID>FP108MR No2</ID>
    <Value>0 No2</Value>
    <Part>Z9999 No2</Part>
    </Count>
    </GetCountsResult>
    </GetCountersResult>";

    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(xmlCounters);
    var countNodes = xmlDoc.GetElementsByTagName("Count");
    //foreach throws, the element list has changed, error
    for (int i=0; i < countNodes.Count; i++)
    {
        xmlDoc.DocumentElement.ReplaceChild(countNodes\[i\], countNodes\[i\].ParentNode);
    }
    string fileName = @"F:\\ModifiedXml.xml";
    xmlDoc.Save(fileName);
    

    }

    //The contents of file

    // <GetCountersResult>
    // <Count>
    // <ID>FP108MR</ID>
    // <Value>0</Value>
    // <Part>Z9999</Part>
    // </Count>
    // <Count>
    // <ID>FP108MR No2</ID>
    // <Value>0 No2</Value>
    // <Part>Z9999 No2</Part>
    // </Count>
    // </GetCountersResult>

    XML / XSL xml help

  • Datagridview
    V VJ Reddy

    Please do not post the same question at two locations. This question was already posted under Quick Answers section.

    Visual Basic csharp help announcement

  • handling ctrl+mouse click on webbrowser control in winform
    V VJ Reddy

    You're welcome. Thank you for the response. If you feel that the answer is helpful then you may consider to vote the answer.

    C# question html data-structures

  • handling ctrl+mouse click on webbrowser control in winform
    V VJ Reddy

    Please see this article. Easy way to add Keyboard and Mouse events to WebBrowser control[^] I think it may be helpful.

    C# question html data-structures

  • simple memory leak
    V VJ Reddy

    Good references. 5!

    C# performance question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups