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
M

MrColeyted

@MrColeyted
About
Posts
17
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XML Serialization
    M MrColeyted

    That would work if I were trying to only store data from one running of the app. However, I am really trying to be able to make the XML file grow through each subsequent running of the app. I could perhaps use your idea of deleting the file each time, if I could figure out how to get each object in the file into a collection on form_load so that they could be written back to the file when the app is closing. I am having a hard time getting my code to work with multiple objects. Is there a way to do this? Thanks. Btw, the code from my original posting is not complete.

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    Visual Basic xml json help tutorial

  • XML Serialization
    M MrColeyted

    Hello all. I am trying to write a simple program that defines a Car class and writes an XML Serialized Car object to an XML file. This is a Console app. Right now, I have the XMLSerializer Object defined and initialized with Module Scope. Within the main method, I create a filestream and a streamwriter that I pass to it to write the serialized Car object to the file. This works fine, but when I re-open the program after closing it, it cannot read the object back in once more than one have been written to the .xml file. I assume that this is because when a second object is written to the file, the xml header is re-inserted into the same file, and it is throwing the reader off. I have posted me code below. I am trying to learn how to read and write XML with VB. Any help would be appreciated. Imports System.Xml.Serialization Imports System.IO Public Module Module1       Public xs As New Xml.Serialization.XmlSerializer(GetType(Car))       Dim car1 As Car       Dim car2 As Car       <Serializable> Public Class Car             Public Make As String             Public Model As String             Public Color As String             Private year As Integer             Public Property TheYear() As Integer                   Get                         Return year                   End Get                   Set(ByVal value As Integer)                         year = value                   End Set             End Property             Public Sub New()                   Make = "Chevy"                   Model = "Camero"                   Color = "Tan"

    Visual Basic xml json help tutorial

  • Cannot Use IIS
    M MrColeyted

    I have tried to reinstall IIS several times. I have used the CD, as well as downloaded what others online have said was a .rar file of the IIS files. But I do not know how to use the latter. While reinstalling IIS (through control panel\add remove programs\add remove windows components) it only gave me an option of where to find the files the first time, which is when I was using the cd. Since that did not work, I suspect that it has something to do with an environment variable, or a setting that I do not know about.

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    modified on Wednesday, March 11, 2009 2:13 AM

    ASP.NET asp-net help csharp database sql-server

  • Cannot Use IIS
    M MrColeyted

    Hello all. I am using a laptop that is running Windows XP Professional. The other day, a breaker in my house kept constantly tripping. It was the breaker that my laptop was plugged into. My computer shut down, and when I booted, I got an error that a file in C:\WINDOWS\System32\config was corrupt. I was able to use the XP CD to replace the corrupt file, but now I have some serious issues. Aside from the absence of all of my SQL Server servers (SQLExpress, other named instances), I cannot open or create any ASP.NET Websites that rely on IIS. When I open the MMC for IIS, there is nothing there. I do not know what to do. I have tried: - Rebooting the machine (several times) - Running aspnet_regiis -i from the VS cmd in the v2.0.50727 dir - Running 'regedit.exe add HKLM\system\... to add a variable (this was recommended in another forum that I read) - Running DCOMCNFG and placing a tick in the use internet services box Since I cannot do a system restore that restores beyond the time that I repaired the system originally, I do not know what to do!:confused: Please help. I need IIS to work for my ASP.NET development.

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    ASP.NET asp-net help csharp database sql-server

  • Create object from a database
    M MrColeyted

    Hello all. This question deals with some ADO.NET, in addition to ASP.NET. I am creating a website in which a user will be able to customize clothing (hats, t shirts, etc.). I will have a database that stores images, colors, etc. as well as customer info. I will need to be able use the fields from my database (color, size, image, etc.) in order to create a product. Can anyone help me out, or point me in the direction of some good resources that may help to shed some light on my problem. Any help would be greatly appreciated.

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    ASP.NET help csharp asp-net database sales

  • Assemblies
    M MrColeyted

    Hello all. I have a couple of questions regarding assemblies. Can an assembly contain other assemblies? Can an assembly directly contain types? Any help would be appreciated. Thanks. :cool:

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# help question

  • Assemblies
    M MrColeyted

    Hello all. I have a couple of questions regarding assemblies. Can an assembly contain other assemblies? Can an assembly directly contain types? Any help would be appreciated. Thanks.:cool:

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    .NET (Core and Framework) help question

  • Move to Next Column DataGridView
    M MrColeyted

    Thank you kindly.:cool:

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# database visual-studio help tutorial

  • Move to Next Column DataGridView
    M MrColeyted

    Can anyone give me a code snippet for how to move to the next column of a DataGridView to insert a value. In this case, there is no DB connectivity. I am creating an application that retrieves the property names and values for a control and populates a DataGridView with these values. I can do this: foreach (PropertyInfo prop in t.GetProperties()) { dataGridView1.Rows.Add(prop.Name); dataGridView1.Rows.Add(prop.GetValue(controls[index], null)); } However, this puts the values in the same column. I have 2 columns in the gridview, and would like the output to appear similar to the properties window in VS. Any help would be greatly appreciated. Thanks!:cool:

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# database visual-studio help tutorial

  • Reflection Question
    M MrColeyted

    My friend, I could kiss you! Thank you so very much. That did it!

    "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# help database data-structures regex json

  • Reflection Question
    M MrColeyted

    Hello all. I am in dire need of some help. I have a project that I need to complete STAT! Here is the rundown: I have a form. This form has six controls on it. They do nothing. I have another form that retrieves these these control in a Control[] array. On this second form, there is a comboBox and a richTextBox. The comboBox is populated with the names of the controls. I have absolutely no problem getting the names of the properties; I can get them fine. I cannot get the value of each of these properties. I know that there is a GetValue(object, object[] index) method that is supposed to return the value of a property, but I can not get it to work to save my life!:confused: I have included the code from the SelectedIndexChanged event of the combobox, and the class that represents a property below. Assume that the rest of the program works because it does. If the GetValue call is dropped off the end of the last line below, all of the properites' names are properly listed in the textBox. Please show me how I should call this method. Any sugestions would be greatly appreciated!:cool: private void myCboBox_SelectedIndexChanged(object sender, EventArgs e) { //creates an int to hold the selected index: int index = myCboBox.SelectedIndex; //creates a type variable: Type t = controls[index].GetType(); MyProperty Myproperty = new MyProperty(t.Name, null); PropertyInfo[] myProps = t.GetProperties(); foreach (PropertyInfo p in myProps) { richTextBox1.Text += "\n" + //The GetValue call is whats killing me! //Throws a TargetException //Going crazy here! Please help! p.Name + "\t\t\t\t" +p.GetValue((object)Myproperty, null); } } } public class MyProperty { public MyProperty(string aName, object aValue) { theName = aName; theValue = aValue; } private static string theName; public static string theNameProp { get { return theName; } set { theName = value; } } private static object theValue; public static object intTest2 { get { return theValue; } set { theValue = value; } } } "If you don't know w

    .NET (Core and Framework) help database data-structures json question

  • System.Reflection GetValue method
    M MrColeyted

    Hello all. I need some assistance. If I have a form that has buttons (or any Control(s)) on it, and I want to be able to populate a datagridview at runtime by selecting the control name from a combobox, how do you call the GetValue(object, object[] index) method on it to get the value of the property. I have no problem getting the list of property names, but I cannot get the values!:mad: This code works. All but the GetValue method. I keep getting a 'TargetException: Object does not match target type' error. Please give me a code example of how to properly call this GetValue(object, object[] index) method. Once again, The method that updates the gridview(right now it is a textbox in this code; I will change it later) and the class that handles the properties: private void myCboBox_SelectedIndexChanged(object sender, EventArgs e) { MyProperty Myproperty = new MyProperty(null, null); //creates an int to hold the selected index: int index = myCboBox.SelectedIndex; //creates a type variable: Type t = controls[index].GetType(); PropertyInfo[] myProps = t.GetProperties(); foreach (PropertyInfo p in myProps) { richTextBox1.Text += "\n" + //This GetValue(object, object[] index) //is what I need to know how to do: p.Name + "\t\t\t\t" + p.GetValue(Myproperty, null); } } } public class MyProperty { public MyProperty(string aName, object aValue) { theName = aName; theValue = aValue; } private string theName; public string theNameProp { get { return theName; } set { theName = value; } } private object theValue; public object intTest2 { get { return theValue; } set { theValue = value; } } } "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# help tutorial database regex

  • Reflection Question
    M MrColeyted

    The first form does. It has an array of Controls that are populated by the Controls that are on it. There is a method, GetControls() that returns the array of Controls. Form2 then loops through that array and populates the comboboxlike so: foreach (Control c in controls) { comboBox1.Items.Add(c.Name); } I know that this is working because when the code is ran, if you take away the faulty attempt to call the GetValue(object, object[] index) method, all of the property names are properly displayed in the richTextBox. I need to know the proper way to call the GetValue(object, object[] index) method to get the property values, given the way that I am going about the logic. Thanks. "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# help database data-structures regex json

  • Reflection Question
    M MrColeyted

    Hello all! I have a college project due tomorrow and I am in dire need of some assistance! The project requires that I create a plain windows form with six controls on it; I have chosen six buttons. Form2 will be the startup form, will have a combobox and a DataGridView (I am using a richTextBox right now, but will change that once the rest works). The names of the controls from Form1 populate the combobox in Form2. By selecting one of the controls from the combobox, all of that controls' properties are then listed in the DataGridView. I have most of it working, but I cannot get the value for each property using the GetValue(object, object[] index) method. I have tried all that I can think of, but cannot get it to work. :mad::confused: The code that I have for Form2 is as follows: Here, the main problem is on the bottom line of code. I have commented there. public partial class Form2 : Form { //Declares an Array of type Controls: Control[] controls; public Form2() { InitializeComponent(); } private void Form2_Load(object sender, EventArgs e) { //Creates an instance of Form1: Form1 myForm = new Form1(); //Initializes the Control[] by calling the getControls() method on Form1: controls = myForm.getControls(); //Adds the Control names to the ComboBox: foreach (Control c in controls) { myCboBox.Items.Add(c.Name); } } private void myCboBox_SelectedIndexChanged(object sender, EventArgs e) { //creates an int to hold the selected index: int index = myCboBox.SelectedIndex; //creates a type variable: Type t = controls[index].GetType(); //clears any previous entries: richTextBox1.Clear(); foreach (PropertyInfo prop in t.GetProperties()) { //Here, the GetValue method will not work! I have tried passing everything that I can think of to it //and still it will not work. It keeps telling me that target object does not match. //Please help. richTextBox1.Text += "\n" + prop.Name + "\t\t:" + prop.GetValue(t, null); } } } "If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra

    C# help database data-structures regex json

  • DataBase Connectivity with ASP.NET
    M MrColeyted

    Hello all! I am new to the ASP.NET arena. I have a college project that I am doing that requires me to build an e-commerce website (my own idea, that will be online after it is completed). I need to know several things. I will list them below, and if anyone can point me toward some good research material, I would greatly appreciate it!!! The list of needed topics are as follows: - Stored Procedures (within ASP.NET) - Link ASP.NET login control to my SQL Server 2005 database (not through the Membership class) - Anything else that may be of help that relates to Data access and manipulation within ASP.NET I hope that I am not being to vague here! If anyone has any suggestions that could be of direct assistance, that would be great. However, I am simply asking for some pointers to some valid research material. I have some books coming in the mail, but I need to get a head start on this project, as it is due in 6 weeks! :-D Any help would be greatly appreciated! Thanks.

    ASP.NET database csharp asp-net sql-server sysadmin

  • Populate TreeView node by clicking item in ListView
    M MrColeyted

    Thanks for the feedback, but I have researched these things and I don't see how to do what I need, which is not add a node, but rather redraw the treeview to repopulate an existing node. For example: if I click the program files directory in the treeview, the directory is expanded in the treeview to show all of the folders; all of the folders and files are displayed in the listview. What I need to do is this: by clicking on a folder in the listview, lets say the Adobe folder, I want the Adobe folder in the treeview to be expanded to show all of the folders one level under the Adobe folder. Of course this should work for as many clicks in the listview as the user performs. Any suggestions?:confused:

    C# question help

  • Populate TreeView node by clicking item in ListView
    M MrColeyted

    Hello all. I am new here; a student of programming! I am developing an app similar to Windows Explorer. I have everything working great. But I have one question: Can anyone tell me what I may need to do to be able to click on a directory in the Listview and repopulate the Treeview in the left pane?:confused: Any help would be much appreciated!

    C# question help
  • Login

  • Don't have an account? Register

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