|
You can't have an ordinary method that returns different types using exactly the same input parameters. The best way to achieve this is to use a generic method:
private <T> GetValue<T>()
{
return value;
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
murktinez wrote: How can I create a function that can return in different data types.
You could box the output in an object;
object GetValue(bool test)
{
if (test)
return 1;
else
return "2";
}
The factory-pattern[^] might also be interesting
I are Troll
|
|
|
|
|
Does anyone know how to make a .NET app so that the files it generates cause previews of the file to show up in Windows Explorer instead of static icons? Even simply telling me what that concept is called would be helpful as the searches I'm trying aren't working. Thank you!
|
|
|
|
|
It's called Preview Handler[^] but it is not recommended to develop them in .Net
|
|
|
|
|
Thank you! The article you linked to appears to be related to the preview pane. I'm wondering how to create an add-in that causes a little preview to appear instead of the icon itself using traditional techniques that will also work in XP. I've seen some other apps do this so I know it's possible.
Coding it in C++ won't be an issue.
|
|
|
|
|
Hi everyone,
I would like start a 'simple' 3D project in C# and wonder how to start with.
Background:
The project is an application for my bicycle ergometer connected to my PC. I would like to display a cyclist in a 3D landscape, which, of course, moves depending on speed/rpm.
At first there is noch need in any landscape details, just a track with curves and a cyclist.
Questions:
1) Should I use XNA or Direct 3D or something else ?
2) Is there any sample (a race simulation or so) which I can use to start with ?
3) What are your experiences when you started programming 3D ? Is it necessary to go through dedicated tutorials or is there any chance to take come sample code to work with quickly ?
Regards
|
|
|
|
|
XNA is a fine environment to start with. You might want to take a look at this[^] site to get some help with it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
i need a web service code to send email from an external application using asp.net coded in c#.net. please do reply me at the earliest as this is of utmost urgency to me.
|
|
|
|
|
mennipavithra wrote: please do reply me at the earliest as this is of utmost urgency to me.
But not to us.
Tell us what you have tried, and what does not work, and maybe we will be able to assist. But we are not here to do your work for you.
|
|
|
|
|
Please read this[^] post. You need to play by the rules.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi, It seems you have joined codeproject today, so welcome to Code Project.
mennipavithra wrote: please do reply me at the earliest as this is of utmost urgency to me.
Quote Selected Text
This is Rude. Please read fourm guide line before asking any question. It may important for you, but not for all. So members will reply based on their time.
mennipavithra wrote: i need a web service code to send email from an external application using asp.net coded in c#.net
Did you ever searched google before asking this question ? Sending mail is one of the common things in .NET and if you know the basic of web service you can implement it.
1. You need to create an web service
2. Create method as SendMail(), which may accept From, To, MessageBody information as argument.
3. Host the Web Service.
4. Consume from Client
For your Reference :
A .NET web service for e-mail[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi All I have loaded 3 talbes to my application.
after the work is done, I wasnt to save it all. using foreach(is there a better way?)
I recreated from my different class objects 3 datatables.
now I have the tables, I think I added them to new ds
DataSet ds= new DataSet();
ds.Tables.Add(emp);
ds.Tables.Add(managers);
ds.Tables.Add(empToManagers);
did I do it write? no my main question: in my db , I have 3 tables. some of the lines has been changed, deleted or some lines are new. what is the best way to update the db, without checking every line my self, I tried and got lost with the sql. someone tokd me I can use adapter, but how?
(when I open th data, It is easy to se adapter
public DataSet GetDataSet(string tblName, string sql, DataSet ds)
{ adapter.SelectCommand.CommandText = sql;
adapter.Fill(ds, tblName);
return ds; } )
tnx
|
|
|
|
|
Look into DataAdapter.Update , but it has limitations.
I avoid DataAdapters altogether. 
|
|
|
|
|
|
|
Hi I am new to C#. I want print a document in Bill format.before that i have to display preview of bill to me.I am taking item,rate in textbox.Please help me . I want to display Store name in one corner of page. Items in table format and total at ent of page.Please help me
IT is urgent
|
|
|
|
|
umesh.nevase wrote: I want print a document in Bill format.
You should use the .NET Printdocument Class[^].
umesh.nevase wrote: IT is urgent
This is not considered polite; however urgent it may be to you, we have our own priorities.
|
|
|
|
|
there are different different way u can build report.u need crystal report and show the data source
|
|
|
|
|
khosnur wrote: u need crystal report
You really do not like this person do you, Crystal Reports is one of the greatest PITA on the market today, recommending this poor person, who is obviously a newbie, to use CR is a great disservice to him/her. There are many, better options than CR for report processing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
khosnur wrote: u need crystal report
No you don't. There are better options, like SSRS, Active Reports, etc. Besides, the OP just wants to print the document, not create a report.
only two letters away from being an asset
|
|
|
|
|
I have completed a simple windows project and wish to deploy it. I wish to create a proper installer like those that appear in professional applications. I don't wish to use the publish option form project properties as it just creates an executable. I also tried the Setup and Deployment project in other project type but got confused and messed up.
|
|
|
|
|
right click on solution-add new project-Expand other project type-Select setup and deployment...
try this way.
|
|
|
|
|
Khosnur,
I have completed till this step(before i posted the problem) but now there are three folders in list view appearing. Now what should i do?
|
|
|
|
|
|