|
Hello,
I am developing a web app and trying to use Enterprise Library 2.0. I am using it for logging for now. I achived the logging on a flat file but when I tried to start doing the logging by using a DataBase Listener. I failed.
Here's how I am using it after including all possible references to my web app.
I configured a datasource with following attributes setup:
-Server (my server name)
-Database (my database in my server)
-Integrated Security (I used API.. something, false, true and I even tested after removing this tag aswell).
-user (my user name)
-pwd (my password)
Then I configured a Database Listner and gave the reference of my datasource.
Then I configured a Logging block by adding different categories and then I added reference to my Database listner in categories.
I also tested by adding and removing following in web.config within CodeDom tag:
type="Microsoft.CSharp.CSharpCodeProvider,
System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
compilerOptions="/d:TRACE" />
----------------
After doing this all when I try to log an entry after specifing the category to the entry and other required attributes. NOTHING HAPPENS in tables I generated after running the script file provided by Best Patterns and Practices team. I couldnt log any data.
Is there anybody who can help me or tell me what I am doing wrong?
|
|
|
|
|
Hi every body!
I need the C# code to back up a database and to restore it including sql code(using sql server). There should be ways to select the back up location and to select the backup file to restore. I'm thankful in advance if somebody can kindly provide me this help....please.
-- modified at 9:17 Wednesday 26th July, 2006
|
|
|
|
|
There are articles all over the web on how to do this. Just fire up Google or Search through the articles on this site.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
In which situation we have to use abstract class & interface?
lavate
|
|
|
|
|
lavate malllik wrote: In which situation we have to use abstract class & interface?
It depends on your requirements, some times they can be interchanged, some times they cant.
|
|
|
|
|
Probably this can help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconabstractclassesversusinterfaces.asp
http://www.codeproject.com/csharp/abstractsvsinterfaces.asp
|
|
|
|
|
1) An abstract class is like an interface with some fuctionality predefined (something an interface cannot have).
2) Multiple inheritance of classes is not possible.
3) Multiple implementation of interfaces is possible.
With these 3 bits of information you should be able to answer your own question.
|
|
|
|
|
Hi all,
I'm fresh man of OOP. so I want know When use static method and when use non static method ?
Any guidelines for use non static method or static method?
c# code sample:
class myclass
{
public myclass() {}
private int _i= 0;
public int Value
{
get { return _i;}
set {_i= value; }
}
public static int GetDoubleValue(int value)
{
return 2 * value;
}
public static int GetDoubleValue(myclass c)
{
return 2 * c.Value;
}
}
class myclass
{
public myclass() {}
private int _i= 0;
public int Value
{
get { return _i;}
set {_i= value; }
}
public int GetDoubleValue()
{
return 2 * this.Value;
}
}
|
|
|
|
|
Use static methods where you imagine the method would be called by someone who doesn't have an instance of your class. For example, a method that creates a class instance needs to be static. Often, a method is static because it's the only method a user is likely to call in a given instance, it doesn't require any state ( static objects are not tied to an instance, and so have no state beyond static variables ) and so a static method means they are not forced to create an instance just to call a method.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Christian Graus,
Thanks for your reply.
I know that differents between static method and non static, just be at a loss to when use a static method or non static one.
Christian Graus wrote: static objects are not tied to an instance
This is best answer about this question. I will spend more time think about it.
do you have any guideline about it?
Thanks again.
|
|
|
|
|
Here is a great example:
http://www.pp.rhul.ac.uk/~george/PH2150/html/node48.html[^]
The way I understand it, static methods are not object-specific. A static method will always only have one instance, irrespective of what object invokes it.
(Look at the sheep example, old McDonald explains it better than I do)
you can't forget something you never knew...
|
|
|
|
|
hi evilnoodle,
Thanks for your reply.
I have read the article your gave. It's simple but helpful for me.
-- modified at 8:58 Wednesday 26th July, 2006
|
|
|
|
|
You would want to use static methods when it wouldn't make sense to create an instance fo the class for it.
For example:
<br />
Math myMath = new Math();<br />
myPath.sqrt(3.14);<br />
Wouldn't make sense. You don't want to have to create a Math object just to use the square root function. Instead, you make the square root function a static method of the Math class, so you can just say
Math.sqrt(3.14);
Hope that helps some.
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
|
|
|
|
|
hi MartyExodus,
MartyExodus wrote: Hope that helps some.
yeah, It's helpful to me.
more and more answers help me understand when use a static method.
Thanks a lot.
|
|
|
|
|
A good time to 'investigate' using a static method is if no 'instance' state needs to be persisted, read, or changed in the method.
|
|
|
|
|
hi A.A.
A.A. wrote: no 'instance' state needs to be persisted, read, or changed in the method.
is detailed with
Christian Graus wrote: static objects are not tied to an instance
Thanks a lot.
|
|
|
|
|
I am developing a Windows Service under VS 2005. Within the code some shared network directories have to be enumerated but when the code attempts to verify the existence of any one of those directories with code similar to: Directory.Exists("\\somedir\subdir") the function returns false every time apparently because network authentication is not automatically done by Directory.Exists. Can anyone point me in the write direction (e.g. example) of what I must do programatically to ensure the network authentication is in place to allow this command to succeed in a Windows Service when using UNC names?
Thank you...
|
|
|
|
|
Never mind. Just had to set up the proper service logon.
|
|
|
|
|
|
Have a look in the obj folder and see for yourself. The difference is, the C# compiler isn't compiling an executable file, just MSIL.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: look in the obj folder
Nothing too exciting in the obj folders of my VS2005 projects. Just a ton of intermediate files
I'd like to help but I am too lazy to Google it for you.
|
|
|
|
|
Ok, I don't mind helping out here, and have gotten help here, BUT it is frustrating when people ask the SAME QUESTION over and over.
You asked basically this SAME question two days ago. What part of C# DOES NOT GENERATE OBJ FILES did you not understand? Do some reading on the environment on your own. This is BASIC to the .NET platform.
This is C# w/.NET and NOT C or C++. Get over it or code in those languages.
Sorry for the rant guys.
WhiteWizard
aka Gandalf
|
|
|
|
|
MCSD-Gandalf wrote: You asked basically this SAME question two days ago
Don't worry - That happens a lot!
MCSD-Gandalf wrote: Sorry for the rant guys.
That's okay - Some of the people here just seem to provoke rants.
|
|
|
|
|
Colin Angus Mackay wrote: MCSD-Gandalf wrote:
You asked basically this SAME question two days ago
It is amazing the amount of impatience some people have when waiting for their questions to be answered. I am starting to just simply say to look at my sig
I'd like to help but I am too lazy to Google it for you.
|
|
|
|
|
Its in the book on page 35. Right under the brief introduction to MSIM.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|