Thursday 24 October 2013

MySql Connection Strings in Ado.Net

Today, MySql is open source database in the world. In Ado.net to make connection to MySql , we have different connection strings. Basically it is not easy to remember different database connection strings in Ado.Net. So I am sharing some connection strings to connect to the MySql database using different drivers.


Using ODBC


// ODBC — MyODBC Driver — remote database

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString = “Driver={MySql}; Server=db.domain.com; Option=131072; Port=3306; Stmt=; DataBase=DataBaseName; Uid=UserName; Pwd=Secret;” ;

conn.Open();


Using OLEDB


// OleDb

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString = “Provider=MySqlProv; Data Source=ServerName; User id=UserName; Password=Secret”;

conn.Open();


Using .Net DataProvider


// .NET DataProvider from CoreLab

using CoreLab.MySql;

MySqlConnection conn = new MySqlConnection();

conn.ConnectionString =”Host=ServerName; DataBase=DataBaseName; Protocol=TCP; Port=3306; Direct=true; Compress=false; Pooling=true; Min Pool Size=0; Max Pool Size=100; Connection Lifetime=0;

User id=UserName;Password=Secret”;

conn.Open();



MySql Connection Strings in Ado.Net

Tuesday 15 October 2013

PHP Project Training In Vadodara



Website Developement and PHP, .Net Training, Website Hosting by IT Company in Baroda

Best IT Company in Vadodara.
Provides Web Hosting, Website Development, Website Designing,
Live Project Training, PHP Training, .Net Training, WordPress and Ecommerce Training, Last semester Project Guidance for BCA, MCA, BE, Msc IT, Diploma Student.

Visit Our Website :-
www.paceinfonet.org
www.paceinfonet.com

502B, 6th Floor, Concorde Bldg.,
RC Dutt Road, Alkapuri,
Vadodara - 390007, Gujarat ( india )

Phone : 0265 3051919
Mobile : +91 - 8000195514 

Sunday 6 October 2013

Display Random Header Images in WordPress

Display Random Header Images in WordPress


randomheaderimages


Most blog designs get boring if they have a huge header picture and it is static. This is when this tutorial comes in to make your header images dynamic because it rotates on each visit. You can select as many images as you want to rotate randomly. It brings life to a blog.


First you need to name your images in this format:



  • headerimage_1.gif

  • headerimage_2.gif

  • headerimage_3.gif


You must separate the name with an underscore. You can change the headerimage text to himage or anything you like.


Once you have done that paste the following code in your header.php where you would like the images to be displayed or in any other file.


<img src="http://path_to_images/headerimage_<?php echo(rand(1,3)); ?>.gif"
width="image_width" height="image_height" alt="image_alt_text" />

Make sure that you change the number 3 if you decide to do more than 3 images. This code is not exclusive for WordPress,

it will work with any php based platform.



Display Random Header Images in WordPress