• Home
  • Trace mobile number (From India)
  • Entertainment
  • SiteMap
  • Home
  • ASP.NET
  • C#
  • BLOGGING
  • SQL SERVER
  • FACEBOOK
  • Entertainment
if you want your add mouseover effect on your web page links you can do it by using style tags.

In this example, i will tell you How you can change link color and appearence When the mouse is placed over the link.In the below example when someone placed  mouse over the link the text color will change  and the underline disappears.

You can do this by just Place the <STYLE> tag between your <HEAD> and </HEAD> tags.

<STYLE>
<!--
A:active { color:#0000FF; text-decoration; }
A:hover { color:#FF0000; text-decoration: none; }
//-->
</STYLE>

You can change the color code according to your need.
In this article I am going to explain how to read or write connection strings in web.config file using asp.net .

In this example i will show you how to write connection string in a Web.config file and also i will show you how to read that connection string from  Web.config file .



Write connection strings in web.config file

We write connection string inside connectionStrings element.The connectionStrings element is a direct child of the <configuration> element and a peer of the system.web element.


<connectionStrings>
            <add
              name="MyConString"
              connectionString="Data Source=serverName;Initial
    Catalog=YourDataBasename;Persist Security Info=True;User
    ID=dbuserName;Password=dbpassword"
              providerName="System.Data.SqlClient"
  />
      </connectionStrings>


Read connection strings from web.config file

After adding connectionString we need to write the some code in our codebehind file to get connection string from web.config.Below is code which we have to write to read connectionString from web.config file.


C# CODE



using System;
using System.Data.SqlClient;
using System.Configuration;
public partial class dbString  : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{  
//the below line will read ConnectionStrings from web.config file.
string dbstrcon = ConfigurationManager.ConnectionStrings["MyConString"].ConnectionString;
//the below line will create new sqlconnection and connection to database by using connection string from web.config file.
SqlConnection mycon = new SqlConnection(dbstrcon);
mycon.Open();
}
}


Newer Posts Older Posts Home

Most Read

  • How to Capitalize the First Letter of All Words in a string in C# ?
  • keyboard shortcuts For Windows
  • List Of Best Free WordPress Plugins : 2012
  • Read Write XML Data-Read Write XML File Using C#, VB.NET In Asp.Net
  • How to Shake Internet Explorer - Javascript Code
  • How to Choose a Nice Topic for your Blog .
  • Free Search Engine Submission List ,search engine optimization
  • Number validation in Textbox of ASP.NET Using Regular Expression validator
  • Javascript:Percentage Gain Javascript Calculator
  • .Net Interview Questions and Answers on OOPS | OOPS Frequently Asked Questions
Google
Custom Search Bloggers - Meet Millions of Bloggers

Join Us On FaceBook

  • Recent Posts
  • Comments

All Topics

  • ►  2014 (10)
    • ►  January (10)
  • ►  2013 (14)
    • ►  October (1)
    • ►  April (2)
    • ►  March (11)
  • ▼  2012 (142)
    • ►  December (25)
    • ►  October (1)
    • ►  September (9)
    • ▼  August (2)
      • Mouseover Link Effects Using CSS Style Tags
      • ASP.NET EXAMPLE : Read or Write connection strings...
    • ►  July (7)
    • ►  June (2)
    • ►  April (5)
    • ►  March (27)
    • ►  February (27)
    • ►  January (37)
  • ►  2011 (23)
    • ►  December (3)
    • ►  November (6)
    • ►  October (12)
    • ►  September (2)
  • ►  2009 (1)
    • ►  June (1)

Tips & Tricks

  • What is good One Blog and Many Categories, or Many Blogs with One Categories?
  • Adding Twitter tweet button to each Blogger posts.
  • How to Choose a Nice Topic for your Blog .
  • Embedding YouTube Videos ,movie in your blog
  • Facebook iFrame Apps – Getting Rid of Scrollbars
  • Facebook Analytics:How to Set Up Your Website or Blog with Facebook Insights for Domains
  • How To Add Perfect Share Box to Blogger
  • Blogger Free Images Hosting Tip,Free unlimited bandwidth image hosting for Blogger blogs
  • Add “Link to this post” codes below Each blogger posts
  • Free Search Engine Submission List ,search engine optimization
  • Adsense Tips for Maximum CTR
  • List Of Best Free WordPress Plugins : 2012
2012 tectopix. All rights reserved.
Designed by tectopix