|
|
Ok the following is a lambda:
Func<..> func = i => i * 3;
And this is an anonymous delegate
Func<..> func = delegate (int i) {return i * 3; ) ;
But what about this?:
Func<..> func = (int i) => { return i * 3;}
Is this considered a lambda, due to the fact it uses the lambda syntax..
Or is it considered an anonymous delegate due to the fact that it can not be converted to an linq.expression
Im I right if I say that it is infact an anonymous delegate and that only the "one line" forumulas w/o any { } body are real lambdas?
If it is considered a lambda, since it uses the lambda syntax after all. and it also benefits from type deduction and all that.
Is there any word or way to make a difference between one line lambdas that can be turned into linq.expressions and those that only can fill the role of plain old delegates?
modified on Monday, January 07, 2008 3:06:45 AM
|
|
|
|
|
I want to implement some reports in C#, what will be the best approach?
|
|
|
|
|
|
Hi All,
I am new in c#.I want to read the file till End.how can I do?
please urgent!
Regards,
chanzeb
|
|
|
|
|
use File.ReadAllText(filePath)
|
|
|
|
|
I have VB.NET code shown below.
Module Module1
Sub Main()
Dim objClass1 As New class1()
objClass1.MyProg(Nothing)
End Sub
Public Class class1
Public Function MyProg(ByRef objStruct As MyStruct)
End Function
End Class
Public Structure MyStruct
Public a As Integer
End Structure
End Module I need to convert this to C# equivalant. So I wrote the following,
class Program
{
static void Main(string[] args)
{
Program p = new Program();
p.MyProg(null);
}
public void MyProg(ref MyStruct objMyStruct)
{
}
}
struct MyStruct
{
} In VB.NET code compiles correctly. But C# shows error saying that "invalid parameters". How can I pass a null value to a reference parameter ? I know a structure instance can't be null. But how does this happened with VB.NET ? Any idea's ?
|
|
|
|
|
Hi,
a parameter that is to be considered a ref (or an out) needs a ref (or out) keyword
both at the caller and the callee.
however "ref null" is not acceptable since null "is not an assignable variable".
So you need to use a variable as in:
objStruct dummy=null;
objStruct dummy=new objStruct();
p.MyProg(ref dummy);
|
|
|
|
|
Thanks. I did the same. But how come this worked for VB.NET, stupid VB.NET
|
|
|
|
|
hi all
I need to insert a date value to the database through the form(using insert button).in the database i have declared date as datetime type.while inserting the data iam getting some problems.is there any way to insert only date (without time)through the form.
pintoo
|
|
|
|
|
No. Time will be inserted automatically. You can avoid showing the time when you do select. Look into Convert[^] function.
|
|
|
|
|
Hi All
I wount to creat Form In .Net Have One ProgressPare .
And I Wount to Call this Form In Any OPeration Fill DataTable From DataBase The ProgressPare Value is Equal The Persenteg of number Rows Is Load in to Datatable to The Number Of Rows from DataBase .
I wount to know the Idea Who I Can do that ?
Thanks For Any Body Hellp me
Thaer
|
|
|
|
|
Thaer Hamael wrote: I wount to creat Form In .Net Have One ProgressPare .
What is ProgressPare ? You can use ProgressBar control. Set the Max value to the rowcount of your datatable.
|
|
|
|
|
Thanks Mr
But I need To create Form to call it for more one form fill DataTable
Thaer
|
|
|
|
|
Hi All,
I have a richtextbox named "editor".I want to save its "text" as a dtd file.how can i use.urgent response will be appriatiated
regards,
chanzeb
|
|
|
|
|
chanzeb wrote: I want to save its "text" as a dtd file.
what is DTD file ?
|
|
|
|
|
dtd stands for "document type definition".used to define xml docment rules and elements.
|
|
|
|
|
If you know the file format and encoding you can write that. I don't think that rich editor will provide inbuilt methods for creating DTD files.
|
|
|
|
|
i want example on assembly versioning with code
sekhar
|
|
|
|
|
|
give the exlpanation on versioning in assembly
|
|
|
|
|
give the cup of tea
EDIT: I suppose I'd better explain. What you need to do is go away and do some research, Google[^] is a very good resource for this. If you still can't find what your looking for or get stuck on something specific then come back and ask for help.
When you ask for help you should state what the specific problem is, you should also say what you've tried and what research you've done. Finally you should be polite in your questions, you should take time to write the post and make sure you do the simple things like say please and not demand things.
When you post a question that comes across as being lazy, impolite and in fact rude all you'll get is stupid answers (like "And I want a cup of tea").
|
|
|
|
|
thanks for u r suggestions ,i will follow comming day what u specify
|
|
|
|
|
Would you please give me a simple example regard sending and receiving data by means of USB Port?
Mansureh Shahraki Moghaddam
|
|
|
|
|
Normally you don't talk to the USB port, you talk to a device that is connected via the USB.
example: a USB printer uses a printer driver, you talk to that driver which presents
itself as a printer (you don't have to be aware there is USB involved at all).
same is true if you have a USB-to-RS232C cable, or a USB-to-Ethernet cable.
When I bought my USB-to-serial cable, it came with a CD-ROM containing a driver.
When I installed it, it turned the port into a regular serial port, so it shows up
in all serial port enumerations, and most/all serial apps can use it, whether
HyperTerminal or some .NET based app using SerialPort class.
The app never is aware the USB-based serial port is connected in a different manner,
all the nasty details are hidden by Windows and the device drivers.
If the above does not satisfy you, you can build your own electronics target (say
a microcontroller based design), give it a USB interface, an operating system and a USB
driver; at PC side you would also need your own device driver so you can support read
and write operations from and to your device. Most often it is not worth the effort,
why reinvent the existing protocols as used on serial ports, Ethernet, etc?
|
|
|
|