Skip to main content

Posts

Showing posts from July, 2009

HOW TO REMOVE PRINTER DRIVER

You can remove printer driver by following steps that are defined below:

1. Go to Printers & Faxes

2. Delete the printer configuration in question. (For safety's sake, you may want to consider deleting all printer configurations to ensure that you aren't still using some element of the driver in another configuration somewhere. Remember that a driver is often times more than just a single file. It may involve shared libraries in use by multiple printer configurations.)

3. Go to File --> Server Properties

4. Go to the Drivers tab. You will be presented with a list of drivers.

5. Select a Driver and press the "Remove" button.

\\server is not accessible. You might not have permission to use this network resource. Contact the administarator of this server to find out if you

Problem:

Often time I receive a problem while my computer is connected with networks.It work properly on server 5 minutes ago but after 5 minutes it display me the error.

"\\server is not accessible. You might not have permission to use this network resource. Contact the administarator of this server to find out if you have access Permissions. Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again."

I digged alot about the solution of the problem. Some post suggest block your firewall which I was not using and many other solution. But nothing work.

After a long hours of digging on web for the above problem and implementing all the solutions that they suggest in their post, I have found a valuable command which solve my problem and now I am not facing this problem and if some time I face then use the solution.


Oh........ I forget the sha…

OUTLOOK CANNOT CONNECT TO YOUR OUTGOING SMTP EMAIL SERVER.

Dear Friends,

I am using MS OUTLOOK for my Email. It was working fine but since last day it is giving me an error.

"Outlook can not connect to your outgoing SMTP E-mail server. If you continue to recieve this message contact your Administrator or ISP Provider."


After digging long hours I get some solutions.

1) Change smtp port from 25 to 587.

OR

2) create the account again.

OR

3) Check Firewalls either they are not creating the problem.

OR

4) If any of the above options is not working then contact to your ISP Provider. Either they have block the SMTP address from their side. Ask them to allow your SMTP to send E-mails.

In my case the fourth option works.

I hope that this will help you in solving the problem.

Wish you all the best............

CONNECTION STRING IN WEB.CONFIG IN C#

Dear Fellows,

You can create declare connection string in web.config file. You can do so by

<add name="Connection_Name" connectionString="server=(local);database=database_name;uid=sa;pwd=sa" providerName="System.Data.SqlClient"/>

Now you can call this connection in any .aspx page by this command.

NOTE: I am getting connection string in a string variable named "Path"

string path = System.Configuration.ConfigurationManager.ConnectionStrings["Connection_Name"].ConnectionString;

See how simple is this. In the same way you can use this connection string in all your .aspx pages.

Take Care and Enjoy...............

The TargetControlID of '_AccordionExtender' is not valid. The value cannot be null or empty.

Once I was working with a Ajax Based Project in .NET. I was using Accordian Pane. My code was like this (Please note this is just a sample code only for readers):

<ajaxToolkit:Accordion runat="server" TransitionDuration="240" FadeTransitions="true" FramesPerSecond="40" SelectedIndex="0" >
<Panes>
<ajaxToolkit:AccordionPane ID="hd1" runat="server">
<Header>
<a href="" onclick="return false" >HEADER 1</a>
</Header>
<Content>
CONTENT OF HEADER 1
</Content>
</ajaxToolkit:AccordionPane>


<ajaxToolkit:AccordionPane ID="hd2" runat="server">

WEBCONFIG FILE FOR AJAX IN ASP.NET 2.0 , ASP.NET 3.0 AND ASP.NET 3.5

Dear Friends,
When I have installed VSTS 2008 in my PC, I faced problem in using Ajax Files. I follow all the instructions that was told in vidoes on www.asp.net\learn but no result.

After investing a number of days and hours, I come to the conclusion that I must have to see my old Ajax Projects WebConfig files. When I compare my existing projects webconfig files and old webconfig files I found that they have no Commands to work with Ajax Based Controls.
The reason to publish this webconfig file is to save others time as they might face some time the same problem which I faced and wasted my time.
Below is the entire webconfig file. Simply copy it in your webconfig file or change it as per your need.

<?xmlversion="1.0"?><configuration><configSections><sectionGroupname="system.web.extensions"type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quo…

How to Insert a new Node in XML File in C#

This is 4th post regarding XML. In this, I will teach you how to insert a new node in XML file.

The sample XML file is shown below which is before Inserting new Node.

<?xml version="1.0"?>
<Library>
<Subjects name="Computer Science">
<Publishers name="Wrox">
<Begginers>Beginning C#</Begginers>
</Publishers>
</Subjects>
</Library>


Now write the below code to insert a new node in XML.

XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(filename);
//Create New Element
XmlElement element = xmldoc.CreateElement("Begginers");
element.InnerText = "BEGINNER C# (INDIAN WRITER)";
//Insert Node after Publishers
xmldoc.DocumentElement["Subjects"].ChildNodes[0].InsertAfter(element, xmldoc.DocumentElement["Subjects"].ChildNodes[0].LastChild);
FileStream fsxml = new FileStream(filename, FileMod…

How to Insert an New Element in XML File in C#

This is my third post in which I tell you how to Insert an Element in XML file.

The sample XML file is shown below

<?xml version="1.0"?>
<Library>
<Subjects name="Computer Science">
<Publishers name="Wrox">
<Begginers>Beginning C#</Begginers>
</Publishers>
</Subjects>
</Library>


Now you write the code to insert a new Element.

XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(filename);
//New XML ELEMENT Created
XmlElement xElement = xmldoc.CreateElement("Publishers");

//NEW XML ATTRIBUTE Created
XmlAttribute xAttribute = xmldoc.CreateAttribute("name");
xAttribute.Value = "Indian Book";
xElement.SetAttributeNode(xAttribute);

//Create Inner Element
XmlElement element = xmldoc.CreateElement("Begginers");
element.InnerText = "BEGINNER C# (INDI…

How TO READ XML IN C#

This is my Second post regarding XML. In first post i told you that how to create a xml file in C#. Now we will learn that how can we read a xml file in c#.

To read an XML file in c# you need to add a namespace.

using System.XML;

Now write the below code to read xml file.

XmlTextReader reader = new XmlTextReader(filename);
reader.Read();
while (reader.Read())
{
if(reader.Value.Trim()!="")
Console.WriteLine("Attribute Count={0}, Attribute={1}, Value={2}", reader.AttributeCount, reader.GetAttribute("name"),reader.Value);
}



I used this code to get my result which I want. You can modify the code to get yours one.

Enjoy..........

HOW TO WRITE XML IN C#

Below is the code in C# which you can use to create an XML file.



Note: You must include System.XML namespace. You can do so by writing the below command.

using System.XML;

The sample of XML is shown below:

<?xml version="1.0"?>
<Library>
<Subjects name="Computer Science">
<Publishers name="Wrox">
<Begginers>Beginning C#</Begginers>
</Publishers>
</Subjects>
</Library>

Now write the below code to get the above result.

XmlTextWriter writer = new XmlTextWriter(filename, null);
//SELECT THE FORMATTING STYLE (INDENTED, NONE)
writer.Formatting = Formatting.Indented;
//STARTING TAG
writer.WriteStartDocument();
//STARTING "Root"
writer.WriteStartElement("Library");
//STARTING ELEMENT NAMED "COMPUTER SCIENCE"
writer.WriteStartElement("Subjects");
writer.WriteAttributeString("name"…