Click here to Skip to main content
       

C#

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: DataSet to Dictionary Join?memberPIEBALDconsult17 Jan '13 - 12:34 
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>
GeneralRe: DataSet to Dictionary Join?memberRickSharp17 Jan '13 - 12:51 
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
{
 
}
GeneralRe: DataSet to Dictionary Join?memberPIEBALDconsult17 Jan '13 - 13:03 
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...
GeneralRe: DataSet to Dictionary Join?memberRickSharp17 Jan '13 - 13:13 

 
No idea how to achieve all of that. Sorry. Beginner here.
 
But your enthusiasm is, nice.
AnswerRe: DataSet to Dictionary Join?memberHuorSwords17 Jan '13 - 21:18 
class Company
{
	public string Name { get; set; }
	
	public List<Loan> Loans { get; }
	
	// The other properties / columns goes here...
	
	// Constructor
	public Company()
	{
		this.Loans = new List<Loan>();
	}
}
 
class Loan
{
	public string CompanyName { get; set; }
	
	// The other properties / columns goes here...
}
 
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;
		// Fill here the other properties...
	}
	
	foreach (DataRow row in loanDataSet.Tables["Loan"].Rows)
        {
		Loan currentLoan = new Loan();
		currentLoan.CompanyName = row.CompanyName;
		// Fill here the other properties...
		
		companies[currentLoan.CompanyName].Loans.Add(currentLoan);
	}
	
	// FillGridViewWithDictionary(companies)...
}

GeneralRe: DataSet to Dictionary Join?memberRickSharp18 Jan '13 - 7:02 
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!
QuestionLinking files to a projectmemberTheGermoz17 Jan '13 - 8:43 
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
GeneralRe: Linking files to a projectmemberPIEBALDconsult17 Jan '13 - 9:12 
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.
GeneralRe: Linking files to a projectmemberTheGermoz17 Jan '13 - 9:44 
You get perfectly the point! Very helpful
Thanks a lot
QuestionError : System.DllNotFoundExpectionmembermohammadkaab17 Jan '13 - 6:37 
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 General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid