C#
|
|
 |

|
If you do that (and I'm not saying you should or shouldn't) you probably ought to at least define a class to hold each entry and then have Dictionary<string,MyClass>
|
|
|
|

|
Do you mean like this?
public class Companies
{
public static String Company1 { get { return "Company1";}}
public static String Company1City { get { return "Company1City";}}
public static String Company1State { get { return "Company1State";}}
public static String Company2 { get { return "Company2";}}
public static String Company2City { get { return "Company2City";}}
public static String Company2State { get { return "Company2State";}}
}
or like this?
Public Class Company1
{
}
Public Class Company2
{
}
|
|
|
|

|
Maybe more like the latter, but do you really need two classes? If so, possibly add a third (abstract) one, and an Interface! Oooh! And an equality operator! And and and...
|
|
|
|

|
sarcasm >
No idea how to achieve all of that. Sorry. Beginner here.
But your enthusiasm is, nice.
|
|
|
|

|
class Company
{
public string Name { get; set; }
public List<Loan> Loans { get; }
public Company()
{
this.Loans = new List<Loan>();
}
}
class Loan
{
public string CompanyName { get; set; }
}
static class Main()
{
Dictionary<string, Company> companies = new Dictionary<string, Company>();
foreach (DataRow row in companyDataSet.Tables["Company"].Rows)
{
Company current = new Company();
current.Name = row.CompanyName;
}
foreach (DataRow row in loanDataSet.Tables["Loan"].Rows)
{
Loan currentLoan = new Loan();
currentLoan.CompanyName = row.CompanyName;
companies[currentLoan.CompanyName].Loans.Add(currentLoan);
}
}
|
|
|
|

|
Huor,
Thank so much for your time. This is very helpful and at least sends me in the right direction!
It seems like most experienced programmers are too jaded to offer help here. Like giving a handout to a poor person that hasn't helped themselves.
Like I'm just looking for a handout because I'm too stupid to google or use the "search" features. "Oh please Mr programming constultant, help me for free, please, my family is dying from starvation and and...my dog has fleas...I need more code"
"Begone peasant!! I have no time for new coders! I'm solving much higher and more important recursion problems and pointer issues! Why don't you use the search feature."
Bah!
|
|
|
|

|
I linked some file to my project (console project). I have two questions:
1) Is there a way to edit the link, without doing it manually? (is there the link path written somewhere in the project?)
2) Can I commute the link in a local copy of the linked file quickly?
Thanks
Germoz
|
|
|
|

|
I'm unsure exactly what you are asking, but maybe I can shed some light for you anyway.
The project file is just XML and a regular included source file may look like this:
<Compile Include="CompileException.cs" />
A linked (Add as link) file may look like this:
<Compile Include="..\PIEBALD\Types\XmlNode.cs">
<Link>XmlNode.cs</Link>
</Compile>
Because it's XML, you can edit it, but you should make a backup and be careful.
I use linked files a lot.
|
|
|
|

|
You get perfectly the point! Very helpful
Thanks a lot
|
|
|
|

|
hi guys , im using zeromq dll for making server/client program . the program works fine . but i want to run the setup of the program that i have made , in other computer with(win xp). it w'll throw an error
System.DllNotFoundExpection:Unable to load Dll 'libzmq':The specified procedure could not be found.(Exception from HRESULT:0x8007007F)
at ZeroMQ.Interop.zmq_init(Int32_threads)
at ZeroMQ.ZmqSocket..Ctor(int32 type,Nullable 1 context)
at ZeroMQ.ZmqDealerSocket..ctor()
at ChatClient.Client.Main(string[] args) in c:\my Development\ZeroMq\ZeroMQ_ChatTest\ChatClient\Client.cs:Line 13
but i have already attach the libzmq in the folder . so can any one tell me what's the problem ?
and sth more , it'll not throw an error if i run the setup on win 7 .
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin