|
|
You might have better luck getting an answer in the WPF forum.
|
|
|
|
|
Hello all,
I'm new to c# and I'm having trouble accessing a custom built .dll that is referenced from my Microsoft visual studio 2010 c# console project.
The CaraPartnersSdk.dll has 2 files from what I can see. which are:
using System;
using System.Collections.Generic;
namespace CaraPartnersSdk
{
public class CarCollection
{
public CarCollection();
public IEnumerable<Car> FindByName(string name);
public Car GetByID(int id);
}
}
I know this class some how will help me access the collection of cars. I need help parsing through this collection so I can retrieve an individual car. I have no idea how. Please, excuse my dumb question I know its pretty dumb but I have spent a long time trying to figure this out but I can not.
This is the other class "Car":
using System;
using System.Collections.Generic;
namespace CaraPartnersSdk
{
public class Car
{
public Car();
public string AlternateForm { get; }
public Condition Condition { get; }
public IEnumerable<Car> ConnectsToCar { get; }
public bool HasBeenOpened { get; }
public int ID { get; }
public string Name { get; }
public string OptionalAttributesXml { get; }
public decimal Price { get; }
public string Set { get; }
public int Strength { get; }
}
}
For now, I just want to print out all the car names from the collection of cars. I would just like to do it in a simple main class but I've had great difficulty in doing so. Any help is much appreciated. Thank you.
Best,
Adrian
|
|
|
|
|
|
|
And you thought that reposting it with a totally unrelated subject line would help?
|
|
|
|
|
Um, no. I'm new to the forum and new to c#. I do not believe its a totally unrelated subject line. If it is unrelated please forgive me almighty guardian watcher of codeproject.com. I just need some direction, if your not willing to help then do not attempt to convict me by saying I'm posting unrelated subject lines. Maybe, next time you can say something as "how is this related to a database?" I don't know, I'm just saying. That is very rude.
Best,
Adrian
|
|
|
|
|
|
adrian564 wrote: That is very rude.
As opposed to this little rant?
You are a self professed newbie here, so my advice would be to choose your words more carefully when responding to one of the outstanding members of this community.
Take some time re-familiarize yourself with the guidelines and etiquette here and you will get better results.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I did not mean for it to offend anyone, I'm just frustrated with this problem. My only concern was he could have wasted his time trying to help instead of condemning me by discouraging future viewers from helping me solve my problem. But, you are probably right, I am the new guy and I will review the guidelines and etiquette here. Obviously, I am doing something wrong.
Best,
Adrian
|
|
|
|
|
On your original post you didn't give details, and didn't answer when asked about the error you received, so no one could help.
|
|
|
|
|
Mark Nischalke wrote: one of the outstanding members of this community
May I quote you on that?
|
|
|
|
|
Some one must have hacked my account. I don't know where that came from
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi
I have a xml file and i want to load data from this to a table in sqlserver by using C#.would you please help me ?
thanks.
|
|
|
|
|
1) Read XML file
2) Open connection to MsSQL
3) Write data to SQL
4) Commit changes if necessary.
What part are you having problems with?
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
2)Write data to SQL. i want to write it by using dataset , how should i do that ?
|
|
|
|
|
So you want to use a DataSet to ReadXML, correct?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I am trying to create a class that is NOT abstract but is inherited from an abstract class. When trying to create this class using Activator.CreateInstance, I get an error saying: "Cannot create an abstract class". However, I am not tyring to create an instance of an abstract class rather a class that can be instanciated and is not abstract. See code below...
Any ideas?
Thanks in advance.
<pre>
namespace Test
{
[Serializable]
public abstract class Cls1
{
...
public static Cls1 Open()
{
Cls1 provider = null;
string typeName = "Test.Cls3";
Type t = Type.GetType(typeName);
provider = Activator.CreateInstance(t) as Cls1; // <----------- Error Here
}
}
[Serializable]
public abstract class Cls2 : Cls1
{
...
}
[Serializable]
public sealed class Cls3 : Cls2
{
...
}
}
</pre>
-- Modified Wednesday, April 7, 2010 3:08 PM
|
|
|
|
|
Seems to be a bug in VS2008 or could be my crappy Lenovo Laptop. Restarted computer and problem is gone.
|
|
|
|
|
Is it me or is there very little or no information with developing\calling the
Microsoft.Office.Interop particually Microsoft.Office.Interop.MSProject?
Ive googled, msdn etc..
Does anyone know of any really good links\resources or how to work with this?
Im looking, at how to assign uniqueIds to resources, tasks etc and general info
thanks
|
|
|
|
|
|
I am using a folderbrowserdialog to have the user browse for the location of a folder. Once it is located it is copied to a text box. Can I change the text properties of the text box so that path remains there?
Thanks for any help.
Darrall
|
|
|
|
|
I am not sure what you are trying to achieve, but if you want to put the path in a text box so teh user can't then change it, the set the ReadOnly property of the text box to true.
The still leave the question: why put it in a text box if you don;t want the user to change it? Why not use something the user isn't used to changing - a label?
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
It's not a matter of the user changing it - it's that I want it to still be there when the application is closed and reopened. The reason for this is there are text files that are in the program. When you create the text files they are assigned the full path of the application. To access those files I have to hard code the paths in the program. Now some other user stores it in his computer someplace different than me and the paths are all wrong. This way I use a folderbrowserdialog to find the path. I chose a textbox for convenience but the idea is to only have to do this once...not every time you open the application. If after doing it the first time if the properties of the textbox text are that path it is loaded right into the program. Hopes this makes sense.
|
|
|
|