|
What should be the obj in this case?
|
|
|
|
|
obj is the instance of the object you are using. The one with your attributes and properties. Really, if you check the MSDN on the topic it is relatively thorough.
|
|
|
|
|
Got it, Thanks all for your help
|
|
|
|
|
Hi...
my program is working on my lan but not on internet... what shud i do to make it run on internet...
|
|
|
|
|
Add Forward Port to your Router
I know nothing , I know nothing ...
|
|
|
|
|
i dont know how to do it.. can u plz.. guide me..
|
|
|
|
|
I hope I am asking this in the correct forum but I couldn't find a more appropriate one and I am using C#
I am receiving data from a number of different third parties. Each data item has a month as a string. This month comes in a variety of different formats; Aug-10, Aug 10, Aug 2010, Aug-2010, Aug10, Aug2010, August 2010, August-2010. You get the general idea. I want to transform this into a single format, Aug 2010. I need to do this for any combination of month and year. My solution at the moment is to separate the alphabetic part from the numeric part and then rebuild the string using the first three letters of the alphabetic part, add a space, add "20" if length of the numeric string is 2, then add the numeric string. Whilst this works, it's messy and I am not overly comfortable with it, there must be a better way.
Anyone got any clever ideas they would like to share?
Thanks in advance,
Adam
|
|
|
|
|
Convert all input data into a date time type. Set the day to 1. You may then use standard formatting strings to display and change your date display at whim.
To aid in deciphering input, add spacing and add the text, "1st" to the end and then try using System.DateTime.TryParse to see if it can understand the format. If not roll your own for each one that doesn't fit.
|
|
|
|
|
Use regex for interpreting the date parts at least. Then any captured month could be substring'd (0,3) to reformat it. And, Ennis's suggestion would be good to be sure it is a valid month.
|
|
|
|
|
Thanks, I will give it a go.
|
|
|
|
|
DateTime date = DateTime.Now;
string dateStr = date.ToString("MMM yyyy");
It ain't rocket science.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi John,
Thanks for the response, however, that's not my question. My question was whether there was a quick way to read all the different string formats for the month and outputting them in a unified way without having to do lots of string parsing.
Thanks anyway,
Adam
|
|
|
|
|
Hi All
I have just a basic doubt regarding using objects of type System._ComObject .
Once I know the underlying type, in oder to retrieve the right type of class, is it always correct to use the as keyword like this?
MyConcreteClassType o = myComObject as MyConcreteClassType;
if ( o != null )
{
}
|
|
|
|
|
Don't post the same question in two places - it duplicates work and annoys people. I have deleted the Q & A version.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I forgot to delete it.
Apologizes for that.
|
|
|
|
|
Not sure about the "always", but yes it is safe. Thc interop engine does the marshalling for you by implementing the appropriate type conversion. You can do it manually using th Marshal-utility.
|
|
|
|
|
Can you tell me how to solve this error please?
ClassBO BO = new ClassBO();
ClassQ records = new ClassQ();
//GetDetails returns Dictionary<int, ClassQ>
//Error on this line i.e. BO.GetDetails(Requiredparameters)
records = BO.GetDetails(Requiredparameters);
lblFirstName.Text = records.FirstName.ToString();
lblLastName.Text = records.LastName.ToString();
...
Error:
Cannot implicitly convert type 'System.Collections.Generic.Dictionary<int,ClassQ>' to 'ClassQ'
|
|
|
|
|
arkiboys wrote: //GetDetails returns Dictionary<int, classq="">
So why you try to assign a result from GetDetails directly to ClassQ (records is of type ClassQ )!?!?
|
|
|
|
|
Hi,
How else can I get the values please?
|
|
|
|
|
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.
|
|
|
|