|
Hi,
Can you tell me to develop Smart Card Application in C#.
|
|
|
|
|
|
Since the var keyword has been introduced for anonymous types I have noticed more and more code examples (and seen in my work) people using var rather than a defined type.
To my mind var should only be used when an anonymous type is being used and only then not instead of a defined type.
What are peoples thoughts? are you seeing a rise in the use of var?
|
|
|
|
|
If you give a novice programmer something to abuse, they will abuse it. Its about the first rule of computer programming.
The only place I have used var so far is in the return from a LINQ query, I see no reason to use it extensively. So in short, I agree with you.
|
|
|
|
|
I absolutely agree with you.
As I see it, every developer must be aware what he/she is doing. He has to know about the types etc. he is using etc. Using a paradigma like "Uh I don't know what the return type of this method is, but hey who cares, the compiler will do it for me" is not the way I agree with.
So in my opinion the excessive use of "var" makes the code difficult to read, you always have to search for the last assignment...
As far as I know, var was introduced only for the use with LINQ, but as you already said, it will be abused...
Regards
Sebastian
P.S.: Had a big discussion here last week, if we should use it throughout the code or not...
|
|
|
|
|
What has been worrying me is more senior experienced programmers starting to do it.
Brought back horrible memories of VB6 variant <shudder>
|
|
|
|
|
|
Eddy Vluggen wrote: Resharper keeps reminding me that I should use "var" instead of the type-safe declaration
I know! Well, they've got it wrong. I hate the use of this subversive keyword. Fair dos for LINQ but no place elsewhere. Presumably you can tell Resharper not to do that, but I can't be bothered to wade through all the options pages. It does alsorts of things I don't care for - breaking my lines up, trying to use 'object initializers' to squeeze everything onto the construction line, putting space between casts etc.
It should chill out a bit.
Regards,
Rob Philpott.
|
|
|
|
|
Since you're asking for opinions, here's mine.
I would not be opposed to seeing var when you are declaring a new something (especially when the type name is long). For example:
var cache = new Dictionary<string, LongTypeNameIWantToTypeJustOnce>();
as opposed to
Dictionary<string, LongTypeNameIWantToTypeJustOnce> cache = new Dictionary<string, LongTypeNameIWantToTypeJustOnce>();
which I either have to break up into multiple lines or have one really long line. Even if the line is not too long, the second way is still noisier than the first.
For the record, this is one of the things I like about the VB syntax (only needing to write the type once when declaring and "new"-ing a variable at the same time)
|
|
|
|
|
I agree, it is being abused. I never use var, and as I also never use Linq, I don't expect to.
|
|
|
|
|
The LINQ to XML stuff makes handling XML files a breeze.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
I just use an XmlDocument.
I was doing some more XSL last night. Maybe you have a Linq way of doing this...
In my XML file I have a processing instruction to indicate the XSL file and stylesheet to use:
<?xml-stylesheet type="text/xsl" href="mystylesheets.xsl#somestylesheet"?>
Unfortunately, those aren't Attributes, they are in the Value! I've been using a Regular Expression to get this information:
private static readonly System.Text.RegularExpressions.Regex HrefReg =
new System.Text.RegularExpressions.Regex
(
"href\\s*=\\s*(?'quot'[\"'])(?'href'.*?)((?'sep'#)(?'id'.*?))?\\k'quot'"
) ;
Do you have a Linqish way to do that?
|
|
|
|
|
Hello,
i need to add a property to a user control that appear in the properties editor.
i have tried to use the uieditor class but it not working properly.
Any suggestion please
regards
dghdfghdfghdfghdgh
|
|
|
|
|
dtpFromDate & dtpTodate are DateTimepickers and a TextBox txtNoofDays
private void dtpFromDate_ValueChanged(object sender, eventArgs e)
{
double value=Convert.ToDouble(txtNoOfdays.Text);
dtpToDate.Value=dtpFromDate.Value.AddDays(value);
}
Here I got the error at--> //double value ----
Input string was not in correct format
How to resolve It.
|
|
|
|
|
Udayaraju wrote: dtpToDate=dtpFromDate.AddDays(value);}
i Hope this will work..
vikas da
|
|
|
|
|
The problem is in First statement
double value=Convert.ToDouble(txtNoOfdays.Text);
The Convert.ToDouble() function is not getting the correct input to convert. Like there can be nothing in the text box or there can be a space or any other character which is throwing error that the string is not in correct format.
Regards,
Kaushal Arora
|
|
|
|
|
i want to set the query of the sub report and i want to get that query from the main report. is there any way out ? is there any way to get all the attributes of the subreport from main report ?
if any1 knows then reply.. its urgent.
|
|
|
|
|
I have to export the data displayed in the WebBrowser to Microsoft Excel. It is a window application using c#. Does anyone know how to do it. Please help.
Thanks
|
|
|
|
|
I have a measurement device that measure and sends a data update string to the PC once a millisecond, so you can see what's happening in real-time.
I would like to let authorized people see my data via the web in roughly real time using a web browser such as Internet explorer. I have an internet connection with valid IP address that whole of day it is connected.
My idea so far, is to divide the problem into originator (my PC putting data on database) and clients (pc's logging into my computer via web browser to see latest data).
Originator:
I thought I would use SQL database to save average measured data into the database every one seconds.
Clients:
This has to log in, see designed GUI, select charts, table and reports via menu.
I am very keen to hear any suggestions. I want to keep it in C#.
Does anyone know how I can do this?
With best regards,
Email: m.fadaei@zssco.com
|
|
|
|
|
Hi....
mehdy_137 wrote: Does anyone know how I can do this?
what does it mean ???
can you explain your problem to the point..might be somebody can help you then...
vikas da
|
|
|
|
|
thanks for your reply
i have no good knowledge about web based programing, please introduce me general help, references that i need to read, sample projects and etc.
tnx again
|
|
|
|
|
This is C# forum.... should go to asp.Net or Web development forum..
any way web acess is the later part what are you doing for saving the data...
any service ???
vikas da
|
|
|
|
|
ok.
if i underestand correctly, i need 2 different sub project : database and asp.net. can i design charts, reports and online monitoring with asp.net ?
mehdi
|
|
|
|
|
mehdy_137 wrote: can i design charts, reports and online monitoring with asp.net ?
I really dont know the answer ???? please ask in ASP.NET forum
vikas da
|
|
|
|
|
hey, in the process of developing an excel COM addin using c# .net, i would like to generate a button on the excel standard toolbar.
I know about registering the com interop n stuff... can yu give me d code to show d button as soon as i run my project that opens MS Excel along with my button on the standard toolbar
|
|
|
|