|
For example (I'making changes directly on your code):
ClassBO BO = new ClassBO();
Dictionary<int, ClassQ> records = BO.GetDetails(Requiredparameters);
foreach(KeyValuePair<int, ClassQ> pair in records)
{
ClassQ record = pair.Value;
}
|
|
|
|
|
Try:
ClassBO BO = new ClassBO();
Dictionary<int, ClassQ> records = BO.GetDetails(Requiredparameters);
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
hello
dows anybody tell me how to solve this assignment?
A Windows desktop application, written in C#, is required that will allow a user to keep track of
family and friends contact details, and their birthdays.
Data must be stored in a Microsoft Access 2007 database, named 'Birthdays.accdb'
The database must contain a table named 'Details'.
The 'Details' table must contain the following data columns:
Id - A unique record identifier that should be used as the primary key
FirstName - The person's first (Given) name
LastName - The person's last (Family) name
Address - The person's Address and PostCode
Phone - The person's telephone number
Email - The person's Email address
DOB - The person's date of birth
By following the 'Contacts' application in the module notes, create an application that will allow the
user to manage the data in the database, (including Add, Update and Delete functions) and navigate
around the records, displaying each record's data.
|
|
|
|
|
That's really a nice practical piece of work which your teacher told you to do. Do not rely on other's work, as then you would not learn anything. Try it on your own, and you will likely learn a lot!
|
|
|
|
|
2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
How to get an answer to your question[^]
|
|
|
|
|
So you're so bad in class your teacher has you working over the summer? Doesn't look like things are getting better for you. Try burger-flipping-101 next semester.
|
|
|
|
|
From your assignment as listed, you have been given the names of everything, and a sample to follow. Since we don't have - and don't want - the Contacts application in the module notes, we have to assume it is pretty simple. Follow the example, changing as required.
You might find it is easier than you think.
You might even find you enjoy it.
Argh! I must be in a good mood! I was just polite to a "gimmecodez" clown! I need a lie down...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Boo.
|
|
|
|
|
But, since your Teacher specified Access, I can assume no real knowledge is being taught ... Open Access, File-New-Select Template from Web. I believe MS has your template available.
|
|
|
|
|
Maybe what you just said is the new knowledge being taught (sad as that may be).
|
|
|
|
|
You should consider yourself lucky to have such an assignment.
One can learn a lot from such an "app". This is almost like a real world scenario.
I had all kind of stupid meaningless 4000+ console kind of apps for assignments.
Personally I would love to help you out.
But do it yourself. And ask only what you can't figure out yourself or by using bingle.
I bug
|
|
|
|
|
Unlike the other respondents in this thread, I'm actually going to take the trouble to help you out and answer your question: "Yes".
/ravi
|
|
|
|
|
Hi guys,
I have search the web for how I can make some C# code, that connect to some network equipment (such as a switch).
I have read about sockets and TcpClient. Normally I connect my network switches through Telnet (TCP port 23), and sending the switch telnet commands there. I want my own C# app to make this command call to a given switch, with a single click from the user on a buttom.
How can I make a connection to a network switch with C# code? there is username and password for security on the switches, so I have to pass them too somehow in the connection session... Any suggestions? Sockets or tcpClient?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:02am.
|
|
|
|
|
That example is with TcpClient, it may work too.
But I actually managed to get a simpel 'ena swi po=x' telnet command working through Socket connection to the switch. I don't know is there is any of them that are pref from another?
|
|
|
|
|
Hello,
I need to get the name of the Object using Reflection, but I am getting all information about how to get the name of the Type using Reflection rather than the Object. For example, I got the following code,
public class Demo
{
public int ID { get; set; }
public string Name { get; set; }
}
private void button1_Click(object sender, EventArgs e)
{
Demo myDemo = new Demo {ID = 10, Name = "Kab"};
var theType = myDemo.ID.GetType();
MessageBox.Show(theType.Name);
}
When I click the button1, The message box shows "Int32 ", but I need to see "ID ". Would you please tell me how I can achieve this goal!
Regards.
|
|
|
|
|
The Type object for the ID field has no knowledge of the Demo class.
If you want to get the name "ID" you will have to do it through the type object of Demo, and get a FieldInfo of the field ID. The property Name of that FieldInfo object will hold the string "ID".
That does not sound very useful to me though, because you already had to know that the field is called ID to find it in the first place.
|
|
|
|
|
Hi Harold,
Thanks a lot, so sounds like, I will have to use a method within a FieldInfo where the passing argument will be the name of the field "ID" in this case, right ? If so, then, yes, this solution is not useful, because as you said, I will have to know the name "ID" before I can get it from FieldInfo. Is not there any other solution which can give me the result "ID" from the passing object without passing the string "ID" ?
|
|
|
|
|
There can be, will ID be the only field? Or will there be some other distinguishing feature about it, such as ID being the only field of type Int32 ?
|
|
|
|
|
Hi Harold,
Thanks for the reply again. No, there could be more integers in the Demo class. But I want to pass the object to a method where the method needs to extract the name of this object "ID" in this case from reflection without asking any more information. So, sounds like, I cannot do that with .NET 4. Anyway, thanks a lot for your suggessions.
|
|
|
|
|
I don't think you could do it at all, not even theoretically, how would you know which field to choose?
Would a custom attribute to mark it be an option?
|
|
|
|
|
Hi Harold,
No, the object is actually a LINQ to SQL Model, so I cannot add custom attribute (unless I dont want to re build the LINQ to SQL Classes by Visual Studio). So, I give up Thanks again.
|
|
|
|
|
If this field is primary key and you're using LINQ to SQL, then check ColumnAttribute (you can view it by opening source file generated by LINQ to SQL engine). There's a property IsPrimaryKey, which may be useful to you.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
Basically you can't. You could override the ToString method of Demo to return "ID" though.
|
|
|
|
|
Hi,
Yes, thats what I see, I can't get this information. I hope future version of .NET will allow us to do that.
|
|
|
|