|
thanks ..Im taking your sugesstion given in note
|
|
|
|
|
Great.
Colin Angus Mackay wrote: have the class control access to it via a property.
I heard writing properties inside class as a bad habit ? What do you say ?
|
|
|
|
|
Who told you that? Properties are not a bad habit at all - they allow you to hide the implementation of setting and retrieving values.
To a certain extent, properties are just syntactic sugar hiding the fact that these are internally functions called set_... and get_....
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, But I read some where like exposing class variables through properties is a bad habit.. Any way I always used to do that, just seen Colin's code and got doubt again...
|
|
|
|
|
N a v a n e e t h wrote: But I read some where like exposing class variables through properties is a bad habit
Actually, it is a very good habit. You may, presently, wish to allow direct access to the variables because the class doesn't care what outside entities set on the variable. But if you do that and then realise that in fact you need to fire off an event, or check the validity of the value then you can't do anything about it.
Properties are methods in reality. A property called Address will actually compile to get_Address() and set_Address(string value). So, by using properties now, even although you may not strictly need them now, saves problems later when you make the field private. You can easily add code to the method (that backs the property) because the public interface has not changed. It isn't so easy moving from public field to public property because they are not the same thing. (Even although in C# the look like the same thing)
Two blog entries of mine that might be of interest:
* Why make fields in a class private, why not just make them public?[^]
* The public fields debate again[^]
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Thanks that was excellent
|
|
|
|
|
N a v a n e e t h wrote: I heard writing properties inside class as a bad habit ? What do you say ?
Good grief no. public fields (aka member variables) are a bad habit.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Variables can be declared as Global in the configuration file.
|
|
|
|
|
help me with coding
Mohan
|
|
|
|
|
1)open an connection
2)pass your querry or stored procdure.
3)check if any value is returned
4) redirect to next page
|
|
|
|
|
thanks let me try it once
Mohan B
|
|
|
|
|
|
hi
I need a watermark imaging source code in asp.net 2.0 csharp to create watermarks on images at runtime there is a watermark creator available on codeproject but that is asp.net 1.0 Can some body help please
regards
Harry
|
|
|
|
|
Try to google dear it seasily available on soem forum.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
hi
thanks for the help i did try google but was not able to find anything useful can you send me the link if you have one
thanks
harry
|
|
|
|
|
Dear Every one i am new in Dot Net i want to add different banner in header and footer using one admin section my program in asp.net and C#
Any body here to guide me in this situation
Rakesh
-- modified at 3:25 Thursday 9th August, 2007
|
|
|
|
|
I'm having DropDown list in aspx page. When I select the Drop down list,it will go to the Html page, after that it ill display it in a iframe text which is in a aspx page, after doing some edit, the edited text will be stored in a data base.
How to do that? Give me any example.
Thanks in advance
|
|
|
|
|
Hi,
I want to copy the data in a csv to sqlserver 2005 database.
Please help me in this regard.
Data in csv is in this format:
"1","Sa","New Aol","America,NY",""
Please reply asap..
Thanks a lot!!
SHWETA!!
SHWETA!!
|
|
|
|
|
Did you try the DTS Wizard?
|
|
|
|
|
That is hardly a question that belongs on the ASP.NET forum, but now that it's been asked, I'll try and answer it. Vasudevan gave you a basic answer, but there is no DTS wizard in SQL 2005. Right click the database you want to import into, then the Import/Export Wizard (slave to SSIS), will prompt you for a from data source, where you choose a flat file provider, and a to data source, where you choose your target database. It's a wizard, follow its help.
"Once in Africa I lost the corkscrew and we were forced to live off food and water for weeks." - Ernest Hemingway
My New Blog
|
|
|
|
|
Brady Kelly wrote: no DTS wizard in SQL 2005
Since I have both the tools in my desktop, I think, I have overlooked the fact.
|
|
|
|
|
I want to transfer the data using asp.net(C#) code.
plz help me!!
SHWETA!!
|
|
|
|
|
What it has to do with ASP.NET???
Anyways you can try DTS wizard.
|
|
|
|
|
Hi shweta first thing is that u posted this message second time in short time.
also keep habbit of loking for the solution on goolge, as of me its a solution for all what we need.
regarding ur post i have the solution but it is through programming
tell me on what platform u r working currently.
u can also mail me for asking about the same.
personalmail@mysampatti.com
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
I have habit of searchin by my self and then askin the question..
Abd I got the solution by my self.. I have written the code that can do the task..
Thanks a lot..
SHWETA!!
|
|
|
|